Skip to content

Commit f340de4

Browse files
committed
[PowerPC] Use the same lowering rule for vector rounding instructions
They should have the same lowering rule.
1 parent 2db482d commit f340de4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,17 +1033,17 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
10331033
// so we can only code-gen them with fpexcept.ignore.
10341034
setOperationAction(ISD::STRICT_FNEARBYINT, MVT::f64, Custom);
10351035
setOperationAction(ISD::STRICT_FNEARBYINT, MVT::f32, Custom);
1036+
setOperationAction(ISD::STRICT_FNEARBYINT, MVT::v2f64, Custom);
1037+
setOperationAction(ISD::STRICT_FNEARBYINT, MVT::v4f32, Custom);
10361038

10371039
setOperationAction(ISD::FFLOOR, MVT::v2f64, Legal);
10381040
setOperationAction(ISD::FCEIL, MVT::v2f64, Legal);
10391041
setOperationAction(ISD::FTRUNC, MVT::v2f64, Legal);
1040-
setOperationAction(ISD::FNEARBYINT, MVT::v2f64, Legal);
10411042
setOperationAction(ISD::FRINT, MVT::v2f64, Legal);
10421043
setOperationAction(ISD::FROUND, MVT::v2f64, Legal);
10431044
setOperationAction(ISD::FROUND, MVT::f64, Legal);
10441045
setOperationAction(ISD::FRINT, MVT::f64, Legal);
10451046

1046-
setOperationAction(ISD::FNEARBYINT, MVT::v4f32, Legal);
10471047
setOperationAction(ISD::FRINT, MVT::v4f32, Legal);
10481048
setOperationAction(ISD::FROUND, MVT::v4f32, Legal);
10491049
setOperationAction(ISD::FROUND, MVT::f32, Legal);

llvm/test/CodeGen/PowerPC/vec_rounding.ll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: llc -verify-machineinstrs -mcpu=pwr6 -mattr=+altivec < %s | FileCheck %s
2+
; RUN: llc -verify-machineinstrs -mtriple=ppc64le-unknown-linux-gnu < %s | FileCheck %s --check-prefix=NO-VSX
23

34
; Check vector round to single-precision toward -infinity (vrfim)
45
; instruction generation using Altivec.
@@ -81,6 +82,9 @@ define <2 x double> @nearbyint_v2f64(<2 x double> %p)
8182
; CHECK-LABEL: nearbyint_v2f64:
8283
; CHECK: bl nearbyint
8384
; CHECK: bl nearbyint
85+
; NO-VSX-LABEL: nearbyint_v2f64:
86+
; NO-VSX: bl nearbyint
87+
; NO-VSX: bl nearbyint
8488

8589
declare <4 x double> @llvm.nearbyint.v4f64(<4 x double> %p)
8690
define <4 x double> @nearbyint_v4f64(<4 x double> %p)
@@ -93,7 +97,11 @@ define <4 x double> @nearbyint_v4f64(<4 x double> %p)
9397
; CHECK: bl nearbyint
9498
; CHECK: bl nearbyint
9599
; CHECK: bl nearbyint
96-
100+
; NO-VSX-LABEL: nearbyint_v4f64:
101+
; NO-VSX: bl nearbyint
102+
; NO-VSX: bl nearbyint
103+
; NO-VSX: bl nearbyint
104+
; NO-VSX: bl nearbyint
97105

98106
declare <4 x float> @llvm.floor.v4f32(<4 x float> %p)
99107
define <4 x float> @floor_v4f32(<4 x float> %p)

0 commit comments

Comments
 (0)