2019-03-29 16:45:24 +08:00
|
|
|
; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \
|
2020-06-08 16:55:31 +08:00
|
|
|
; RUN: -stop-before=finalize-isel -verify-machineinstrs | \
|
|
|
|
; RUN: FileCheck -check-prefix=BEFORE-FINALIZE-ISEL %s
|
|
|
|
; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \
|
|
|
|
; RUN: -stop-after=finalize-isel -verify-machineinstrs | \
|
|
|
|
; RUN: FileCheck -check-prefix=AFTER-FINALIZE-ISEL %s
|
|
|
|
; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \
|
2019-03-29 16:45:24 +08:00
|
|
|
; RUN: -verify-machineinstrs | FileCheck %s
|
|
|
|
; RUN: llc -mcpu=pwr7 -mtriple=powerpc64le-unknown-linux-gnu < %s \
|
|
|
|
; RUN: -verify-machineinstrs | FileCheck -check-prefix=CHECK-PWR7 %s
|
|
|
|
|
|
|
|
define double @test_setrndi() {
|
|
|
|
entry:
|
|
|
|
%0 = tail call double @llvm.ppc.setrnd(i32 2)
|
|
|
|
ret double %0
|
|
|
|
|
2020-06-08 16:55:31 +08:00
|
|
|
; BEFORE-FINALIZE-ISEL: test_setrndi
|
|
|
|
; BEFORE-FINALIZE-ISEL: SETRNDi 2, implicit-def dead $rm, implicit $rm
|
|
|
|
|
|
|
|
; AFTER-FINALIZE-ISEL: test_setrndi
|
|
|
|
; AFTER-FINALIZE-ISEL: MFFS implicit $rm
|
[PowerPC] Fix RM operands for some instructions
Summary:
Some instructions have set the wrong [RM] flag, this patch is to fix it.
Instructions x(v|s)r(d|s)pi[zmp]? and fri[npzm] use fixed rounding
directions without referencing current rounding mode.
Also, the SETRNDi, SETRND, BCLRn, MTFSFI, MTFSB0, MTFSB1, MTFSFb,
MTFSFI, MTFSFI_rec, MTFSF, MTFSF_rec should also fix the RM flag.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D81360
2020-07-30 10:10:49 +08:00
|
|
|
; AFTER-FINALIZE-ISEL: MTFSB0 31, implicit-def $rm
|
|
|
|
; AFTER-FINALIZE-ISEL: MTFSB1 30, implicit-def $rm
|
2020-06-08 16:55:31 +08:00
|
|
|
|
2019-03-29 16:45:24 +08:00
|
|
|
; CHECK-LABEL: @test_setrndi
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-DAG: mffs 1
|
|
|
|
; CHECK-DAG: mtfsb0 31
|
|
|
|
; CHECK-DAG: mtfsb1 30
|
|
|
|
; CHECK: blr
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test_setrnd(i32 signext %x) {
|
|
|
|
entry:
|
|
|
|
%0 = tail call double @llvm.ppc.setrnd(i32 %x)
|
|
|
|
ret double %0
|
|
|
|
|
2020-06-08 16:55:31 +08:00
|
|
|
; BEFORE-FINALIZE-ISEL: test_setrnd
|
|
|
|
; BEFORE-FINALIZE-ISEL: SETRND killed %1, implicit-def dead $rm, implicit $rm
|
|
|
|
|
|
|
|
; AFTER-FINALIZE-ISEL: test_setrnd
|
|
|
|
; AFTER-FINALIZE-ISEL: MFFS implicit $rm
|
[PowerPC] Fix RM operands for some instructions
Summary:
Some instructions have set the wrong [RM] flag, this patch is to fix it.
Instructions x(v|s)r(d|s)pi[zmp]? and fri[npzm] use fixed rounding
directions without referencing current rounding mode.
Also, the SETRNDi, SETRND, BCLRn, MTFSFI, MTFSB0, MTFSB1, MTFSFb,
MTFSFI, MTFSFI_rec, MTFSF, MTFSF_rec should also fix the RM flag.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D81360
2020-07-30 10:10:49 +08:00
|
|
|
; AFTER-FINALIZE-ISEL: MTFSF 255, %7, 0, 0, implicit-def $rm
|
2020-06-08 16:55:31 +08:00
|
|
|
|
2019-03-29 16:45:24 +08:00
|
|
|
; CHECK-LABEL: @test_setrnd
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-DAG: mffs 1
|
|
|
|
; CHECK-DAG: mffprd [[REG1:[0-9]+]], 1
|
|
|
|
; CHECK-DAG: rldimi [[REG1]], 3, 0, 62
|
[PowerPC] Support extended mnemonics mffprwz etc.
Summary:
Reported in https://github.com/opencv/opencv/issues/15413.
We have serveral extended mnemonics for Move To/From Vector-Scalar Register Instructions
eg: mffprd,mtfprd etc.
We only support one of them, this patch add the others.
Reviewers: nemanjai, steven.zhang, hfinkel, #powerpc
Reviewed By: hfinkel
Subscribers: wuzish, qcolombet, hiraditya, kbarton, MaskRay, shchenz, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66963
llvm-svn: 370411
2019-08-30 05:53:59 +08:00
|
|
|
; CHECK-DAG: mtfprd [[REG2:[0-9]+]], [[REG1]]
|
2019-03-29 16:45:24 +08:00
|
|
|
; CHECK-DAG: mtfsf 255, [[REG2]]
|
|
|
|
; CHECK: blr
|
|
|
|
|
|
|
|
; CHECK-PWR7-LABEL: @test_setrnd
|
|
|
|
; CHECK-PWR7: # %bb.0:
|
|
|
|
; CHECK-PWR7-DAG: mffs 1
|
|
|
|
; CHECK-PWR7-DAG: stfd 1, -8(1)
|
|
|
|
; CHECK-PWR7-DAG: ld [[REG1:[0-9]+]], -8(1)
|
|
|
|
; CHECK-PWR7-DAG: rldimi [[REG1]], 3, 0, 62
|
|
|
|
; CHECK-PWR7-DAG: std [[REG1]], -16(1)
|
|
|
|
; CHECK-PWR7-DAG: lfd [[REG2:[0-9]+]], -16(1)
|
|
|
|
; CHECK-PWR7-DAG: mtfsf 255, [[REG2]]
|
|
|
|
; CHECK-PWR7: blr
|
|
|
|
}
|
|
|
|
|
|
|
|
declare double @llvm.ppc.setrnd(i32)
|
|
|
|
|