Skip to content

Commit a5095b9

Browse files
committed
[RISCV] Add test for incorrect FP build vector lowering. NFC
The lowering is not distinquishing -2147483648.0 and 2147483648.0.
1 parent 7de6f61 commit a5095b9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

llvm/test/CodeGen/RISCV/rvv/vle_vid-vfcvt.ll

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,20 @@ entry:
112112
store <4 x float> <float 1.5, float 2.5, float 3.5, float 4.5>, ptr %t, align 16
113113
ret void
114114
}
115+
116+
; FIXME: This is miscompiled. This will create -2147483648.0 instead of
117+
; 2147483648.0 for the 4th element.
118+
define void @foo_9(ptr nocapture noundef writeonly %t) {
119+
; CHECK-LABEL: foo_9:
120+
; CHECK: # %bb.0: # %entry
121+
; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
122+
; CHECK-NEXT: vid.v v8
123+
; CHECK-NEXT: vsll.vi v8, v8, 31
124+
; CHECK-NEXT: vrsub.vi v8, v8, 0
125+
; CHECK-NEXT: vfcvt.f.x.v v8, v8
126+
; CHECK-NEXT: vse32.v v8, (a0)
127+
; CHECK-NEXT: ret
128+
entry:
129+
store <4 x float> <float 0.0, float -2147483648.0, float 0.0, float 2147483648.0>, ptr %t, align 16
130+
ret void
131+
}

0 commit comments

Comments
 (0)