8
8
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
9
9
target triple = "wasm32-unknown-unknown"
10
10
11
+ ; CHECK-LABEL: emulated_const_trivial_splat:
12
+ ; CHECK-NEXT: .functype emulated_const_trivial_splat () -> (v128)
13
+ ; SIMD-VM-NEXT: i64.const $push0=, 8589934593
14
+ ; SIMD-VM-NEXT: i64x2.splat $push1=, $pop0
15
+ ; SIMD-VM-NEXT: return $pop1
16
+ ; UNIMP: v128.const
17
+ define <4 x i32 > @emulated_const_trivial_splat () {
18
+ ret <4 x i32 > <i32 1 , i32 2 , i32 1 , i32 2 >
19
+ }
20
+
21
+ ; CHECK-LABEL: emulated_const_first_sufficient:
22
+ ; CHECK-NEXT: .functype emulated_const_first_sufficient () -> (v128)
23
+ ; SIMD-VM-NEXT: i64.const $push0=, 8589934593
24
+ ; SIMD-VM-NEXT: i64x2.splat $push1=, $pop0
25
+ ; SIMD-VM-NEXT: return $pop1
26
+ ; UNIMP: v128.const
27
+ define <4 x i32 > @emulated_const_first_sufficient () {
28
+ ret <4 x i32 > <i32 1 , i32 2 , i32 undef , i32 2 >
29
+ }
30
+
31
+ ; CHECK-LABEL: emulated_const_second_sufficient:
32
+ ; CHECK-NEXT: .functype emulated_const_second_sufficient () -> (v128)
33
+ ; SIMD-VM-NEXT: i64.const $push0=, 8589934593
34
+ ; SIMD-VM-NEXT: i64x2.splat $push1=, $pop0
35
+ ; SIMD-VM-NEXT: return $pop1
36
+ ; UNIMP: v128.const
37
+ define <4 x i32 > @emulated_const_second_sufficient () {
38
+ ret <4 x i32 > <i32 1 , i32 undef , i32 1 , i32 2 >
39
+ }
40
+
41
+ ; CHECK-LABEL: emulated_const_combined_sufficient:
42
+ ; CHECK-NEXT: .functype emulated_const_combined_sufficient () -> (v128)
43
+ ; SIMD-VM-NEXT: i64.const $push0=, 8589934593
44
+ ; SIMD-VM-NEXT: i64x2.splat $push1=, $pop0
45
+ ; SIMD-VM-NEXT: return $pop1
46
+ ; UNIMP: v128.const
47
+ define <4 x i32 > @emulated_const_combined_sufficient () {
48
+ ret <4 x i32 > <i32 1 , i32 undef , i32 undef , i32 2 >
49
+ }
50
+
51
+ ; CHECK-LABEL: emulated_const_either_sufficient:
52
+ ; CHECK-NEXT: .functype emulated_const_either_sufficient () -> (v128)
53
+ ; SIMD-VM-NEXT: i64.const $push0=, 1
54
+ ; SIMD-VM-NEXT: i64x2.splat $push1=, $pop0
55
+ ; SIMD-VM-NEXT: return $pop1
56
+ ; UNIMP: v128.const
57
+ define <4 x i32 > @emulated_const_either_sufficient () {
58
+ ret <4 x i32 > <i32 1 , i32 undef , i32 1 , i32 undef >
59
+ }
60
+
61
+ ; CHECK-LABEL: emulated_const_neither_sufficient:
62
+ ; CHECK-NEXT: .functype emulated_const_neither_sufficient () -> (v128)
63
+ ; SIMD-VM-NEXT: i64.const $push0=, 8589934593
64
+ ; SIMD-VM-NEXT: i64x2.splat $push1=, $pop0
65
+ ; SIMD-VM-NEXT: i64.const $push2=, 17179869184
66
+ ; SIMD-VM-NEXT: i64x2.replace_lane $push3=, $pop1, 1, $pop2
67
+ ; SIMD-VM-NEXT: return $pop3
68
+ define <4 x i32 > @emulated_const_neither_sufficient () {
69
+ ret <4 x i32 > <i32 1 , i32 2 , i32 undef , i32 4 >
70
+ }
71
+
11
72
; CHECK-LABEL: same_const_one_replaced_i16x8:
12
73
; CHECK-NEXT: .functype same_const_one_replaced_i16x8 (i32) -> (v128)
13
74
; UNIMP-NEXT: v128.const $push[[L0:[0-9]+]]=, 42, 42, 42, 42, 42, 0, 42, 42
14
75
; UNIMP-NEXT: i16x8.replace_lane $push[[L1:[0-9]+]]=, $pop[[L0]], 5, $0
15
76
; UNIMP-NEXT: return $pop[[L1]]
16
- ; SIMD-VM: i16x8 .splat
77
+ ; SIMD-VM: i64x2 .splat
17
78
define <8 x i16 > @same_const_one_replaced_i16x8 (i16 %x ) {
18
79
%v = insertelement
19
80
<8 x i16 > <i16 42 , i16 42 , i16 42 , i16 42 , i16 42 , i16 42 , i16 42 , i16 42 >,
@@ -27,7 +88,7 @@ define <8 x i16> @same_const_one_replaced_i16x8(i16 %x) {
27
88
; UNIMP-NEXT: v128.const $push[[L0:[0-9]+]]=, 1, -2, 3, -4, 5, 0, 7, -8
28
89
; UNIMP-NEXT: i16x8.replace_lane $push[[L1:[0-9]+]]=, $pop[[L0]], 5, $0
29
90
; UNIMP-NEXT: return $pop[[L1]]
30
- ; SIMD-VM: i16x8 .splat
91
+ ; SIMD-VM: i64x2 .splat
31
92
define <8 x i16 > @different_const_one_replaced_i16x8 (i16 %x ) {
32
93
%v = insertelement
33
94
<8 x i16 > <i16 1 , i16 -2 , i16 3 , i16 -4 , i16 5 , i16 -6 , i16 7 , i16 -8 >,
@@ -68,7 +129,7 @@ define <4 x float> @different_const_one_replaced_f32x4(float %x) {
68
129
; CHECK-NEXT: .functype splat_common_const_i32x4 () -> (v128)
69
130
; UNIMP-NEXT: v128.const $push[[L0:[0-9]+]]=, 0, 3, 3, 1
70
131
; UNIMP-NEXT: return $pop[[L0]]
71
- ; SIMD-VM: i32x4 .splat
132
+ ; SIMD-VM: i64x2 .splat
72
133
define <4 x i32 > @splat_common_const_i32x4 () {
73
134
ret <4 x i32 > <i32 undef , i32 3 , i32 3 , i32 1 >
74
135
}
@@ -206,7 +267,7 @@ define <16 x i8> @mashup_swizzle_i8x16(<16 x i8> %src, <16 x i8> %mask, i8 %spla
206
267
; UNIMP: i8x16.replace_lane
207
268
; UNIMP: i8x16.replace_lane
208
269
; UNIMP: return
209
- ; SIMD-VM: i8x16 .splat
270
+ ; SIMD-VM: i64x2 .splat
210
271
define <16 x i8 > @mashup_const_i8x16 (<16 x i8 > %src , <16 x i8 > %mask , i8 %splatted ) {
211
272
; swizzle 0
212
273
%m0 = extractelement <16 x i8 > %mask , i32 0
0 commit comments