Skip to content

Commit c457646

Browse files
[wasm] Adjust IRGen test to use direct return-able SIMD vector type
SIMD2<Float> is not a legal vector type for wasm and thus cannot be returned directly as a vector value. See SwiftABIInfo::isLegalVectorType
1 parent b55341b commit c457646

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/IRGen/builtin_freeze.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@ func yum() -> Int32 {
2727
}
2828
// CHECK: }
2929

30-
func fptosi(_ x: SIMD2<Float>) -> SIMD2<Int32> {
31-
let maybePoison = Builtin.fptosi_Vec2xFPIEEE32_Vec2xInt32(x._storage._value)
32-
var result = SIMD2<Int32>()
30+
func fptosi(_ x: SIMD4<Float>) -> SIMD4<Int32> {
31+
let maybePoison = Builtin.fptosi_Vec4xFPIEEE32_Vec4xInt32(x._storage._value)
32+
var result = SIMD4<Int32>()
3333
result._storage._value = maybePoison
3434
return result
35-
// CHECK: fptosi <2 x float> %{{.+}} to <2 x i32>
35+
// CHECK: fptosi <4 x float> %{{.+}} to <4 x i32>
3636
}
3737

38-
func fptosiWithFreeze(_ x: SIMD2<Float>) -> SIMD2<Int32> {
39-
let maybePoison = Builtin.fptosi_Vec2xFPIEEE32_Vec2xInt32(x._storage._value)
40-
let frozen = Builtin.freeze_Vec2xInt32(maybePoison)
41-
var result = SIMD2<Int32>()
38+
func fptosiWithFreeze(_ x: SIMD4<Float>) -> SIMD4<Int32> {
39+
let maybePoison = Builtin.fptosi_Vec4xFPIEEE32_Vec4xInt32(x._storage._value)
40+
let frozen = Builtin.freeze_Vec4xInt32(maybePoison)
41+
var result = SIMD4<Int32>()
4242
result._storage._value = frozen
4343
return result
44-
// CHECK: fptosi <2 x float> %{{.+}} to <2 x i32>
45-
// CHECK-NEXT: freeze <2 x i32> %{{.+}}
44+
// CHECK: fptosi <4 x float> %{{.+}} to <4 x i32>
45+
// CHECK-NEXT: freeze <4 x i32> %{{.+}}
4646
}
4747

48-
func doubleYuck(_ x: SIMD2<Float>) -> SIMD2<Int32> {
49-
fptosi(SIMD2<Float>(repeating: 0x1.0p32))
48+
func doubleYuck(_ x: SIMD4<Float>) -> SIMD4<Int32> {
49+
fptosi(SIMD4<Float>(repeating: 0x1.0p32))
5050
// CHECK: poison
5151
}
5252

53-
func DoubleYum(_ x: SIMD2<Float>) -> SIMD2<Int32> {
54-
fptosiWithFreeze(SIMD2<Float>(repeating: 0x1.0p32))
53+
func DoubleYum(_ x: SIMD4<Float>) -> SIMD4<Int32> {
54+
fptosiWithFreeze(SIMD4<Float>(repeating: 0x1.0p32))
5555
// CHECK-NOT: poison
5656
}

0 commit comments

Comments
 (0)