1e073de83SJun Ma // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py 24f4aa7b7SHans Wennborg // REQUIRES: webassembly-registered-target, asserts 3f4969500SThomas Lively 416e78ec0SSanjay Patel // FIXME: This should not be using -O2 and implicitly testing the entire IR opt pipeline. 516e78ec0SSanjay Patel 69466b491SNikita Popov // RUN: %clang %s -O2 -emit-llvm -S -o - -target wasm32-unknown-unknown -msimd128 -Wall -Weverything -Wno-missing-prototypes -fno-lax-vector-conversions -Werror | FileCheck %s 7f4969500SThomas Lively 8f4969500SThomas Lively #include <wasm_simd128.h> 9f4969500SThomas Lively 10f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load( 11f3b769e8SThomas Lively // CHECK-NEXT: entry: 129466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2:![0-9]+]] 13f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 14f3b769e8SThomas Lively // 15f3b769e8SThomas Lively v128_t test_v128_load(const void *mem) { 16f3b769e8SThomas Lively return wasm_v128_load(mem); 17f4969500SThomas Lively } 18f4969500SThomas Lively 19f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load8_splat( 20f3b769e8SThomas Lively // CHECK-NEXT: entry: 219466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 22a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[TMP0]], i64 0 23a723ca32SJuneyoung Lee // CHECK-NEXT: [[VECINIT16_I:%.*]] = shufflevector <16 x i8> [[VECINIT_I]], <16 x i8> poison, <16 x i32> zeroinitializer 24f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[VECINIT16_I]] to <4 x i32> 25f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 26f3b769e8SThomas Lively // 27f3b769e8SThomas Lively v128_t test_v128_load8_splat(const void *mem) { 28f3b769e8SThomas Lively return wasm_v128_load8_splat(mem); 29f3b769e8SThomas Lively } 30f3b769e8SThomas Lively 31f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load16_splat( 32f3b769e8SThomas Lively // CHECK-NEXT: entry: 339466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 34a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[TMP0]], i64 0 35a723ca32SJuneyoung Lee // CHECK-NEXT: [[VECINIT8_I:%.*]] = shufflevector <8 x i16> [[VECINIT_I]], <8 x i16> poison, <8 x i32> zeroinitializer 36f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINIT8_I]] to <4 x i32> 37f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 38f3b769e8SThomas Lively // 39f3b769e8SThomas Lively v128_t test_v128_load16_splat(const void *mem) { 40f3b769e8SThomas Lively return wasm_v128_load16_splat(mem); 41f3b769e8SThomas Lively } 42f3b769e8SThomas Lively 43f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load32_splat( 44f3b769e8SThomas Lively // CHECK-NEXT: entry: 459466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 46a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[TMP0]], i64 0 47a723ca32SJuneyoung Lee // CHECK-NEXT: [[VECINIT4_I:%.*]] = shufflevector <4 x i32> [[VECINIT_I]], <4 x i32> poison, <4 x i32> zeroinitializer 48f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[VECINIT4_I]] 49f3b769e8SThomas Lively // 50f3b769e8SThomas Lively v128_t test_v128_load32_splat(const void *mem) { 51f3b769e8SThomas Lively return wasm_v128_load32_splat(mem); 52f3b769e8SThomas Lively } 53f3b769e8SThomas Lively 54f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load64_splat( 55f3b769e8SThomas Lively // CHECK-NEXT: entry: 569466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 57a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[TMP0]], i64 0 58a723ca32SJuneyoung Lee // CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <2 x i64> [[VECINIT_I]], <2 x i64> poison, <2 x i32> zeroinitializer 59f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[VECINIT2_I]] to <4 x i32> 60f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 61f3b769e8SThomas Lively // 62f3b769e8SThomas Lively v128_t test_v128_load64_splat(const void *mem) { 63f3b769e8SThomas Lively return wasm_v128_load64_splat(mem); 64f3b769e8SThomas Lively } 65f3b769e8SThomas Lively 66f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_load8x8( 67f3b769e8SThomas Lively // CHECK-NEXT: entry: 689466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load <8 x i8>, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 69f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sext <8 x i8> [[TMP0]] to <8 x i16> 70f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32> 71f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 72f3b769e8SThomas Lively // 73f3b769e8SThomas Lively v128_t test_i16x8_load8x8(const void *mem) { 74f3b769e8SThomas Lively return wasm_i16x8_load8x8(mem); 75f3b769e8SThomas Lively } 76f3b769e8SThomas Lively 77f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_load8x8( 78f3b769e8SThomas Lively // CHECK-NEXT: entry: 799466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load <8 x i8>, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 80f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = zext <8 x i8> [[TMP0]] to <8 x i16> 81f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32> 82f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 83f3b769e8SThomas Lively // 84f3b769e8SThomas Lively v128_t test_u16x8_load8x8(const void *mem) { 85f3b769e8SThomas Lively return wasm_u16x8_load8x8(mem); 86f3b769e8SThomas Lively } 87f3b769e8SThomas Lively 88f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_load16x4( 89f3b769e8SThomas Lively // CHECK-NEXT: entry: 909466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load <4 x i16>, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 91f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sext <4 x i16> [[TMP0]] to <4 x i32> 92f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[CONV_I]] 93f3b769e8SThomas Lively // 94f3b769e8SThomas Lively v128_t test_i32x4_load16x4(const void *mem) { 95f3b769e8SThomas Lively return wasm_i32x4_load16x4(mem); 96f3b769e8SThomas Lively } 97f3b769e8SThomas Lively 98f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_load16x4( 99f3b769e8SThomas Lively // CHECK-NEXT: entry: 1009466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load <4 x i16>, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 101f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = zext <4 x i16> [[TMP0]] to <4 x i32> 102f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[CONV_I]] 103f3b769e8SThomas Lively // 104f3b769e8SThomas Lively v128_t test_u32x4_load16x4(const void *mem) { 105f3b769e8SThomas Lively return wasm_u32x4_load16x4(mem); 106f3b769e8SThomas Lively } 107f3b769e8SThomas Lively 108f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_load32x2( 109f3b769e8SThomas Lively // CHECK-NEXT: entry: 1109466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 111f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sext <2 x i32> [[TMP0]] to <2 x i64> 112f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32> 113f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 114f3b769e8SThomas Lively // 115f3b769e8SThomas Lively v128_t test_i64x2_load32x2(const void *mem) { 116f3b769e8SThomas Lively return wasm_i64x2_load32x2(mem); 117f3b769e8SThomas Lively } 118f3b769e8SThomas Lively 119f3b769e8SThomas Lively // CHECK-LABEL: @test_u64x2_load32x2( 120f3b769e8SThomas Lively // CHECK-NEXT: entry: 1219466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 122f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = zext <2 x i32> [[TMP0]] to <2 x i64> 123f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32> 124f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 125f3b769e8SThomas Lively // 126f3b769e8SThomas Lively v128_t test_u64x2_load32x2(const void *mem) { 127f3b769e8SThomas Lively return wasm_u64x2_load32x2(mem); 128f3b769e8SThomas Lively } 129f3b769e8SThomas Lively 130f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load32_zero( 131f3b769e8SThomas Lively // CHECK-NEXT: entry: 1329466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 133e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 [[TMP0]], i64 0 134f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[VECINIT4_I]] 135f3b769e8SThomas Lively // 136f3b769e8SThomas Lively v128_t test_v128_load32_zero(const void *mem) { 137f3b769e8SThomas Lively return wasm_v128_load32_zero(mem); 138f3b769e8SThomas Lively } 139f3b769e8SThomas Lively 140f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load64_zero( 141f3b769e8SThomas Lively // CHECK-NEXT: entry: 1429466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 143e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <2 x i64> <i64 poison, i64 0>, i64 [[TMP0]], i64 0 144f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[VECINIT2_I]] to <4 x i32> 145f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 146f3b769e8SThomas Lively // 147f3b769e8SThomas Lively v128_t test_v128_load64_zero(const void *mem) { 148f3b769e8SThomas Lively return wasm_v128_load64_zero(mem); 149f3b769e8SThomas Lively } 150f3b769e8SThomas Lively 151f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load8_lane( 152f3b769e8SThomas Lively // CHECK-NEXT: entry: 1539466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[PTR:%.*]], align 1, !tbaa [[TBAA2]] 154970e0900SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[VEC:%.*]] to <16 x i8> 155e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <16 x i8> [[TMP1]], i8 [[TMP0]], i64 15 156970e0900SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[VECINS_I]] to <4 x i32> 157f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 158f3b769e8SThomas Lively // 159602f318cSThomas Lively v128_t test_v128_load8_lane(const uint8_t *ptr, v128_t vec) { 160f3b769e8SThomas Lively return wasm_v128_load8_lane(ptr, vec, 15); 161f3b769e8SThomas Lively } 162f3b769e8SThomas Lively 163f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load16_lane( 164f3b769e8SThomas Lively // CHECK-NEXT: entry: 1659466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[PTR:%.*]], align 1, !tbaa [[TBAA2]] 166970e0900SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[VEC:%.*]] to <8 x i16> 167e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <8 x i16> [[TMP1]], i16 [[TMP0]], i64 7 168970e0900SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[VECINS_I]] to <4 x i32> 169f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 170f3b769e8SThomas Lively // 171602f318cSThomas Lively v128_t test_v128_load16_lane(const uint16_t *ptr, v128_t vec) { 172f3b769e8SThomas Lively return wasm_v128_load16_lane(ptr, vec, 7); 173f3b769e8SThomas Lively } 174f3b769e8SThomas Lively 175f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load32_lane( 176f3b769e8SThomas Lively // CHECK-NEXT: entry: 1779466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[PTR:%.*]], align 1, !tbaa [[TBAA2]] 178e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x i32> [[VEC:%.*]], i32 [[TMP0]], i64 3 179970e0900SThomas Lively // CHECK-NEXT: ret <4 x i32> [[VECINS_I]] 180f3b769e8SThomas Lively // 181602f318cSThomas Lively v128_t test_v128_load32_lane(const uint32_t *ptr, v128_t vec) { 182f3b769e8SThomas Lively return wasm_v128_load32_lane(ptr, vec, 3); 183f3b769e8SThomas Lively } 184f3b769e8SThomas Lively 185f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_load64_lane( 186f3b769e8SThomas Lively // CHECK-NEXT: entry: 1879466b491SNikita Popov // CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[PTR:%.*]], align 1, !tbaa [[TBAA2]] 188970e0900SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[VEC:%.*]] to <2 x i64> 189e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <2 x i64> [[TMP1]], i64 [[TMP0]], i64 1 190970e0900SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[VECINS_I]] to <4 x i32> 191f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 192f3b769e8SThomas Lively // 193602f318cSThomas Lively v128_t test_v128_load64_lane(const uint64_t *ptr, v128_t vec) { 194f3b769e8SThomas Lively return wasm_v128_load64_lane(ptr, vec, 1); 195f3b769e8SThomas Lively } 196f3b769e8SThomas Lively 197f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_store( 198f3b769e8SThomas Lively // CHECK-NEXT: entry: 1999466b491SNikita Popov // CHECK-NEXT: store <4 x i32> [[A:%.*]], ptr [[MEM:%.*]], align 1, !tbaa [[TBAA2]] 200f3b769e8SThomas Lively // CHECK-NEXT: ret void 201f3b769e8SThomas Lively // 202f3b769e8SThomas Lively void test_v128_store(void *mem, v128_t a) { 2032456e116SThomas Lively wasm_v128_store(mem, a); 204f3b769e8SThomas Lively } 205f3b769e8SThomas Lively 206f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_store8_lane( 207f3b769e8SThomas Lively // CHECK-NEXT: entry: 208f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[VEC:%.*]] to <16 x i8> 209e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <16 x i8> [[TMP0]], i64 15 2109466b491SNikita Popov // CHECK-NEXT: store i8 [[VECEXT_I]], ptr [[PTR:%.*]], align 1, !tbaa [[TBAA2]] 211f3b769e8SThomas Lively // CHECK-NEXT: ret void 212f3b769e8SThomas Lively // 213f3b769e8SThomas Lively void test_v128_store8_lane(uint8_t *ptr, v128_t vec) { 2142456e116SThomas Lively wasm_v128_store8_lane(ptr, vec, 15); 215f3b769e8SThomas Lively } 216f3b769e8SThomas Lively 217f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_store16_lane( 218f3b769e8SThomas Lively // CHECK-NEXT: entry: 219f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[VEC:%.*]] to <8 x i16> 220e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <8 x i16> [[TMP0]], i64 7 2219466b491SNikita Popov // CHECK-NEXT: store i16 [[VECEXT_I]], ptr [[PTR:%.*]], align 1, !tbaa [[TBAA2]] 222f3b769e8SThomas Lively // CHECK-NEXT: ret void 223f3b769e8SThomas Lively // 224f3b769e8SThomas Lively void test_v128_store16_lane(uint16_t *ptr, v128_t vec) { 2252456e116SThomas Lively wasm_v128_store16_lane(ptr, vec, 7); 226f3b769e8SThomas Lively } 227f3b769e8SThomas Lively 228f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_store32_lane( 229f3b769e8SThomas Lively // CHECK-NEXT: entry: 230e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[VEC:%.*]], i64 3 2319466b491SNikita Popov // CHECK-NEXT: store i32 [[VECEXT_I]], ptr [[PTR:%.*]], align 1, !tbaa [[TBAA2]] 232f3b769e8SThomas Lively // CHECK-NEXT: ret void 233f3b769e8SThomas Lively // 234f3b769e8SThomas Lively void test_v128_store32_lane(uint32_t *ptr, v128_t vec) { 2352456e116SThomas Lively wasm_v128_store32_lane(ptr, vec, 3); 236f3b769e8SThomas Lively } 237f3b769e8SThomas Lively 238f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_store64_lane( 239f3b769e8SThomas Lively // CHECK-NEXT: entry: 240f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[VEC:%.*]] to <2 x i64> 241e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <2 x i64> [[TMP0]], i64 1 2429466b491SNikita Popov // CHECK-NEXT: store i64 [[VECEXT_I]], ptr [[PTR:%.*]], align 1, !tbaa [[TBAA2]] 243f3b769e8SThomas Lively // CHECK-NEXT: ret void 244f3b769e8SThomas Lively // 245f3b769e8SThomas Lively void test_v128_store64_lane(uint64_t *ptr, v128_t vec) { 2462456e116SThomas Lively wasm_v128_store64_lane(ptr, vec, 1); 247f3b769e8SThomas Lively } 248f3b769e8SThomas Lively 249f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_make( 250f3b769e8SThomas Lively // CHECK-NEXT: entry: 251a3d2d34eSNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[C0:%.*]], i64 0 252e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <16 x i8> [[VECINIT_I]], i8 [[C1:%.*]], i64 1 253e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <16 x i8> [[VECINIT1_I]], i8 [[C2:%.*]], i64 2 254e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <16 x i8> [[VECINIT2_I]], i8 [[C3:%.*]], i64 3 255e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <16 x i8> [[VECINIT3_I]], i8 [[C4:%.*]], i64 4 256e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT5_I:%.*]] = insertelement <16 x i8> [[VECINIT4_I]], i8 [[C5:%.*]], i64 5 257e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT6_I:%.*]] = insertelement <16 x i8> [[VECINIT5_I]], i8 [[C6:%.*]], i64 6 258e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT7_I:%.*]] = insertelement <16 x i8> [[VECINIT6_I]], i8 [[C7:%.*]], i64 7 259e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT8_I:%.*]] = insertelement <16 x i8> [[VECINIT7_I]], i8 [[C8:%.*]], i64 8 260e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT9_I:%.*]] = insertelement <16 x i8> [[VECINIT8_I]], i8 [[C9:%.*]], i64 9 261e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT10_I:%.*]] = insertelement <16 x i8> [[VECINIT9_I]], i8 [[C10:%.*]], i64 10 262e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT11_I:%.*]] = insertelement <16 x i8> [[VECINIT10_I]], i8 [[C11:%.*]], i64 11 263e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT12_I:%.*]] = insertelement <16 x i8> [[VECINIT11_I]], i8 [[C12:%.*]], i64 12 264e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT13_I:%.*]] = insertelement <16 x i8> [[VECINIT12_I]], i8 [[C13:%.*]], i64 13 265e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT14_I:%.*]] = insertelement <16 x i8> [[VECINIT13_I]], i8 [[C14:%.*]], i64 14 266e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT15_I:%.*]] = insertelement <16 x i8> [[VECINIT14_I]], i8 [[C15:%.*]], i64 15 267f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[VECINIT15_I]] to <4 x i32> 268f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 269f3b769e8SThomas Lively // 270f3b769e8SThomas Lively v128_t test_i8x16_make(int8_t c0, int8_t c1, int8_t c2, int8_t c3, int8_t c4, int8_t c5, int8_t c6, int8_t c7, int8_t c8, int8_t c9, int8_t c10, int8_t c11, int8_t c12, int8_t c13, int8_t c14, int8_t c15) { 271f3b769e8SThomas Lively return wasm_i8x16_make(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15); 272f3b769e8SThomas Lively } 273f3b769e8SThomas Lively 2742456e116SThomas Lively // CHECK-LABEL: @test_u8x16_make( 2752456e116SThomas Lively // CHECK-NEXT: entry: 276a3d2d34eSNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[C0:%.*]], i64 0 277e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <16 x i8> [[VECINIT_I]], i8 [[C1:%.*]], i64 1 278e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <16 x i8> [[VECINIT1_I]], i8 [[C2:%.*]], i64 2 279e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <16 x i8> [[VECINIT2_I]], i8 [[C3:%.*]], i64 3 280e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <16 x i8> [[VECINIT3_I]], i8 [[C4:%.*]], i64 4 281e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT5_I:%.*]] = insertelement <16 x i8> [[VECINIT4_I]], i8 [[C5:%.*]], i64 5 282e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT6_I:%.*]] = insertelement <16 x i8> [[VECINIT5_I]], i8 [[C6:%.*]], i64 6 283e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT7_I:%.*]] = insertelement <16 x i8> [[VECINIT6_I]], i8 [[C7:%.*]], i64 7 284e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT8_I:%.*]] = insertelement <16 x i8> [[VECINIT7_I]], i8 [[C8:%.*]], i64 8 285e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT9_I:%.*]] = insertelement <16 x i8> [[VECINIT8_I]], i8 [[C9:%.*]], i64 9 286e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT10_I:%.*]] = insertelement <16 x i8> [[VECINIT9_I]], i8 [[C10:%.*]], i64 10 287e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT11_I:%.*]] = insertelement <16 x i8> [[VECINIT10_I]], i8 [[C11:%.*]], i64 11 288e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT12_I:%.*]] = insertelement <16 x i8> [[VECINIT11_I]], i8 [[C12:%.*]], i64 12 289e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT13_I:%.*]] = insertelement <16 x i8> [[VECINIT12_I]], i8 [[C13:%.*]], i64 13 290e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT14_I:%.*]] = insertelement <16 x i8> [[VECINIT13_I]], i8 [[C14:%.*]], i64 14 291e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT15_I:%.*]] = insertelement <16 x i8> [[VECINIT14_I]], i8 [[C15:%.*]], i64 15 2922456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[VECINIT15_I]] to <4 x i32> 2932456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2942456e116SThomas Lively // 2952456e116SThomas Lively v128_t test_u8x16_make(uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5, uint8_t c6, uint8_t c7, uint8_t c8, uint8_t c9, uint8_t c10, uint8_t c11, uint8_t c12, uint8_t c13, uint8_t c14, uint8_t c15) { 2962456e116SThomas Lively return wasm_u8x16_make(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15); 2972456e116SThomas Lively } 2982456e116SThomas Lively 299f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_make( 300f3b769e8SThomas Lively // CHECK-NEXT: entry: 301a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[C0:%.*]], i64 0 302e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <8 x i16> [[VECINIT_I]], i16 [[C1:%.*]], i64 1 303e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <8 x i16> [[VECINIT1_I]], i16 [[C2:%.*]], i64 2 304e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <8 x i16> [[VECINIT2_I]], i16 [[C3:%.*]], i64 3 305e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <8 x i16> [[VECINIT3_I]], i16 [[C4:%.*]], i64 4 306e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT5_I:%.*]] = insertelement <8 x i16> [[VECINIT4_I]], i16 [[C5:%.*]], i64 5 307e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT6_I:%.*]] = insertelement <8 x i16> [[VECINIT5_I]], i16 [[C6:%.*]], i64 6 308e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT7_I:%.*]] = insertelement <8 x i16> [[VECINIT6_I]], i16 [[C7:%.*]], i64 7 309f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <4 x i32> 310f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 311f3b769e8SThomas Lively // 312f3b769e8SThomas Lively v128_t test_i16x8_make(int16_t c0, int16_t c1, int16_t c2, int16_t c3, int16_t c4, int16_t c5, int16_t c6, int16_t c7) { 313f3b769e8SThomas Lively return wasm_i16x8_make(c0, c1, c2, c3, c4, c5, c6, c7); 314f3b769e8SThomas Lively } 315f3b769e8SThomas Lively 3162456e116SThomas Lively // CHECK-LABEL: @test_u16x8_make( 3172456e116SThomas Lively // CHECK-NEXT: entry: 318a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[C0:%.*]], i64 0 319e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <8 x i16> [[VECINIT_I]], i16 [[C1:%.*]], i64 1 320e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <8 x i16> [[VECINIT1_I]], i16 [[C2:%.*]], i64 2 321e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <8 x i16> [[VECINIT2_I]], i16 [[C3:%.*]], i64 3 322e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <8 x i16> [[VECINIT3_I]], i16 [[C4:%.*]], i64 4 323e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT5_I:%.*]] = insertelement <8 x i16> [[VECINIT4_I]], i16 [[C5:%.*]], i64 5 324e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT6_I:%.*]] = insertelement <8 x i16> [[VECINIT5_I]], i16 [[C6:%.*]], i64 6 325e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT7_I:%.*]] = insertelement <8 x i16> [[VECINIT6_I]], i16 [[C7:%.*]], i64 7 3262456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <4 x i32> 3272456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 3282456e116SThomas Lively // 3292456e116SThomas Lively v128_t test_u16x8_make(uint16_t c0, uint16_t c1, uint16_t c2, uint16_t c3, uint16_t c4, uint16_t c5, uint16_t c6, uint16_t c7) { 3302456e116SThomas Lively return wasm_u16x8_make(c0, c1, c2, c3, c4, c5, c6, c7); 3312456e116SThomas Lively } 3322456e116SThomas Lively 333f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_make( 334f3b769e8SThomas Lively // CHECK-NEXT: entry: 335a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[C0:%.*]], i64 0 336e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <4 x i32> [[VECINIT_I]], i32 [[C1:%.*]], i64 1 337e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x i32> [[VECINIT1_I]], i32 [[C2:%.*]], i64 2 338e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <4 x i32> [[VECINIT2_I]], i32 [[C3:%.*]], i64 3 339f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[VECINIT3_I]] 340f3b769e8SThomas Lively // 341f3b769e8SThomas Lively v128_t test_i32x4_make(int32_t c0, int32_t c1, int32_t c2, int32_t c3) { 342f3b769e8SThomas Lively return wasm_i32x4_make(c0, c1, c2, c3); 343f3b769e8SThomas Lively } 344f3b769e8SThomas Lively 3452456e116SThomas Lively // CHECK-LABEL: @test_u32x4_make( 3462456e116SThomas Lively // CHECK-NEXT: entry: 347a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[C0:%.*]], i64 0 348e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <4 x i32> [[VECINIT_I]], i32 [[C1:%.*]], i64 1 349e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x i32> [[VECINIT1_I]], i32 [[C2:%.*]], i64 2 350e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <4 x i32> [[VECINIT2_I]], i32 [[C3:%.*]], i64 3 3512456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[VECINIT3_I]] 3522456e116SThomas Lively // 3532456e116SThomas Lively v128_t test_u32x4_make(uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3) { 3542456e116SThomas Lively return wasm_u32x4_make(c0, c1, c2, c3); 3552456e116SThomas Lively } 3562456e116SThomas Lively 357f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_make( 358f3b769e8SThomas Lively // CHECK-NEXT: entry: 359a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[C0:%.*]], i64 0 360e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x i64> [[VECINIT_I]], i64 [[C1:%.*]], i64 1 361f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[VECINIT1_I]] to <4 x i32> 362f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 363f3b769e8SThomas Lively // 364f3b769e8SThomas Lively v128_t test_i64x2_make(int64_t c0, int64_t c1) { 365f3b769e8SThomas Lively return wasm_i64x2_make(c0, c1); 366f3b769e8SThomas Lively } 367f3b769e8SThomas Lively 3682456e116SThomas Lively // CHECK-LABEL: @test_u64x2_make( 3692456e116SThomas Lively // CHECK-NEXT: entry: 370a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[C0:%.*]], i64 0 371e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x i64> [[VECINIT_I]], i64 [[C1:%.*]], i64 1 3722456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[VECINIT1_I]] to <4 x i32> 3732456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 3742456e116SThomas Lively // 3752456e116SThomas Lively v128_t test_u64x2_make(uint64_t c0, uint64_t c1) { 3762456e116SThomas Lively return wasm_u64x2_make(c0, c1); 3772456e116SThomas Lively } 3782456e116SThomas Lively 379f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_make( 380f3b769e8SThomas Lively // CHECK-NEXT: entry: 381a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x float> poison, float [[C0:%.*]], i64 0 382e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <4 x float> [[VECINIT_I]], float [[C1:%.*]], i64 1 383e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x float> [[VECINIT1_I]], float [[C2:%.*]], i64 2 384e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <4 x float> [[VECINIT2_I]], float [[C3:%.*]], i64 3 385f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[VECINIT3_I]] to <4 x i32> 386f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 387f3b769e8SThomas Lively // 388f3b769e8SThomas Lively v128_t test_f32x4_make(float c0, float c1, float c2, float c3) { 389f3b769e8SThomas Lively return wasm_f32x4_make(c0, c1, c2, c3); 390f3b769e8SThomas Lively } 391f3b769e8SThomas Lively 392f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_make( 393f3b769e8SThomas Lively // CHECK-NEXT: entry: 394a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x double> poison, double [[C0:%.*]], i64 0 395e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double [[C1:%.*]], i64 1 396f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[VECINIT1_I]] to <4 x i32> 397f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 398f3b769e8SThomas Lively // 399f3b769e8SThomas Lively v128_t test_f64x2_make(double c0, double c1) { 400f3b769e8SThomas Lively return wasm_f64x2_make(c0, c1); 401f3b769e8SThomas Lively } 402f3b769e8SThomas Lively 403f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_const( 404f3b769e8SThomas Lively // CHECK-NEXT: entry: 405f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 50462976, i32 117835012, i32 185207048, i32 252579084> 406f3b769e8SThomas Lively // 4072456e116SThomas Lively v128_t test_i8x16_const(void) { 408f3b769e8SThomas Lively return wasm_i8x16_const(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); 409f3b769e8SThomas Lively } 410f3b769e8SThomas Lively 4112456e116SThomas Lively // CHECK-LABEL: @test_u8x16_const( 4122456e116SThomas Lively // CHECK-NEXT: entry: 4132456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 50462976, i32 117835012, i32 185207048, i32 252579084> 4142456e116SThomas Lively // 4152456e116SThomas Lively v128_t test_u8x16_const(void) { 4162456e116SThomas Lively return wasm_u8x16_const(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); 4172456e116SThomas Lively } 4182456e116SThomas Lively 419f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_const( 420f3b769e8SThomas Lively // CHECK-NEXT: entry: 421f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 65536, i32 196610, i32 327684, i32 458758> 422f3b769e8SThomas Lively // 4232456e116SThomas Lively v128_t test_i16x8_const(void) { 424f3b769e8SThomas Lively return wasm_i16x8_const(0, 1, 2, 3, 4, 5, 6, 7); 425f3b769e8SThomas Lively } 426f3b769e8SThomas Lively 4272456e116SThomas Lively // CHECK-LABEL: @test_u16x8_const( 4282456e116SThomas Lively // CHECK-NEXT: entry: 4292456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 65536, i32 196610, i32 327684, i32 458758> 4302456e116SThomas Lively // 4312456e116SThomas Lively v128_t test_u16x8_const(void) { 4322456e116SThomas Lively return wasm_u16x8_const(0, 1, 2, 3, 4, 5, 6, 7); 4332456e116SThomas Lively } 4342456e116SThomas Lively 435f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_const( 436f3b769e8SThomas Lively // CHECK-NEXT: entry: 437f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 0, i32 1, i32 2, i32 3> 438f3b769e8SThomas Lively // 4392456e116SThomas Lively v128_t test_i32x4_const(void) { 440f3b769e8SThomas Lively return wasm_i32x4_const(0, 1, 2, 3); 441f3b769e8SThomas Lively } 442f3b769e8SThomas Lively 4432456e116SThomas Lively // CHECK-LABEL: @test_u32x4_const( 4442456e116SThomas Lively // CHECK-NEXT: entry: 4452456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 0, i32 1, i32 2, i32 3> 4462456e116SThomas Lively // 4472456e116SThomas Lively v128_t test_u32x4_const(void) { 4482456e116SThomas Lively return wasm_u32x4_const(0, 1, 2, 3); 4492456e116SThomas Lively } 4502456e116SThomas Lively 451f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_const( 452f3b769e8SThomas Lively // CHECK-NEXT: entry: 453f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 0, i32 0, i32 1, i32 0> 454f3b769e8SThomas Lively // 4552456e116SThomas Lively v128_t test_i64x2_const(void) { 456f3b769e8SThomas Lively return wasm_i64x2_const(0, 1); 457f3b769e8SThomas Lively } 458f3b769e8SThomas Lively 4592456e116SThomas Lively // CHECK-LABEL: @test_u64x2_const( 4602456e116SThomas Lively // CHECK-NEXT: entry: 4612456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 0, i32 0, i32 1, i32 0> 4622456e116SThomas Lively // 4632456e116SThomas Lively v128_t test_u64x2_const(void) { 4642456e116SThomas Lively return wasm_u64x2_const(0, 1); 4652456e116SThomas Lively } 4662456e116SThomas Lively 467f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_const( 468f3b769e8SThomas Lively // CHECK-NEXT: entry: 469f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 0, i32 1065353216, i32 1073741824, i32 1077936128> 470f3b769e8SThomas Lively // 4712456e116SThomas Lively v128_t test_f32x4_const(void) { 472f3b769e8SThomas Lively return wasm_f32x4_const(0, 1, 2, 3); 473f3b769e8SThomas Lively } 474f3b769e8SThomas Lively 475f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_const( 476f3b769e8SThomas Lively // CHECK-NEXT: entry: 477f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 0, i32 0, i32 0, i32 1072693248> 478f3b769e8SThomas Lively // 4792456e116SThomas Lively v128_t test_f64x2_const(void) { 480f3b769e8SThomas Lively return wasm_f64x2_const(0, 1); 481f3b769e8SThomas Lively } 482f3b769e8SThomas Lively 48381fce29dSThomas Lively // CHECK-LABEL: @test_i8x16_const_splat( 48481fce29dSThomas Lively // CHECK-NEXT: entry: 485*38fffa63SPaul Walker // CHECK-NEXT: ret <4 x i32> splat (i32 707406378) 48681fce29dSThomas Lively // 4872456e116SThomas Lively v128_t test_i8x16_const_splat(void) { 48881fce29dSThomas Lively return wasm_i8x16_const_splat(42); 48981fce29dSThomas Lively } 49081fce29dSThomas Lively 4912456e116SThomas Lively // CHECK-LABEL: @test_u8x16_const_splat( 4922456e116SThomas Lively // CHECK-NEXT: entry: 493*38fffa63SPaul Walker // CHECK-NEXT: ret <4 x i32> splat (i32 707406378) 4942456e116SThomas Lively // 4952456e116SThomas Lively v128_t test_u8x16_const_splat(void) { 4962456e116SThomas Lively return wasm_u8x16_const_splat(42); 4972456e116SThomas Lively } 4982456e116SThomas Lively 49981fce29dSThomas Lively // CHECK-LABEL: @test_i16x8_const_splat( 50081fce29dSThomas Lively // CHECK-NEXT: entry: 501*38fffa63SPaul Walker // CHECK-NEXT: ret <4 x i32> splat (i32 2752554) 50281fce29dSThomas Lively // 5032456e116SThomas Lively v128_t test_i16x8_const_splat(void) { 50481fce29dSThomas Lively return wasm_i16x8_const_splat(42); 50581fce29dSThomas Lively } 50681fce29dSThomas Lively 5072456e116SThomas Lively // CHECK-LABEL: @test_u16x8_const_splat( 5082456e116SThomas Lively // CHECK-NEXT: entry: 509*38fffa63SPaul Walker // CHECK-NEXT: ret <4 x i32> splat (i32 2752554) 5102456e116SThomas Lively // 5112456e116SThomas Lively v128_t test_u16x8_const_splat(void) { 5122456e116SThomas Lively return wasm_u16x8_const_splat(42); 5132456e116SThomas Lively } 5142456e116SThomas Lively 51581fce29dSThomas Lively // CHECK-LABEL: @test_i32x4_const_splat( 51681fce29dSThomas Lively // CHECK-NEXT: entry: 517*38fffa63SPaul Walker // CHECK-NEXT: ret <4 x i32> splat (i32 42) 51881fce29dSThomas Lively // 5192456e116SThomas Lively v128_t test_i32x4_const_splat(void) { 52081fce29dSThomas Lively return wasm_i32x4_const_splat(42); 52181fce29dSThomas Lively } 52281fce29dSThomas Lively 5232456e116SThomas Lively // CHECK-LABEL: @test_u32x4_const_splat( 5242456e116SThomas Lively // CHECK-NEXT: entry: 525*38fffa63SPaul Walker // CHECK-NEXT: ret <4 x i32> splat (i32 42) 5262456e116SThomas Lively // 5272456e116SThomas Lively v128_t test_u32x4_const_splat(void) { 5282456e116SThomas Lively return wasm_u32x4_const_splat(42); 5292456e116SThomas Lively } 5302456e116SThomas Lively 53181fce29dSThomas Lively // CHECK-LABEL: @test_i64x2_const_splat( 53281fce29dSThomas Lively // CHECK-NEXT: entry: 53381fce29dSThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 42, i32 0, i32 42, i32 0> 53481fce29dSThomas Lively // 5352456e116SThomas Lively v128_t test_i64x2_const_splat(void) { 53681fce29dSThomas Lively return wasm_i64x2_const_splat(42); 53781fce29dSThomas Lively } 53881fce29dSThomas Lively 5392456e116SThomas Lively // CHECK-LABEL: @test_u64x2_const_splat( 5402456e116SThomas Lively // CHECK-NEXT: entry: 5412456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 42, i32 0, i32 42, i32 0> 5422456e116SThomas Lively // 5432456e116SThomas Lively v128_t test_u64x2_const_splat(void) { 5442456e116SThomas Lively return wasm_u64x2_const_splat(42); 5452456e116SThomas Lively } 5462456e116SThomas Lively 54781fce29dSThomas Lively // CHECK-LABEL: @test_f32x4_const_splat( 54881fce29dSThomas Lively // CHECK-NEXT: entry: 549*38fffa63SPaul Walker // CHECK-NEXT: ret <4 x i32> splat (i32 1109917696) 55081fce29dSThomas Lively // 5512456e116SThomas Lively v128_t test_f32x4_const_splat(void) { 55281fce29dSThomas Lively return wasm_f32x4_const_splat(42); 55381fce29dSThomas Lively } 55481fce29dSThomas Lively 55581fce29dSThomas Lively // CHECK-LABEL: @test_f64x2_const_splat( 55681fce29dSThomas Lively // CHECK-NEXT: entry: 5571e9c39a3SThomas Lively // CHECK-NEXT: ret <4 x i32> <i32 0, i32 1078263808, i32 0, i32 1078263808> 55881fce29dSThomas Lively // 5592456e116SThomas Lively v128_t test_f64x2_const_splat(void) { 56081fce29dSThomas Lively return wasm_f64x2_const_splat(42); 56181fce29dSThomas Lively } 56281fce29dSThomas Lively 563f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_splat( 564f3b769e8SThomas Lively // CHECK-NEXT: entry: 565a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[A:%.*]], i64 0 566a723ca32SJuneyoung Lee // CHECK-NEXT: [[VECINIT15_I:%.*]] = shufflevector <16 x i8> [[VECINIT_I]], <16 x i8> poison, <16 x i32> zeroinitializer 567f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[VECINIT15_I]] to <4 x i32> 568f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 569f3b769e8SThomas Lively // 570f3b769e8SThomas Lively v128_t test_i8x16_splat(int8_t a) { 571f3b769e8SThomas Lively return wasm_i8x16_splat(a); 572f3b769e8SThomas Lively } 573f3b769e8SThomas Lively 5742456e116SThomas Lively // CHECK-LABEL: @test_u8x16_splat( 5752456e116SThomas Lively // CHECK-NEXT: entry: 576a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[A:%.*]], i64 0 5772456e116SThomas Lively // CHECK-NEXT: [[VECINIT15_I:%.*]] = shufflevector <16 x i8> [[VECINIT_I]], <16 x i8> poison, <16 x i32> zeroinitializer 5782456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[VECINIT15_I]] to <4 x i32> 5792456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 5802456e116SThomas Lively // 5812456e116SThomas Lively v128_t test_u8x16_splat(uint8_t a) { 5822456e116SThomas Lively return wasm_u8x16_splat(a); 5832456e116SThomas Lively } 5842456e116SThomas Lively 585f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_extract_lane( 586f3b769e8SThomas Lively // CHECK-NEXT: entry: 587f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 588e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <16 x i8> [[TMP0]], i64 15 589481084f6SThomas Lively // CHECK-NEXT: ret i8 [[VECEXT_I]] 590f3b769e8SThomas Lively // 591f3b769e8SThomas Lively int8_t test_i8x16_extract_lane(v128_t a) { 592f3b769e8SThomas Lively return wasm_i8x16_extract_lane(a, 15); 593f3b769e8SThomas Lively } 594f3b769e8SThomas Lively 595f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_extract_lane( 596f3b769e8SThomas Lively // CHECK-NEXT: entry: 597f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 598e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <16 x i8> [[TMP0]], i64 15 599481084f6SThomas Lively // CHECK-NEXT: ret i8 [[VECEXT_I]] 600f3b769e8SThomas Lively // 601f3b769e8SThomas Lively uint8_t test_u8x16_extract_lane(v128_t a) { 602f3b769e8SThomas Lively return wasm_u8x16_extract_lane(a, 15); 603f3b769e8SThomas Lively } 604f3b769e8SThomas Lively 605f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_replace_lane( 606f3b769e8SThomas Lively // CHECK-NEXT: entry: 607f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 608e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <16 x i8> [[TMP0]], i8 [[B:%.*]], i64 15 609481084f6SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[VECINS_I]] to <4 x i32> 610481084f6SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 611f3b769e8SThomas Lively // 612f3b769e8SThomas Lively v128_t test_i8x16_replace_lane(v128_t a, int8_t b) { 613f3b769e8SThomas Lively return wasm_i8x16_replace_lane(a, 15, b); 614f3b769e8SThomas Lively } 615f3b769e8SThomas Lively 6162456e116SThomas Lively // CHECK-LABEL: @test_u8x16_replace_lane( 6172456e116SThomas Lively // CHECK-NEXT: entry: 6182456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 619e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <16 x i8> [[TMP0]], i8 [[B:%.*]], i64 15 6202456e116SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[VECINS_I]] to <4 x i32> 6212456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 6222456e116SThomas Lively // 6232456e116SThomas Lively v128_t test_u8x16_replace_lane(v128_t a, uint8_t b) { 6242456e116SThomas Lively return wasm_u8x16_replace_lane(a, 15, b); 6252456e116SThomas Lively } 6262456e116SThomas Lively 627f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_splat( 628f3b769e8SThomas Lively // CHECK-NEXT: entry: 629a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[A:%.*]], i64 0 630a723ca32SJuneyoung Lee // CHECK-NEXT: [[VECINIT7_I:%.*]] = shufflevector <8 x i16> [[VECINIT_I]], <8 x i16> poison, <8 x i32> zeroinitializer 631f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <4 x i32> 632f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 633f3b769e8SThomas Lively // 634f3b769e8SThomas Lively v128_t test_i16x8_splat(int16_t a) { 635f3b769e8SThomas Lively return wasm_i16x8_splat(a); 636f3b769e8SThomas Lively } 637f3b769e8SThomas Lively 6382456e116SThomas Lively // CHECK-LABEL: @test_u16x8_splat( 6392456e116SThomas Lively // CHECK-NEXT: entry: 640a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[A:%.*]], i64 0 6412456e116SThomas Lively // CHECK-NEXT: [[VECINIT7_I:%.*]] = shufflevector <8 x i16> [[VECINIT_I]], <8 x i16> poison, <8 x i32> zeroinitializer 6422456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <4 x i32> 6432456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 6442456e116SThomas Lively // 6452456e116SThomas Lively v128_t test_u16x8_splat(uint16_t a) { 6462456e116SThomas Lively return wasm_u16x8_splat(a); 6472456e116SThomas Lively } 6482456e116SThomas Lively 649f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_extract_lane( 650f3b769e8SThomas Lively // CHECK-NEXT: entry: 651f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 652e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <8 x i16> [[TMP0]], i64 7 653481084f6SThomas Lively // CHECK-NEXT: ret i16 [[VECEXT_I]] 654f3b769e8SThomas Lively // 655f3b769e8SThomas Lively int16_t test_i16x8_extract_lane(v128_t a) { 656f3b769e8SThomas Lively return wasm_i16x8_extract_lane(a, 7); 657f3b769e8SThomas Lively } 658f3b769e8SThomas Lively 659f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_extract_lane( 660f3b769e8SThomas Lively // CHECK-NEXT: entry: 661f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 662e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <8 x i16> [[TMP0]], i64 7 663481084f6SThomas Lively // CHECK-NEXT: ret i16 [[VECEXT_I]] 664f3b769e8SThomas Lively // 665f3b769e8SThomas Lively uint16_t test_u16x8_extract_lane(v128_t a) { 666f3b769e8SThomas Lively return wasm_u16x8_extract_lane(a, 7); 667f3b769e8SThomas Lively } 668f3b769e8SThomas Lively 669f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_replace_lane( 670f3b769e8SThomas Lively // CHECK-NEXT: entry: 671f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 672e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <8 x i16> [[TMP0]], i16 [[B:%.*]], i64 7 673481084f6SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINS_I]] to <4 x i32> 674481084f6SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 675f3b769e8SThomas Lively // 676f3b769e8SThomas Lively v128_t test_i16x8_replace_lane(v128_t a, int16_t b) { 677f3b769e8SThomas Lively return wasm_i16x8_replace_lane(a, 7, b); 678f3b769e8SThomas Lively } 679f3b769e8SThomas Lively 6802456e116SThomas Lively // CHECK-LABEL: @test_u16x8_replace_lane( 6812456e116SThomas Lively // CHECK-NEXT: entry: 6822456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 683e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <8 x i16> [[TMP0]], i16 [[B:%.*]], i64 7 6842456e116SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINS_I]] to <4 x i32> 6852456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 6862456e116SThomas Lively // 6872456e116SThomas Lively v128_t test_u16x8_replace_lane(v128_t a, uint16_t b) { 6882456e116SThomas Lively return wasm_u16x8_replace_lane(a, 7, b); 6892456e116SThomas Lively } 6902456e116SThomas Lively 691f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_splat( 692f3b769e8SThomas Lively // CHECK-NEXT: entry: 693a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[A:%.*]], i64 0 694a723ca32SJuneyoung Lee // CHECK-NEXT: [[VECINIT3_I:%.*]] = shufflevector <4 x i32> [[VECINIT_I]], <4 x i32> poison, <4 x i32> zeroinitializer 695f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[VECINIT3_I]] 696f3b769e8SThomas Lively // 697f3b769e8SThomas Lively v128_t test_i32x4_splat(int32_t a) { 698f3b769e8SThomas Lively return wasm_i32x4_splat(a); 699f3b769e8SThomas Lively } 700f3b769e8SThomas Lively 7012456e116SThomas Lively // CHECK-LABEL: @test_u32x4_splat( 7022456e116SThomas Lively // CHECK-NEXT: entry: 703a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[A:%.*]], i64 0 7042456e116SThomas Lively // CHECK-NEXT: [[VECINIT3_I:%.*]] = shufflevector <4 x i32> [[VECINIT_I]], <4 x i32> poison, <4 x i32> zeroinitializer 7052456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[VECINIT3_I]] 7062456e116SThomas Lively // 7072456e116SThomas Lively v128_t test_u32x4_splat(uint32_t a) { 7082456e116SThomas Lively return wasm_u32x4_splat(a); 7092456e116SThomas Lively } 7102456e116SThomas Lively 711f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_extract_lane( 712f3b769e8SThomas Lively // CHECK-NEXT: entry: 713e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[A:%.*]], i64 3 714481084f6SThomas Lively // CHECK-NEXT: ret i32 [[VECEXT_I]] 715f3b769e8SThomas Lively // 716f3b769e8SThomas Lively int32_t test_i32x4_extract_lane(v128_t a) { 717f3b769e8SThomas Lively return wasm_i32x4_extract_lane(a, 3); 718f3b769e8SThomas Lively } 719f3b769e8SThomas Lively 7202456e116SThomas Lively // CHECK-LABEL: @test_u32x4_extract_lane( 7212456e116SThomas Lively // CHECK-NEXT: entry: 722e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[A:%.*]], i64 3 7232456e116SThomas Lively // CHECK-NEXT: ret i32 [[VECEXT_I]] 7242456e116SThomas Lively // 7252456e116SThomas Lively uint32_t test_u32x4_extract_lane(v128_t a) { 7262456e116SThomas Lively return wasm_u32x4_extract_lane(a, 3); 7272456e116SThomas Lively } 7282456e116SThomas Lively 729f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_replace_lane( 730f3b769e8SThomas Lively // CHECK-NEXT: entry: 731e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x i32> [[A:%.*]], i32 [[B:%.*]], i64 3 732481084f6SThomas Lively // CHECK-NEXT: ret <4 x i32> [[VECINS_I]] 733f3b769e8SThomas Lively // 734f3b769e8SThomas Lively v128_t test_i32x4_replace_lane(v128_t a, int32_t b) { 735f3b769e8SThomas Lively return wasm_i32x4_replace_lane(a, 3, b); 736f3b769e8SThomas Lively } 737f3b769e8SThomas Lively 7382456e116SThomas Lively // CHECK-LABEL: @test_u32x4_replace_lane( 7392456e116SThomas Lively // CHECK-NEXT: entry: 740e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x i32> [[A:%.*]], i32 [[B:%.*]], i64 3 7412456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[VECINS_I]] 7422456e116SThomas Lively // 7432456e116SThomas Lively v128_t test_u32x4_replace_lane(v128_t a, uint32_t b) { 7442456e116SThomas Lively return wasm_u32x4_replace_lane(a, 3, b); 7452456e116SThomas Lively } 7462456e116SThomas Lively 747f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_splat( 748f3b769e8SThomas Lively // CHECK-NEXT: entry: 749a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[A:%.*]], i64 0 750a723ca32SJuneyoung Lee // CHECK-NEXT: [[VECINIT1_I:%.*]] = shufflevector <2 x i64> [[VECINIT_I]], <2 x i64> poison, <2 x i32> zeroinitializer 751f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[VECINIT1_I]] to <4 x i32> 752f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 753f3b769e8SThomas Lively // 754f3b769e8SThomas Lively v128_t test_i64x2_splat(int64_t a) { 755f3b769e8SThomas Lively return wasm_i64x2_splat(a); 756f3b769e8SThomas Lively } 757f3b769e8SThomas Lively 7582456e116SThomas Lively // CHECK-LABEL: @test_u64x2_splat( 7592456e116SThomas Lively // CHECK-NEXT: entry: 760a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[A:%.*]], i64 0 7612456e116SThomas Lively // CHECK-NEXT: [[VECINIT1_I:%.*]] = shufflevector <2 x i64> [[VECINIT_I]], <2 x i64> poison, <2 x i32> zeroinitializer 7622456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[VECINIT1_I]] to <4 x i32> 7632456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 7642456e116SThomas Lively // 7652456e116SThomas Lively v128_t test_u64x2_splat(uint64_t a) { 7662456e116SThomas Lively return wasm_u64x2_splat(a); 7672456e116SThomas Lively } 7682456e116SThomas Lively 769f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_extract_lane( 770f3b769e8SThomas Lively // CHECK-NEXT: entry: 771f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 772e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <2 x i64> [[TMP0]], i64 1 773481084f6SThomas Lively // CHECK-NEXT: ret i64 [[VECEXT_I]] 774f3b769e8SThomas Lively // 775f3b769e8SThomas Lively int64_t test_i64x2_extract_lane(v128_t a) { 776f3b769e8SThomas Lively return wasm_i64x2_extract_lane(a, 1); 777f3b769e8SThomas Lively } 778f3b769e8SThomas Lively 7792456e116SThomas Lively // CHECK-LABEL: @test_u64x2_extract_lane( 7802456e116SThomas Lively // CHECK-NEXT: entry: 7812456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 782e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <2 x i64> [[TMP0]], i64 1 7832456e116SThomas Lively // CHECK-NEXT: ret i64 [[VECEXT_I]] 7842456e116SThomas Lively // 7852456e116SThomas Lively uint64_t test_u64x2_extract_lane(v128_t a) { 7862456e116SThomas Lively return wasm_u64x2_extract_lane(a, 1); 7872456e116SThomas Lively } 7882456e116SThomas Lively 789f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_replace_lane( 790f3b769e8SThomas Lively // CHECK-NEXT: entry: 791f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 792e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1 793481084f6SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[VECINS_I]] to <4 x i32> 794481084f6SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 795f3b769e8SThomas Lively // 796f3b769e8SThomas Lively v128_t test_i64x2_replace_lane(v128_t a, int64_t b) { 797f3b769e8SThomas Lively return wasm_i64x2_replace_lane(a, 1, b); 798f3b769e8SThomas Lively } 799f3b769e8SThomas Lively 8002456e116SThomas Lively // CHECK-LABEL: @test_u64x2_replace_lane( 8012456e116SThomas Lively // CHECK-NEXT: entry: 8022456e116SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 803e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B:%.*]], i64 1 8042456e116SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[VECINS_I]] to <4 x i32> 8052456e116SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 8062456e116SThomas Lively // 8072456e116SThomas Lively v128_t test_u64x2_replace_lane(v128_t a, uint64_t b) { 8082456e116SThomas Lively return wasm_u64x2_replace_lane(a, 1, b); 8092456e116SThomas Lively } 8102456e116SThomas Lively 811f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_splat( 812f3b769e8SThomas Lively // CHECK-NEXT: entry: 813a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x float> poison, float [[A:%.*]], i64 0 814f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[VECINIT_I]] to <4 x i32> 815e5aaf033Shyeongyu kim // CHECK-NEXT: [[TMP1:%.*]] = shufflevector <4 x i32> [[TMP0]], <4 x i32> poison, <4 x i32> zeroinitializer 816f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 817f3b769e8SThomas Lively // 818f3b769e8SThomas Lively v128_t test_f32x4_splat(float a) { 819f3b769e8SThomas Lively return wasm_f32x4_splat(a); 820f3b769e8SThomas Lively } 821f3b769e8SThomas Lively 822f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_extract_lane( 823f3b769e8SThomas Lively // CHECK-NEXT: entry: 824f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 825e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x float> [[TMP0]], i64 3 826481084f6SThomas Lively // CHECK-NEXT: ret float [[VECEXT_I]] 827f3b769e8SThomas Lively // 828f3b769e8SThomas Lively float test_f32x4_extract_lane(v128_t a) { 829f3b769e8SThomas Lively return wasm_f32x4_extract_lane(a, 3); 830f3b769e8SThomas Lively } 831f3b769e8SThomas Lively 832f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_replace_lane( 833f3b769e8SThomas Lively // CHECK-NEXT: entry: 834f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 835e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x float> [[TMP0]], float [[B:%.*]], i64 3 836481084f6SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[VECINS_I]] to <4 x i32> 837481084f6SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 838f3b769e8SThomas Lively // 839f3b769e8SThomas Lively v128_t test_f32x4_replace_lane(v128_t a, float b) { 840f3b769e8SThomas Lively return wasm_f32x4_replace_lane(a, 3, b); 841f3b769e8SThomas Lively } 842f3b769e8SThomas Lively 843f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_splat( 844f3b769e8SThomas Lively // CHECK-NEXT: entry: 845a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x double> poison, double [[A:%.*]], i64 0 846a723ca32SJuneyoung Lee // CHECK-NEXT: [[VECINIT1_I:%.*]] = shufflevector <2 x double> [[VECINIT_I]], <2 x double> poison, <2 x i32> zeroinitializer 847f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[VECINIT1_I]] to <4 x i32> 848f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 849f3b769e8SThomas Lively // 850f3b769e8SThomas Lively v128_t test_f64x2_splat(double a) { 851f3b769e8SThomas Lively return wasm_f64x2_splat(a); 852f3b769e8SThomas Lively } 853f3b769e8SThomas Lively 854f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_extract_lane( 855f3b769e8SThomas Lively // CHECK-NEXT: entry: 856f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 857e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <2 x double> [[TMP0]], i64 1 858481084f6SThomas Lively // CHECK-NEXT: ret double [[VECEXT_I]] 859f3b769e8SThomas Lively // 860f3b769e8SThomas Lively double test_f64x2_extract_lane(v128_t a) { 861f3b769e8SThomas Lively return wasm_f64x2_extract_lane(a, 1); 862f3b769e8SThomas Lively } 863f3b769e8SThomas Lively 864f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_replace_lane( 865f3b769e8SThomas Lively // CHECK-NEXT: entry: 866f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 867e6ad9ef4SPhilip Reames // CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <2 x double> [[TMP0]], double [[B:%.*]], i64 1 868481084f6SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x double> [[VECINS_I]] to <4 x i32> 869481084f6SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 870f3b769e8SThomas Lively // 871f3b769e8SThomas Lively v128_t test_f64x2_replace_lane(v128_t a, double b) { 872f3b769e8SThomas Lively return wasm_f64x2_replace_lane(a, 1, b); 873f3b769e8SThomas Lively } 874f3b769e8SThomas Lively 875f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_eq( 876f3b769e8SThomas Lively // CHECK-NEXT: entry: 877f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 878f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 879f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp eq <16 x i8> [[TMP0]], [[TMP1]] 880f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 881f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 882f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 883f3b769e8SThomas Lively // 884f3b769e8SThomas Lively v128_t test_i8x16_eq(v128_t a, v128_t b) { 885f3b769e8SThomas Lively return wasm_i8x16_eq(a, b); 886f3b769e8SThomas Lively } 887f3b769e8SThomas Lively 888f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_ne( 889f3b769e8SThomas Lively // CHECK-NEXT: entry: 890f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 891f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 892f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ne <16 x i8> [[TMP0]], [[TMP1]] 893f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 894f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 895f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 896f3b769e8SThomas Lively // 897f3b769e8SThomas Lively v128_t test_i8x16_ne(v128_t a, v128_t b) { 898f3b769e8SThomas Lively return wasm_i8x16_ne(a, b); 899f3b769e8SThomas Lively } 900f3b769e8SThomas Lively 901f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_lt( 902f3b769e8SThomas Lively // CHECK-NEXT: entry: 903f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 904f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 905f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp slt <16 x i8> [[TMP0]], [[TMP1]] 906f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 907f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 908f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 909f3b769e8SThomas Lively // 910f3b769e8SThomas Lively v128_t test_i8x16_lt(v128_t a, v128_t b) { 911f3b769e8SThomas Lively return wasm_i8x16_lt(a, b); 912f3b769e8SThomas Lively } 913f3b769e8SThomas Lively 914f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_lt( 915f3b769e8SThomas Lively // CHECK-NEXT: entry: 916f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 917f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 918f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ult <16 x i8> [[TMP0]], [[TMP1]] 919f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 920f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 921f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 922f3b769e8SThomas Lively // 923f3b769e8SThomas Lively v128_t test_u8x16_lt(v128_t a, v128_t b) { 924f3b769e8SThomas Lively return wasm_u8x16_lt(a, b); 925f3b769e8SThomas Lively } 926f3b769e8SThomas Lively 927f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_gt( 928f3b769e8SThomas Lively // CHECK-NEXT: entry: 929f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 930f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 931f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sgt <16 x i8> [[TMP0]], [[TMP1]] 932f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 933f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 934f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 935f3b769e8SThomas Lively // 936f3b769e8SThomas Lively v128_t test_i8x16_gt(v128_t a, v128_t b) { 937f3b769e8SThomas Lively return wasm_i8x16_gt(a, b); 938f3b769e8SThomas Lively } 939f3b769e8SThomas Lively 940f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_gt( 941f3b769e8SThomas Lively // CHECK-NEXT: entry: 942f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 943f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 944f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ugt <16 x i8> [[TMP0]], [[TMP1]] 945f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 946f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 947f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 948f3b769e8SThomas Lively // 949f3b769e8SThomas Lively v128_t test_u8x16_gt(v128_t a, v128_t b) { 950f3b769e8SThomas Lively return wasm_u8x16_gt(a, b); 951f3b769e8SThomas Lively } 952f3b769e8SThomas Lively 953f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_le( 954f3b769e8SThomas Lively // CHECK-NEXT: entry: 955f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 956f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 957f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sle <16 x i8> [[TMP0]], [[TMP1]] 958f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 959f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 960f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 961f3b769e8SThomas Lively // 962f3b769e8SThomas Lively v128_t test_i8x16_le(v128_t a, v128_t b) { 963f3b769e8SThomas Lively return wasm_i8x16_le(a, b); 964f3b769e8SThomas Lively } 965f3b769e8SThomas Lively 966f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_le( 967f3b769e8SThomas Lively // CHECK-NEXT: entry: 968f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 969f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 970f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ule <16 x i8> [[TMP0]], [[TMP1]] 971f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 972f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 973f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 974f3b769e8SThomas Lively // 975f3b769e8SThomas Lively v128_t test_u8x16_le(v128_t a, v128_t b) { 976f3b769e8SThomas Lively return wasm_u8x16_le(a, b); 977f3b769e8SThomas Lively } 978f3b769e8SThomas Lively 979f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_ge( 980f3b769e8SThomas Lively // CHECK-NEXT: entry: 981f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 982f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 983f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sge <16 x i8> [[TMP0]], [[TMP1]] 984f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 985f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 986f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 987f3b769e8SThomas Lively // 988f3b769e8SThomas Lively v128_t test_i8x16_ge(v128_t a, v128_t b) { 989f3b769e8SThomas Lively return wasm_i8x16_ge(a, b); 990f3b769e8SThomas Lively } 991f3b769e8SThomas Lively 992f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_ge( 993f3b769e8SThomas Lively // CHECK-NEXT: entry: 994f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 995f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 996f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp uge <16 x i8> [[TMP0]], [[TMP1]] 997f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8> 998f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32> 999f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1000f3b769e8SThomas Lively // 1001f3b769e8SThomas Lively v128_t test_u8x16_ge(v128_t a, v128_t b) { 1002f3b769e8SThomas Lively return wasm_u8x16_ge(a, b); 1003f3b769e8SThomas Lively } 1004f3b769e8SThomas Lively 1005f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_eq( 1006f3b769e8SThomas Lively // CHECK-NEXT: entry: 1007f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1008f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1009f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp eq <8 x i16> [[TMP0]], [[TMP1]] 1010f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1011f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1012f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1013f3b769e8SThomas Lively // 1014f3b769e8SThomas Lively v128_t test_i16x8_eq(v128_t a, v128_t b) { 1015f3b769e8SThomas Lively return wasm_i16x8_eq(a, b); 1016f3b769e8SThomas Lively } 1017f3b769e8SThomas Lively 1018f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_ne( 1019f3b769e8SThomas Lively // CHECK-NEXT: entry: 1020f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1021f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1022f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ne <8 x i16> [[TMP0]], [[TMP1]] 1023f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1024f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1025f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1026f3b769e8SThomas Lively // 1027f3b769e8SThomas Lively v128_t test_i16x8_ne(v128_t a, v128_t b) { 1028f3b769e8SThomas Lively return wasm_i16x8_ne(a, b); 1029f3b769e8SThomas Lively } 1030f3b769e8SThomas Lively 1031f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_lt( 1032f3b769e8SThomas Lively // CHECK-NEXT: entry: 1033f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1034f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1035f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp slt <8 x i16> [[TMP0]], [[TMP1]] 1036f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1037f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1038f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1039f3b769e8SThomas Lively // 1040f3b769e8SThomas Lively v128_t test_i16x8_lt(v128_t a, v128_t b) { 1041f3b769e8SThomas Lively return wasm_i16x8_lt(a, b); 1042f3b769e8SThomas Lively } 1043f3b769e8SThomas Lively 1044f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_lt( 1045f3b769e8SThomas Lively // CHECK-NEXT: entry: 1046f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1047f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1048f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ult <8 x i16> [[TMP0]], [[TMP1]] 1049f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1050f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1051f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1052f3b769e8SThomas Lively // 1053f3b769e8SThomas Lively v128_t test_u16x8_lt(v128_t a, v128_t b) { 1054f3b769e8SThomas Lively return wasm_u16x8_lt(a, b); 1055f3b769e8SThomas Lively } 1056f3b769e8SThomas Lively 1057f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_gt( 1058f3b769e8SThomas Lively // CHECK-NEXT: entry: 1059f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1060f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1061f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sgt <8 x i16> [[TMP0]], [[TMP1]] 1062f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1063f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1064f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1065f3b769e8SThomas Lively // 1066f3b769e8SThomas Lively v128_t test_i16x8_gt(v128_t a, v128_t b) { 1067f3b769e8SThomas Lively return wasm_i16x8_gt(a, b); 1068f3b769e8SThomas Lively } 1069f3b769e8SThomas Lively 1070f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_gt( 1071f3b769e8SThomas Lively // CHECK-NEXT: entry: 1072f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1073f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1074f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ugt <8 x i16> [[TMP0]], [[TMP1]] 1075f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1076f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1077f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1078f3b769e8SThomas Lively // 1079f3b769e8SThomas Lively v128_t test_u16x8_gt(v128_t a, v128_t b) { 1080f3b769e8SThomas Lively return wasm_u16x8_gt(a, b); 1081f3b769e8SThomas Lively } 1082f3b769e8SThomas Lively 1083f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_le( 1084f3b769e8SThomas Lively // CHECK-NEXT: entry: 1085f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1086f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1087f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sle <8 x i16> [[TMP0]], [[TMP1]] 1088f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1089f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1090f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1091f3b769e8SThomas Lively // 1092f3b769e8SThomas Lively v128_t test_i16x8_le(v128_t a, v128_t b) { 1093f3b769e8SThomas Lively return wasm_i16x8_le(a, b); 1094f3b769e8SThomas Lively } 1095f3b769e8SThomas Lively 1096f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_le( 1097f3b769e8SThomas Lively // CHECK-NEXT: entry: 1098f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1099f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1100f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ule <8 x i16> [[TMP0]], [[TMP1]] 1101f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1102f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1103f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1104f3b769e8SThomas Lively // 1105f3b769e8SThomas Lively v128_t test_u16x8_le(v128_t a, v128_t b) { 1106f3b769e8SThomas Lively return wasm_u16x8_le(a, b); 1107f3b769e8SThomas Lively } 1108f3b769e8SThomas Lively 1109f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_ge( 1110f3b769e8SThomas Lively // CHECK-NEXT: entry: 1111f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1112f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1113f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sge <8 x i16> [[TMP0]], [[TMP1]] 1114f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1115f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1116f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1117f3b769e8SThomas Lively // 1118f3b769e8SThomas Lively v128_t test_i16x8_ge(v128_t a, v128_t b) { 1119f3b769e8SThomas Lively return wasm_i16x8_ge(a, b); 1120f3b769e8SThomas Lively } 1121f3b769e8SThomas Lively 1122f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_ge( 1123f3b769e8SThomas Lively // CHECK-NEXT: entry: 1124f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1125f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1126f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp uge <8 x i16> [[TMP0]], [[TMP1]] 1127f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16> 1128f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32> 1129f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1130f3b769e8SThomas Lively // 1131f3b769e8SThomas Lively v128_t test_u16x8_ge(v128_t a, v128_t b) { 1132f3b769e8SThomas Lively return wasm_u16x8_ge(a, b); 1133f3b769e8SThomas Lively } 1134f3b769e8SThomas Lively 1135f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_eq( 1136f3b769e8SThomas Lively // CHECK-NEXT: entry: 1137f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp eq <4 x i32> [[A:%.*]], [[B:%.*]] 1138f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1139f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1140f3b769e8SThomas Lively // 1141f3b769e8SThomas Lively v128_t test_i32x4_eq(v128_t a, v128_t b) { 1142f3b769e8SThomas Lively return wasm_i32x4_eq(a, b); 1143f3b769e8SThomas Lively } 1144f3b769e8SThomas Lively 1145f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_ne( 1146f3b769e8SThomas Lively // CHECK-NEXT: entry: 1147f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ne <4 x i32> [[A:%.*]], [[B:%.*]] 1148f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1149f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1150f3b769e8SThomas Lively // 1151f3b769e8SThomas Lively v128_t test_i32x4_ne(v128_t a, v128_t b) { 1152f3b769e8SThomas Lively return wasm_i32x4_ne(a, b); 1153f3b769e8SThomas Lively } 1154f3b769e8SThomas Lively 1155f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_lt( 1156f3b769e8SThomas Lively // CHECK-NEXT: entry: 1157f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp slt <4 x i32> [[A:%.*]], [[B:%.*]] 1158f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1159f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1160f3b769e8SThomas Lively // 1161f3b769e8SThomas Lively v128_t test_i32x4_lt(v128_t a, v128_t b) { 1162f3b769e8SThomas Lively return wasm_i32x4_lt(a, b); 1163f3b769e8SThomas Lively } 1164f3b769e8SThomas Lively 1165f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_lt( 1166f3b769e8SThomas Lively // CHECK-NEXT: entry: 1167f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ult <4 x i32> [[A:%.*]], [[B:%.*]] 1168f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1169f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1170f3b769e8SThomas Lively // 1171f3b769e8SThomas Lively v128_t test_u32x4_lt(v128_t a, v128_t b) { 1172f3b769e8SThomas Lively return wasm_u32x4_lt(a, b); 1173f3b769e8SThomas Lively } 1174f3b769e8SThomas Lively 1175f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_gt( 1176f3b769e8SThomas Lively // CHECK-NEXT: entry: 1177f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sgt <4 x i32> [[A:%.*]], [[B:%.*]] 1178f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1179f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1180f3b769e8SThomas Lively // 1181f3b769e8SThomas Lively v128_t test_i32x4_gt(v128_t a, v128_t b) { 1182f3b769e8SThomas Lively return wasm_i32x4_gt(a, b); 1183f3b769e8SThomas Lively } 1184f3b769e8SThomas Lively 1185f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_gt( 1186f3b769e8SThomas Lively // CHECK-NEXT: entry: 1187f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ugt <4 x i32> [[A:%.*]], [[B:%.*]] 1188f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1189f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1190f3b769e8SThomas Lively // 1191f3b769e8SThomas Lively v128_t test_u32x4_gt(v128_t a, v128_t b) { 1192f3b769e8SThomas Lively return wasm_u32x4_gt(a, b); 1193f3b769e8SThomas Lively } 1194f3b769e8SThomas Lively 1195f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_le( 1196f3b769e8SThomas Lively // CHECK-NEXT: entry: 1197f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sle <4 x i32> [[A:%.*]], [[B:%.*]] 1198f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1199f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1200f3b769e8SThomas Lively // 1201f3b769e8SThomas Lively v128_t test_i32x4_le(v128_t a, v128_t b) { 1202f3b769e8SThomas Lively return wasm_i32x4_le(a, b); 1203f3b769e8SThomas Lively } 1204f3b769e8SThomas Lively 1205f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_le( 1206f3b769e8SThomas Lively // CHECK-NEXT: entry: 1207f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ule <4 x i32> [[A:%.*]], [[B:%.*]] 1208f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1209f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1210f3b769e8SThomas Lively // 1211f3b769e8SThomas Lively v128_t test_u32x4_le(v128_t a, v128_t b) { 1212f3b769e8SThomas Lively return wasm_u32x4_le(a, b); 1213f3b769e8SThomas Lively } 1214f3b769e8SThomas Lively 1215f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_ge( 1216f3b769e8SThomas Lively // CHECK-NEXT: entry: 1217f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sge <4 x i32> [[A:%.*]], [[B:%.*]] 1218f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1219f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1220f3b769e8SThomas Lively // 1221f3b769e8SThomas Lively v128_t test_i32x4_ge(v128_t a, v128_t b) { 1222f3b769e8SThomas Lively return wasm_i32x4_ge(a, b); 1223f3b769e8SThomas Lively } 1224f3b769e8SThomas Lively 1225f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_ge( 1226f3b769e8SThomas Lively // CHECK-NEXT: entry: 1227f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp uge <4 x i32> [[A:%.*]], [[B:%.*]] 1228f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1229f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1230f3b769e8SThomas Lively // 1231f3b769e8SThomas Lively v128_t test_u32x4_ge(v128_t a, v128_t b) { 1232f3b769e8SThomas Lively return wasm_u32x4_ge(a, b); 1233f3b769e8SThomas Lively } 1234f3b769e8SThomas Lively 1235f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_eq( 1236f3b769e8SThomas Lively // CHECK-NEXT: entry: 1237f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 1238f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x i64> 1239f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp eq <2 x i64> [[TMP0]], [[TMP1]] 1240f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1241f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1242f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1243f3b769e8SThomas Lively // 1244f3b769e8SThomas Lively v128_t test_i64x2_eq(v128_t a, v128_t b) { 1245f3b769e8SThomas Lively return wasm_i64x2_eq(a, b); 1246f3b769e8SThomas Lively } 1247f3b769e8SThomas Lively 1248f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_ne( 1249f3b769e8SThomas Lively // CHECK-NEXT: entry: 1250f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 1251f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x i64> 1252f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp ne <2 x i64> [[TMP0]], [[TMP1]] 1253f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1254f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1255f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1256f3b769e8SThomas Lively // 1257f3b769e8SThomas Lively v128_t test_i64x2_ne(v128_t a, v128_t b) { 1258f3b769e8SThomas Lively return wasm_i64x2_ne(a, b); 1259f3b769e8SThomas Lively } 1260f3b769e8SThomas Lively 1261f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_lt( 1262f3b769e8SThomas Lively // CHECK-NEXT: entry: 1263f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 1264f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x i64> 1265f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp slt <2 x i64> [[TMP0]], [[TMP1]] 1266f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1267f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1268f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1269f3b769e8SThomas Lively // 1270f3b769e8SThomas Lively v128_t test_i64x2_lt(v128_t a, v128_t b) { 1271f3b769e8SThomas Lively return wasm_i64x2_lt(a, b); 1272f3b769e8SThomas Lively } 1273f3b769e8SThomas Lively 1274f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_gt( 1275f3b769e8SThomas Lively // CHECK-NEXT: entry: 1276f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 1277f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x i64> 1278f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sgt <2 x i64> [[TMP0]], [[TMP1]] 1279f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1280f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1281f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1282f3b769e8SThomas Lively // 1283f3b769e8SThomas Lively v128_t test_i64x2_gt(v128_t a, v128_t b) { 1284f3b769e8SThomas Lively return wasm_i64x2_gt(a, b); 1285f3b769e8SThomas Lively } 1286f3b769e8SThomas Lively 1287f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_le( 1288f3b769e8SThomas Lively // CHECK-NEXT: entry: 1289f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 1290f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x i64> 1291f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sle <2 x i64> [[TMP0]], [[TMP1]] 1292f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1293f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1294f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1295f3b769e8SThomas Lively // 1296f3b769e8SThomas Lively v128_t test_i64x2_le(v128_t a, v128_t b) { 1297f3b769e8SThomas Lively return wasm_i64x2_le(a, b); 1298f3b769e8SThomas Lively } 1299f3b769e8SThomas Lively 1300f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_ge( 1301f3b769e8SThomas Lively // CHECK-NEXT: entry: 1302f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 1303f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x i64> 1304f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = icmp sge <2 x i64> [[TMP0]], [[TMP1]] 1305f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1306f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1307f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1308f3b769e8SThomas Lively // 1309f3b769e8SThomas Lively v128_t test_i64x2_ge(v128_t a, v128_t b) { 1310f3b769e8SThomas Lively return wasm_i64x2_ge(a, b); 1311f3b769e8SThomas Lively } 1312f3b769e8SThomas Lively 1313f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_eq( 1314f3b769e8SThomas Lively // CHECK-NEXT: entry: 1315f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 1316f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 1317f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp oeq <4 x float> [[TMP0]], [[TMP1]] 1318f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1319f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1320f3b769e8SThomas Lively // 1321f3b769e8SThomas Lively v128_t test_f32x4_eq(v128_t a, v128_t b) { 1322f3b769e8SThomas Lively return wasm_f32x4_eq(a, b); 1323f3b769e8SThomas Lively } 1324f3b769e8SThomas Lively 1325f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_ne( 1326f3b769e8SThomas Lively // CHECK-NEXT: entry: 1327f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 1328f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 1329f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp une <4 x float> [[TMP0]], [[TMP1]] 1330f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1331f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1332f3b769e8SThomas Lively // 1333f3b769e8SThomas Lively v128_t test_f32x4_ne(v128_t a, v128_t b) { 1334f3b769e8SThomas Lively return wasm_f32x4_ne(a, b); 1335f3b769e8SThomas Lively } 1336f3b769e8SThomas Lively 1337f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_lt( 1338f3b769e8SThomas Lively // CHECK-NEXT: entry: 1339f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 1340f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 1341f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp olt <4 x float> [[TMP0]], [[TMP1]] 1342f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1343f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1344f3b769e8SThomas Lively // 1345f3b769e8SThomas Lively v128_t test_f32x4_lt(v128_t a, v128_t b) { 1346f3b769e8SThomas Lively return wasm_f32x4_lt(a, b); 1347f3b769e8SThomas Lively } 1348f3b769e8SThomas Lively 1349f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_gt( 1350f3b769e8SThomas Lively // CHECK-NEXT: entry: 1351f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 1352f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 1353f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp ogt <4 x float> [[TMP0]], [[TMP1]] 1354f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1355f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1356f3b769e8SThomas Lively // 1357f3b769e8SThomas Lively v128_t test_f32x4_gt(v128_t a, v128_t b) { 1358f3b769e8SThomas Lively return wasm_f32x4_gt(a, b); 1359f3b769e8SThomas Lively } 1360f3b769e8SThomas Lively 1361f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_le( 1362f3b769e8SThomas Lively // CHECK-NEXT: entry: 1363f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 1364f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 1365f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp ole <4 x float> [[TMP0]], [[TMP1]] 1366f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1367f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1368f3b769e8SThomas Lively // 1369f3b769e8SThomas Lively v128_t test_f32x4_le(v128_t a, v128_t b) { 1370f3b769e8SThomas Lively return wasm_f32x4_le(a, b); 1371f3b769e8SThomas Lively } 1372f3b769e8SThomas Lively 1373f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_ge( 1374f3b769e8SThomas Lively // CHECK-NEXT: entry: 1375f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 1376f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 1377f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp oge <4 x float> [[TMP0]], [[TMP1]] 1378f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32> 1379f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SEXT_I]] 1380f3b769e8SThomas Lively // 1381f3b769e8SThomas Lively v128_t test_f32x4_ge(v128_t a, v128_t b) { 1382f3b769e8SThomas Lively return wasm_f32x4_ge(a, b); 1383f3b769e8SThomas Lively } 1384f3b769e8SThomas Lively 1385f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_eq( 1386f3b769e8SThomas Lively // CHECK-NEXT: entry: 1387f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 1388f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 1389f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp oeq <2 x double> [[TMP0]], [[TMP1]] 1390f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1391f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1392f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1393f3b769e8SThomas Lively // 1394f3b769e8SThomas Lively v128_t test_f64x2_eq(v128_t a, v128_t b) { 1395f3b769e8SThomas Lively return wasm_f64x2_eq(a, b); 1396f3b769e8SThomas Lively } 1397f3b769e8SThomas Lively 1398f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_ne( 1399f3b769e8SThomas Lively // CHECK-NEXT: entry: 1400f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 1401f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 1402f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp une <2 x double> [[TMP0]], [[TMP1]] 1403f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1404f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1405f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1406f3b769e8SThomas Lively // 1407f3b769e8SThomas Lively v128_t test_f64x2_ne(v128_t a, v128_t b) { 1408f3b769e8SThomas Lively return wasm_f64x2_ne(a, b); 1409f3b769e8SThomas Lively } 1410f3b769e8SThomas Lively 1411f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_lt( 1412f3b769e8SThomas Lively // CHECK-NEXT: entry: 1413f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 1414f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 1415f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp olt <2 x double> [[TMP0]], [[TMP1]] 1416f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1417f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1418f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1419f3b769e8SThomas Lively // 1420f3b769e8SThomas Lively v128_t test_f64x2_lt(v128_t a, v128_t b) { 1421f3b769e8SThomas Lively return wasm_f64x2_lt(a, b); 1422f3b769e8SThomas Lively } 1423f3b769e8SThomas Lively 1424f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_gt( 1425f3b769e8SThomas Lively // CHECK-NEXT: entry: 1426f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 1427f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 1428f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp ogt <2 x double> [[TMP0]], [[TMP1]] 1429f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1430f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1431f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1432f3b769e8SThomas Lively // 1433f3b769e8SThomas Lively v128_t test_f64x2_gt(v128_t a, v128_t b) { 1434f3b769e8SThomas Lively return wasm_f64x2_gt(a, b); 1435f3b769e8SThomas Lively } 1436f3b769e8SThomas Lively 1437f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_le( 1438f3b769e8SThomas Lively // CHECK-NEXT: entry: 1439f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 1440f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 1441f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp ole <2 x double> [[TMP0]], [[TMP1]] 1442f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1443f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1444f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1445f3b769e8SThomas Lively // 1446f3b769e8SThomas Lively v128_t test_f64x2_le(v128_t a, v128_t b) { 1447f3b769e8SThomas Lively return wasm_f64x2_le(a, b); 1448f3b769e8SThomas Lively } 1449f3b769e8SThomas Lively 1450f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_ge( 1451f3b769e8SThomas Lively // CHECK-NEXT: entry: 1452f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 1453f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 1454f3b769e8SThomas Lively // CHECK-NEXT: [[CMP_I:%.*]] = fcmp oge <2 x double> [[TMP0]], [[TMP1]] 1455f3b769e8SThomas Lively // CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64> 1456f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32> 1457f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1458f3b769e8SThomas Lively // 1459f3b769e8SThomas Lively v128_t test_f64x2_ge(v128_t a, v128_t b) { 1460f3b769e8SThomas Lively return wasm_f64x2_ge(a, b); 1461f3b769e8SThomas Lively } 1462f3b769e8SThomas Lively 1463f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_not( 1464f3b769e8SThomas Lively // CHECK-NEXT: entry: 1465*38fffa63SPaul Walker // CHECK-NEXT: [[NOT_I:%.*]] = xor <4 x i32> [[A:%.*]], splat (i32 -1) 1466e073de83SJun Ma // CHECK-NEXT: ret <4 x i32> [[NOT_I]] 1467f3b769e8SThomas Lively // 1468f3b769e8SThomas Lively v128_t test_v128_not(v128_t a) { 1469f3b769e8SThomas Lively return wasm_v128_not(a); 1470f3b769e8SThomas Lively } 1471f3b769e8SThomas Lively 1472f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_and( 1473f3b769e8SThomas Lively // CHECK-NEXT: entry: 1474f3b769e8SThomas Lively // CHECK-NEXT: [[AND_I:%.*]] = and <4 x i32> [[B:%.*]], [[A:%.*]] 1475f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[AND_I]] 1476f3b769e8SThomas Lively // 1477f3b769e8SThomas Lively v128_t test_v128_and(v128_t a, v128_t b) { 1478f3b769e8SThomas Lively return wasm_v128_and(a, b); 1479f3b769e8SThomas Lively } 1480f3b769e8SThomas Lively 1481f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_or( 1482f3b769e8SThomas Lively // CHECK-NEXT: entry: 1483f3b769e8SThomas Lively // CHECK-NEXT: [[OR_I:%.*]] = or <4 x i32> [[B:%.*]], [[A:%.*]] 1484f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[OR_I]] 1485f3b769e8SThomas Lively // 1486f3b769e8SThomas Lively v128_t test_v128_or(v128_t a, v128_t b) { 1487f3b769e8SThomas Lively return wasm_v128_or(a, b); 1488f3b769e8SThomas Lively } 1489f3b769e8SThomas Lively 1490f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_xor( 1491f3b769e8SThomas Lively // CHECK-NEXT: entry: 1492f3b769e8SThomas Lively // CHECK-NEXT: [[XOR_I:%.*]] = xor <4 x i32> [[B:%.*]], [[A:%.*]] 1493f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[XOR_I]] 1494f3b769e8SThomas Lively // 1495f3b769e8SThomas Lively v128_t test_v128_xor(v128_t a, v128_t b) { 1496f3b769e8SThomas Lively return wasm_v128_xor(a, b); 1497f3b769e8SThomas Lively } 1498f3b769e8SThomas Lively 1499f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_andnot( 1500f3b769e8SThomas Lively // CHECK-NEXT: entry: 1501*38fffa63SPaul Walker // CHECK-NEXT: [[NOT_I:%.*]] = xor <4 x i32> [[B:%.*]], splat (i32 -1) 1502a1058776SNikita Popov // CHECK-NEXT: [[AND_I:%.*]] = and <4 x i32> [[A:%.*]], [[NOT_I]] 1503f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[AND_I]] 1504f3b769e8SThomas Lively // 1505f3b769e8SThomas Lively v128_t test_v128_andnot(v128_t a, v128_t b) { 1506f3b769e8SThomas Lively return wasm_v128_andnot(a, b); 1507f3b769e8SThomas Lively } 1508f3b769e8SThomas Lively 1509f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_any_true( 1510f3b769e8SThomas Lively // CHECK-NEXT: entry: 1511f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 15121ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.anytrue.v16i8(<16 x i8> [[TMP0]]) 1513f3b769e8SThomas Lively // CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP1]], 0 1514f3b769e8SThomas Lively // CHECK-NEXT: ret i1 [[TOBOOL_I]] 1515f3b769e8SThomas Lively // 1516f3b769e8SThomas Lively bool test_v128_any_true(v128_t a) { 1517f3b769e8SThomas Lively return wasm_v128_any_true(a); 1518f3b769e8SThomas Lively } 1519f3b769e8SThomas Lively 1520f3b769e8SThomas Lively // CHECK-LABEL: @test_v128_bitselect( 1521f3b769e8SThomas Lively // CHECK-NEXT: entry: 15223391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.wasm.bitselect.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], <4 x i32> [[MASK:%.*]]) 1523f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 1524f3b769e8SThomas Lively // 1525f3b769e8SThomas Lively v128_t test_v128_bitselect(v128_t a, v128_t b, v128_t mask) { 1526f3b769e8SThomas Lively return wasm_v128_bitselect(a, b, mask); 1527f3b769e8SThomas Lively } 1528f3b769e8SThomas Lively 1529f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_abs( 1530f3b769e8SThomas Lively // CHECK-NEXT: entry: 1531f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 15323391bdc2SNoah Goldstein // CHECK-NEXT: [[ABS_I:%.*]] = tail call <16 x i8> @llvm.abs.v16i8(<16 x i8> [[TMP0]], i1 false) 1533e073de83SJun Ma // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[ABS_I]] to <4 x i32> 1534e073de83SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP1]] 1535f3b769e8SThomas Lively // 1536f3b769e8SThomas Lively v128_t test_i8x16_abs(v128_t a) { 1537f3b769e8SThomas Lively return wasm_i8x16_abs(a); 1538f3b769e8SThomas Lively } 1539f3b769e8SThomas Lively 1540f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_neg( 1541f3b769e8SThomas Lively // CHECK-NEXT: entry: 1542f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1543f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = sub <16 x i8> zeroinitializer, [[TMP0]] 1544f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[SUB_I]] to <4 x i32> 1545f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 1546f3b769e8SThomas Lively // 1547f3b769e8SThomas Lively v128_t test_i8x16_neg(v128_t a) { 1548f3b769e8SThomas Lively return wasm_i8x16_neg(a); 1549f3b769e8SThomas Lively } 1550f3b769e8SThomas Lively 1551f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_all_true( 1552f3b769e8SThomas Lively // CHECK-NEXT: entry: 1553f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 15541ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.alltrue.v16i8(<16 x i8> [[TMP0]]) 1555f3b769e8SThomas Lively // CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP1]], 0 1556f3b769e8SThomas Lively // CHECK-NEXT: ret i1 [[TOBOOL_I]] 1557f3b769e8SThomas Lively // 1558f3b769e8SThomas Lively bool test_i8x16_all_true(v128_t a) { 1559f3b769e8SThomas Lively return wasm_i8x16_all_true(a); 1560f3b769e8SThomas Lively } 1561f3b769e8SThomas Lively 1562f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_bitmask( 1563f3b769e8SThomas Lively // CHECK-NEXT: entry: 1564f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 15651ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.bitmask.v16i8(<16 x i8> [[TMP0]]) 1566f3b769e8SThomas Lively // CHECK-NEXT: ret i32 [[TMP1]] 1567f3b769e8SThomas Lively // 1568fd3bd63dSThomas Lively uint32_t test_i8x16_bitmask(v128_t a) { 1569f3b769e8SThomas Lively return wasm_i8x16_bitmask(a); 1570f3b769e8SThomas Lively } 1571f3b769e8SThomas Lively 1572f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_popcnt( 1573f3b769e8SThomas Lively // CHECK-NEXT: entry: 1574f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1575b8f3024aSAndreas Jonson // CHECK-NEXT: [[TMP1:%.*]] = tail call range(i8 0, 9) <16 x i8> @llvm.ctpop.v16i8(<16 x i8> [[TMP0]]) 1576f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x i32> 1577f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1578f3b769e8SThomas Lively // 1579f3b769e8SThomas Lively v128_t test_i8x16_popcnt(v128_t a) { 1580f3b769e8SThomas Lively return wasm_i8x16_popcnt(a); 1581f3b769e8SThomas Lively } 1582f3b769e8SThomas Lively 1583f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_shl( 1584f3b769e8SThomas Lively // CHECK-NEXT: entry: 1585f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 158605dbdb00SSanjay Patel // CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B:%.*]] to i8 1587f253bb64SJun Ma // CHECK-NEXT: [[TMP2:%.*]] = and i8 [[TMP1]], 7 1588a5f34155SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = insertelement <16 x i8> poison, i8 [[TMP2]], i64 0 1589f253bb64SJun Ma // CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <16 x i8> [[TMP3]], <16 x i8> poison, <16 x i32> zeroinitializer 1590f3b769e8SThomas Lively // CHECK-NEXT: [[SHL_I:%.*]] = shl <16 x i8> [[TMP0]], [[SH_PROM_I]] 1591f253bb64SJun Ma // CHECK-NEXT: [[TMP4:%.*]] = bitcast <16 x i8> [[SHL_I]] to <4 x i32> 1592f253bb64SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP4]] 1593f3b769e8SThomas Lively // 159464a9957bSThomas Lively v128_t test_i8x16_shl(v128_t a, uint32_t b) { 1595f3b769e8SThomas Lively return wasm_i8x16_shl(a, b); 1596f3b769e8SThomas Lively } 1597f3b769e8SThomas Lively 1598f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_shr( 1599f3b769e8SThomas Lively // CHECK-NEXT: entry: 1600f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 160105dbdb00SSanjay Patel // CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B:%.*]] to i8 1602f253bb64SJun Ma // CHECK-NEXT: [[TMP2:%.*]] = and i8 [[TMP1]], 7 1603a5f34155SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = insertelement <16 x i8> poison, i8 [[TMP2]], i64 0 1604f253bb64SJun Ma // CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <16 x i8> [[TMP3]], <16 x i8> poison, <16 x i32> zeroinitializer 1605f3b769e8SThomas Lively // CHECK-NEXT: [[SHR_I:%.*]] = ashr <16 x i8> [[TMP0]], [[SH_PROM_I]] 1606f253bb64SJun Ma // CHECK-NEXT: [[TMP4:%.*]] = bitcast <16 x i8> [[SHR_I]] to <4 x i32> 1607f253bb64SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP4]] 1608f3b769e8SThomas Lively // 160964a9957bSThomas Lively v128_t test_i8x16_shr(v128_t a, uint32_t b) { 1610f3b769e8SThomas Lively return wasm_i8x16_shr(a, b); 1611f3b769e8SThomas Lively } 1612f3b769e8SThomas Lively 1613f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_shr( 1614f3b769e8SThomas Lively // CHECK-NEXT: entry: 1615f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 161605dbdb00SSanjay Patel // CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B:%.*]] to i8 1617f253bb64SJun Ma // CHECK-NEXT: [[TMP2:%.*]] = and i8 [[TMP1]], 7 1618a5f34155SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = insertelement <16 x i8> poison, i8 [[TMP2]], i64 0 1619f253bb64SJun Ma // CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <16 x i8> [[TMP3]], <16 x i8> poison, <16 x i32> zeroinitializer 1620f3b769e8SThomas Lively // CHECK-NEXT: [[SHR_I:%.*]] = lshr <16 x i8> [[TMP0]], [[SH_PROM_I]] 1621f253bb64SJun Ma // CHECK-NEXT: [[TMP4:%.*]] = bitcast <16 x i8> [[SHR_I]] to <4 x i32> 1622f253bb64SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP4]] 1623f3b769e8SThomas Lively // 162464a9957bSThomas Lively v128_t test_u8x16_shr(v128_t a, uint32_t b) { 1625f3b769e8SThomas Lively return wasm_u8x16_shr(a, b); 1626f3b769e8SThomas Lively } 1627f3b769e8SThomas Lively 1628f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_add( 1629f3b769e8SThomas Lively // CHECK-NEXT: entry: 1630f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1631f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 1632f3b769e8SThomas Lively // CHECK-NEXT: [[ADD_I:%.*]] = add <16 x i8> [[TMP1]], [[TMP0]] 1633f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ADD_I]] to <4 x i32> 1634f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1635f3b769e8SThomas Lively // 1636f3b769e8SThomas Lively v128_t test_i8x16_add(v128_t a, v128_t b) { 1637f3b769e8SThomas Lively return wasm_i8x16_add(a, b); 1638f3b769e8SThomas Lively } 1639f3b769e8SThomas Lively 1640f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_add_sat( 1641f3b769e8SThomas Lively // CHECK-NEXT: entry: 1642f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1643f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 16441ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.sadd.sat.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 1645f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 1646f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1647f3b769e8SThomas Lively // 1648f3b769e8SThomas Lively v128_t test_i8x16_add_sat(v128_t a, v128_t b) { 1649f3b769e8SThomas Lively return wasm_i8x16_add_sat(a, b); 1650f3b769e8SThomas Lively } 1651f3b769e8SThomas Lively 1652f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_add_sat( 1653f3b769e8SThomas Lively // CHECK-NEXT: entry: 1654f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1655f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 16561ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 1657f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 1658f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1659f3b769e8SThomas Lively // 1660f3b769e8SThomas Lively v128_t test_u8x16_add_sat(v128_t a, v128_t b) { 1661f3b769e8SThomas Lively return wasm_u8x16_add_sat(a, b); 1662f3b769e8SThomas Lively } 1663f3b769e8SThomas Lively 1664f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_sub( 1665f3b769e8SThomas Lively // CHECK-NEXT: entry: 1666f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1667f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 1668f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = sub <16 x i8> [[TMP0]], [[TMP1]] 1669f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SUB_I]] to <4 x i32> 1670f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1671f3b769e8SThomas Lively // 1672f3b769e8SThomas Lively v128_t test_i8x16_sub(v128_t a, v128_t b) { 1673f3b769e8SThomas Lively return wasm_i8x16_sub(a, b); 1674f3b769e8SThomas Lively } 1675f3b769e8SThomas Lively 1676f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_sub_sat( 1677f3b769e8SThomas Lively // CHECK-NEXT: entry: 1678f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1679f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 1680f8f0a266SSimon Pilgrim // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.ssub.sat.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 1681f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 1682f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1683f3b769e8SThomas Lively // 1684f3b769e8SThomas Lively v128_t test_i8x16_sub_sat(v128_t a, v128_t b) { 1685f3b769e8SThomas Lively return wasm_i8x16_sub_sat(a, b); 1686f3b769e8SThomas Lively } 1687f3b769e8SThomas Lively 1688f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_sub_sat( 1689f3b769e8SThomas Lively // CHECK-NEXT: entry: 1690f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1691f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 1692f8f0a266SSimon Pilgrim // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.usub.sat.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 1693f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 1694f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1695f3b769e8SThomas Lively // 1696f3b769e8SThomas Lively v128_t test_u8x16_sub_sat(v128_t a, v128_t b) { 1697f3b769e8SThomas Lively return wasm_u8x16_sub_sat(a, b); 1698f3b769e8SThomas Lively } 1699f3b769e8SThomas Lively 1700f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_min( 1701f3b769e8SThomas Lively // CHECK-NEXT: entry: 1702f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1703f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 17043391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.smin.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 1705a266af72SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 1706a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1707f3b769e8SThomas Lively // 1708f3b769e8SThomas Lively v128_t test_i8x16_min(v128_t a, v128_t b) { 1709f3b769e8SThomas Lively return wasm_i8x16_min(a, b); 1710f3b769e8SThomas Lively } 1711f3b769e8SThomas Lively 1712f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_min( 1713f3b769e8SThomas Lively // CHECK-NEXT: entry: 1714f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1715f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 17163391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.umin.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 1717a266af72SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 1718a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1719f3b769e8SThomas Lively // 1720f3b769e8SThomas Lively v128_t test_u8x16_min(v128_t a, v128_t b) { 1721f3b769e8SThomas Lively return wasm_u8x16_min(a, b); 1722f3b769e8SThomas Lively } 1723f3b769e8SThomas Lively 1724f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_max( 1725f3b769e8SThomas Lively // CHECK-NEXT: entry: 1726f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1727f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 17283391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.smax.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 1729a266af72SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 1730a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1731f3b769e8SThomas Lively // 1732f3b769e8SThomas Lively v128_t test_i8x16_max(v128_t a, v128_t b) { 1733f3b769e8SThomas Lively return wasm_i8x16_max(a, b); 1734f3b769e8SThomas Lively } 1735f3b769e8SThomas Lively 1736f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_max( 1737f3b769e8SThomas Lively // CHECK-NEXT: entry: 1738f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1739f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 17403391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.umax.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 1741a266af72SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 1742a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1743f3b769e8SThomas Lively // 1744f3b769e8SThomas Lively v128_t test_u8x16_max(v128_t a, v128_t b) { 1745f3b769e8SThomas Lively return wasm_u8x16_max(a, b); 1746f3b769e8SThomas Lively } 1747f3b769e8SThomas Lively 1748f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_avgr( 1749f3b769e8SThomas Lively // CHECK-NEXT: entry: 1750f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 1751f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 17521ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.avgr.unsigned.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 1753f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 1754f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1755f3b769e8SThomas Lively // 1756f3b769e8SThomas Lively v128_t test_u8x16_avgr(v128_t a, v128_t b) { 1757f3b769e8SThomas Lively return wasm_u8x16_avgr(a, b); 1758f3b769e8SThomas Lively } 1759f3b769e8SThomas Lively 1760f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_abs( 1761f3b769e8SThomas Lively // CHECK-NEXT: entry: 1762f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 17633391bdc2SNoah Goldstein // CHECK-NEXT: [[ABS_I:%.*]] = tail call <8 x i16> @llvm.abs.v8i16(<8 x i16> [[TMP0]], i1 false) 1764e073de83SJun Ma // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[ABS_I]] to <4 x i32> 1765e073de83SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP1]] 1766f3b769e8SThomas Lively // 1767f3b769e8SThomas Lively v128_t test_i16x8_abs(v128_t a) { 1768f3b769e8SThomas Lively return wasm_i16x8_abs(a); 1769f3b769e8SThomas Lively } 1770f3b769e8SThomas Lively 1771f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_neg( 1772f3b769e8SThomas Lively // CHECK-NEXT: entry: 1773f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1774f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = sub <8 x i16> zeroinitializer, [[TMP0]] 1775f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[SUB_I]] to <4 x i32> 1776f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 1777f3b769e8SThomas Lively // 1778f3b769e8SThomas Lively v128_t test_i16x8_neg(v128_t a) { 1779f3b769e8SThomas Lively return wasm_i16x8_neg(a); 1780f3b769e8SThomas Lively } 1781f3b769e8SThomas Lively 1782f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_all_true( 1783f3b769e8SThomas Lively // CHECK-NEXT: entry: 1784f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 17851ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.alltrue.v8i16(<8 x i16> [[TMP0]]) 1786f3b769e8SThomas Lively // CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP1]], 0 1787f3b769e8SThomas Lively // CHECK-NEXT: ret i1 [[TOBOOL_I]] 1788f3b769e8SThomas Lively // 1789f3b769e8SThomas Lively bool test_i16x8_all_true(v128_t a) { 1790f3b769e8SThomas Lively return wasm_i16x8_all_true(a); 1791f3b769e8SThomas Lively } 1792f3b769e8SThomas Lively 1793f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_bitmask( 1794f3b769e8SThomas Lively // CHECK-NEXT: entry: 1795f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 17961ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.bitmask.v8i16(<8 x i16> [[TMP0]]) 1797f3b769e8SThomas Lively // CHECK-NEXT: ret i32 [[TMP1]] 1798f3b769e8SThomas Lively // 1799fd3bd63dSThomas Lively uint32_t test_i16x8_bitmask(v128_t a) { 1800f3b769e8SThomas Lively return wasm_i16x8_bitmask(a); 1801f3b769e8SThomas Lively } 1802f3b769e8SThomas Lively 1803f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_shl( 1804f3b769e8SThomas Lively // CHECK-NEXT: entry: 1805f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 180605dbdb00SSanjay Patel // CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B:%.*]] to i16 1807f253bb64SJun Ma // CHECK-NEXT: [[TMP2:%.*]] = and i16 [[TMP1]], 15 1808a5f34155SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = insertelement <8 x i16> poison, i16 [[TMP2]], i64 0 1809f253bb64SJun Ma // CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <8 x i16> [[TMP3]], <8 x i16> poison, <8 x i32> zeroinitializer 1810f3b769e8SThomas Lively // CHECK-NEXT: [[SHL_I:%.*]] = shl <8 x i16> [[TMP0]], [[SH_PROM_I]] 1811f253bb64SJun Ma // CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x i16> [[SHL_I]] to <4 x i32> 1812f253bb64SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP4]] 1813f3b769e8SThomas Lively // 181464a9957bSThomas Lively v128_t test_i16x8_shl(v128_t a, uint32_t b) { 1815f3b769e8SThomas Lively return wasm_i16x8_shl(a, b); 1816f3b769e8SThomas Lively } 1817f3b769e8SThomas Lively 1818f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_shr( 1819f3b769e8SThomas Lively // CHECK-NEXT: entry: 1820f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 182105dbdb00SSanjay Patel // CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B:%.*]] to i16 1822f253bb64SJun Ma // CHECK-NEXT: [[TMP2:%.*]] = and i16 [[TMP1]], 15 1823a5f34155SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = insertelement <8 x i16> poison, i16 [[TMP2]], i64 0 1824f253bb64SJun Ma // CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <8 x i16> [[TMP3]], <8 x i16> poison, <8 x i32> zeroinitializer 1825f3b769e8SThomas Lively // CHECK-NEXT: [[SHR_I:%.*]] = ashr <8 x i16> [[TMP0]], [[SH_PROM_I]] 1826f253bb64SJun Ma // CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x i16> [[SHR_I]] to <4 x i32> 1827f253bb64SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP4]] 1828f3b769e8SThomas Lively // 182964a9957bSThomas Lively v128_t test_i16x8_shr(v128_t a, uint32_t b) { 1830f3b769e8SThomas Lively return wasm_i16x8_shr(a, b); 1831f3b769e8SThomas Lively } 1832f3b769e8SThomas Lively 1833f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_shr( 1834f3b769e8SThomas Lively // CHECK-NEXT: entry: 1835f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 183605dbdb00SSanjay Patel // CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B:%.*]] to i16 1837f253bb64SJun Ma // CHECK-NEXT: [[TMP2:%.*]] = and i16 [[TMP1]], 15 1838a5f34155SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = insertelement <8 x i16> poison, i16 [[TMP2]], i64 0 1839f253bb64SJun Ma // CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <8 x i16> [[TMP3]], <8 x i16> poison, <8 x i32> zeroinitializer 1840f3b769e8SThomas Lively // CHECK-NEXT: [[SHR_I:%.*]] = lshr <8 x i16> [[TMP0]], [[SH_PROM_I]] 1841f253bb64SJun Ma // CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x i16> [[SHR_I]] to <4 x i32> 1842f253bb64SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP4]] 1843f3b769e8SThomas Lively // 184464a9957bSThomas Lively v128_t test_u16x8_shr(v128_t a, uint32_t b) { 1845f3b769e8SThomas Lively return wasm_u16x8_shr(a, b); 1846f3b769e8SThomas Lively } 1847f3b769e8SThomas Lively 1848f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_add( 1849f3b769e8SThomas Lively // CHECK-NEXT: entry: 1850f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1851f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1852f3b769e8SThomas Lively // CHECK-NEXT: [[ADD_I:%.*]] = add <8 x i16> [[TMP1]], [[TMP0]] 1853f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ADD_I]] to <4 x i32> 1854f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1855f3b769e8SThomas Lively // 1856f3b769e8SThomas Lively v128_t test_i16x8_add(v128_t a, v128_t b) { 1857f3b769e8SThomas Lively return wasm_i16x8_add(a, b); 1858f3b769e8SThomas Lively } 1859f3b769e8SThomas Lively 1860f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_add_sat( 1861f3b769e8SThomas Lively // CHECK-NEXT: entry: 1862f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1863f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 18641ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 1865f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 1866f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1867f3b769e8SThomas Lively // 1868f3b769e8SThomas Lively v128_t test_i16x8_add_sat(v128_t a, v128_t b) { 1869f3b769e8SThomas Lively return wasm_i16x8_add_sat(a, b); 1870f3b769e8SThomas Lively } 1871f3b769e8SThomas Lively 1872f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_add_sat( 1873f3b769e8SThomas Lively // CHECK-NEXT: entry: 1874f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1875f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 18761ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.uadd.sat.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 1877f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 1878f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1879f3b769e8SThomas Lively // 1880f3b769e8SThomas Lively v128_t test_u16x8_add_sat(v128_t a, v128_t b) { 1881f3b769e8SThomas Lively return wasm_u16x8_add_sat(a, b); 1882f3b769e8SThomas Lively } 1883f3b769e8SThomas Lively 1884f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_sub( 1885f3b769e8SThomas Lively // CHECK-NEXT: entry: 1886f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1887f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1888f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = sub <8 x i16> [[TMP0]], [[TMP1]] 1889f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SUB_I]] to <4 x i32> 1890f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1891f3b769e8SThomas Lively // 1892f3b769e8SThomas Lively v128_t test_i16x8_sub(v128_t a, v128_t b) { 1893f3b769e8SThomas Lively return wasm_i16x8_sub(a, b); 1894f3b769e8SThomas Lively } 1895f3b769e8SThomas Lively 1896f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_sub_sat( 1897f3b769e8SThomas Lively // CHECK-NEXT: entry: 1898f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1899f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1900f8f0a266SSimon Pilgrim // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.ssub.sat.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 1901f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 1902f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1903f3b769e8SThomas Lively // 1904f3b769e8SThomas Lively v128_t test_i16x8_sub_sat(v128_t a, v128_t b) { 1905f3b769e8SThomas Lively return wasm_i16x8_sub_sat(a, b); 1906f3b769e8SThomas Lively } 1907f3b769e8SThomas Lively 1908f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_sub_sat( 1909f3b769e8SThomas Lively // CHECK-NEXT: entry: 1910f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1911f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1912f8f0a266SSimon Pilgrim // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.usub.sat.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 1913f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 1914f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1915f3b769e8SThomas Lively // 1916f3b769e8SThomas Lively v128_t test_u16x8_sub_sat(v128_t a, v128_t b) { 1917f3b769e8SThomas Lively return wasm_u16x8_sub_sat(a, b); 1918f3b769e8SThomas Lively } 1919f3b769e8SThomas Lively 1920f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_mul( 1921f3b769e8SThomas Lively // CHECK-NEXT: entry: 1922f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1923f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 1924f3b769e8SThomas Lively // CHECK-NEXT: [[MUL_I:%.*]] = mul <8 x i16> [[TMP1]], [[TMP0]] 1925f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32> 1926f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 1927f3b769e8SThomas Lively // 1928f3b769e8SThomas Lively v128_t test_i16x8_mul(v128_t a, v128_t b) { 1929f3b769e8SThomas Lively return wasm_i16x8_mul(a, b); 1930f3b769e8SThomas Lively } 1931f3b769e8SThomas Lively 1932f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_min( 1933f3b769e8SThomas Lively // CHECK-NEXT: entry: 1934f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1935f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 19363391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.smin.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 1937a266af72SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 1938a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1939f3b769e8SThomas Lively // 1940f3b769e8SThomas Lively v128_t test_i16x8_min(v128_t a, v128_t b) { 1941f3b769e8SThomas Lively return wasm_i16x8_min(a, b); 1942f3b769e8SThomas Lively } 1943f3b769e8SThomas Lively 1944f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_min( 1945f3b769e8SThomas Lively // CHECK-NEXT: entry: 1946f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1947f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 19483391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.umin.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 1949a266af72SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 1950a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1951f3b769e8SThomas Lively // 1952f3b769e8SThomas Lively v128_t test_u16x8_min(v128_t a, v128_t b) { 1953f3b769e8SThomas Lively return wasm_u16x8_min(a, b); 1954f3b769e8SThomas Lively } 1955f3b769e8SThomas Lively 1956f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_max( 1957f3b769e8SThomas Lively // CHECK-NEXT: entry: 1958f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1959f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 19603391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.smax.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 1961a266af72SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 1962a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1963f3b769e8SThomas Lively // 1964f3b769e8SThomas Lively v128_t test_i16x8_max(v128_t a, v128_t b) { 1965f3b769e8SThomas Lively return wasm_i16x8_max(a, b); 1966f3b769e8SThomas Lively } 1967f3b769e8SThomas Lively 1968f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_max( 1969f3b769e8SThomas Lively // CHECK-NEXT: entry: 1970f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1971f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 19723391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.umax.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 1973a266af72SNikita Popov // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 1974a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1975f3b769e8SThomas Lively // 1976f3b769e8SThomas Lively v128_t test_u16x8_max(v128_t a, v128_t b) { 1977f3b769e8SThomas Lively return wasm_u16x8_max(a, b); 1978f3b769e8SThomas Lively } 1979f3b769e8SThomas Lively 1980f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_avgr( 1981f3b769e8SThomas Lively // CHECK-NEXT: entry: 1982f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 1983f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 19841ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.wasm.avgr.unsigned.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 1985f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 1986f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 1987f3b769e8SThomas Lively // 1988f3b769e8SThomas Lively v128_t test_u16x8_avgr(v128_t a, v128_t b) { 1989f3b769e8SThomas Lively return wasm_u16x8_avgr(a, b); 1990f3b769e8SThomas Lively } 1991f3b769e8SThomas Lively 1992f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_abs( 1993f3b769e8SThomas Lively // CHECK-NEXT: entry: 19943391bdc2SNoah Goldstein // CHECK-NEXT: [[ABS_I:%.*]] = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> [[A:%.*]], i1 false) 1995e073de83SJun Ma // CHECK-NEXT: ret <4 x i32> [[ABS_I]] 1996f3b769e8SThomas Lively // 1997f3b769e8SThomas Lively v128_t test_i32x4_abs(v128_t a) { 1998f3b769e8SThomas Lively return wasm_i32x4_abs(a); 1999f3b769e8SThomas Lively } 2000f3b769e8SThomas Lively 2001f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_neg( 2002f3b769e8SThomas Lively // CHECK-NEXT: entry: 2003f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = sub <4 x i32> zeroinitializer, [[A:%.*]] 2004f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SUB_I]] 2005f3b769e8SThomas Lively // 2006f3b769e8SThomas Lively v128_t test_i32x4_neg(v128_t a) { 2007f3b769e8SThomas Lively return wasm_i32x4_neg(a); 2008f3b769e8SThomas Lively } 2009f3b769e8SThomas Lively 2010f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_all_true( 2011f3b769e8SThomas Lively // CHECK-NEXT: entry: 20123391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.wasm.alltrue.v4i32(<4 x i32> [[A:%.*]]) 2013f3b769e8SThomas Lively // CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP0]], 0 2014f3b769e8SThomas Lively // CHECK-NEXT: ret i1 [[TOBOOL_I]] 2015f3b769e8SThomas Lively // 2016f3b769e8SThomas Lively bool test_i32x4_all_true(v128_t a) { 2017f3b769e8SThomas Lively return wasm_i32x4_all_true(a); 2018f3b769e8SThomas Lively } 2019f3b769e8SThomas Lively 2020f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_bitmask( 2021f3b769e8SThomas Lively // CHECK-NEXT: entry: 20223391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.wasm.bitmask.v4i32(<4 x i32> [[A:%.*]]) 2023f3b769e8SThomas Lively // CHECK-NEXT: ret i32 [[TMP0]] 2024f3b769e8SThomas Lively // 2025fd3bd63dSThomas Lively uint32_t test_i32x4_bitmask(v128_t a) { 2026f3b769e8SThomas Lively return wasm_i32x4_bitmask(a); 2027f3b769e8SThomas Lively } 2028f3b769e8SThomas Lively 2029f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_shl( 2030f3b769e8SThomas Lively // CHECK-NEXT: entry: 2031a5f34155SNikita Popov // CHECK-NEXT: [[AND_I:%.*]] = and i32 [[B:%.*]], 31 2032a5f34155SNikita Popov // CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <4 x i32> poison, i32 [[AND_I]], i64 0 2033f3b769e8SThomas Lively // CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <4 x i32> [[SPLAT_SPLATINSERT_I]], <4 x i32> poison, <4 x i32> zeroinitializer 2034f3b769e8SThomas Lively // CHECK-NEXT: [[SHL_I:%.*]] = shl <4 x i32> [[A:%.*]], [[SPLAT_SPLAT_I]] 2035f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SHL_I]] 2036f3b769e8SThomas Lively // 203764a9957bSThomas Lively v128_t test_i32x4_shl(v128_t a, uint32_t b) { 2038f3b769e8SThomas Lively return wasm_i32x4_shl(a, b); 2039f3b769e8SThomas Lively } 2040f3b769e8SThomas Lively 2041f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_shr( 2042f3b769e8SThomas Lively // CHECK-NEXT: entry: 2043a5f34155SNikita Popov // CHECK-NEXT: [[AND_I:%.*]] = and i32 [[B:%.*]], 31 2044a5f34155SNikita Popov // CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <4 x i32> poison, i32 [[AND_I]], i64 0 2045f3b769e8SThomas Lively // CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <4 x i32> [[SPLAT_SPLATINSERT_I]], <4 x i32> poison, <4 x i32> zeroinitializer 2046f3b769e8SThomas Lively // CHECK-NEXT: [[SHR_I:%.*]] = ashr <4 x i32> [[A:%.*]], [[SPLAT_SPLAT_I]] 2047f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SHR_I]] 2048f3b769e8SThomas Lively // 204964a9957bSThomas Lively v128_t test_i32x4_shr(v128_t a, uint32_t b) { 2050f3b769e8SThomas Lively return wasm_i32x4_shr(a, b); 2051f3b769e8SThomas Lively } 2052f3b769e8SThomas Lively 2053f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_shr( 2054f3b769e8SThomas Lively // CHECK-NEXT: entry: 2055a5f34155SNikita Popov // CHECK-NEXT: [[AND_I:%.*]] = and i32 [[B:%.*]], 31 2056a5f34155SNikita Popov // CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <4 x i32> poison, i32 [[AND_I]], i64 0 2057f3b769e8SThomas Lively // CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <4 x i32> [[SPLAT_SPLATINSERT_I]], <4 x i32> poison, <4 x i32> zeroinitializer 2058f3b769e8SThomas Lively // CHECK-NEXT: [[SHR_I:%.*]] = lshr <4 x i32> [[A:%.*]], [[SPLAT_SPLAT_I]] 2059f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SHR_I]] 2060f3b769e8SThomas Lively // 206164a9957bSThomas Lively v128_t test_u32x4_shr(v128_t a, uint32_t b) { 2062f3b769e8SThomas Lively return wasm_u32x4_shr(a, b); 2063f3b769e8SThomas Lively } 2064f3b769e8SThomas Lively 2065f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_add( 2066f3b769e8SThomas Lively // CHECK-NEXT: entry: 2067f3b769e8SThomas Lively // CHECK-NEXT: [[ADD_I:%.*]] = add <4 x i32> [[B:%.*]], [[A:%.*]] 2068f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[ADD_I]] 2069f3b769e8SThomas Lively // 2070f3b769e8SThomas Lively v128_t test_i32x4_add(v128_t a, v128_t b) { 2071f3b769e8SThomas Lively return wasm_i32x4_add(a, b); 2072f3b769e8SThomas Lively } 2073f3b769e8SThomas Lively 2074f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_sub( 2075f3b769e8SThomas Lively // CHECK-NEXT: entry: 2076f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = sub <4 x i32> [[A:%.*]], [[B:%.*]] 2077f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[SUB_I]] 2078f3b769e8SThomas Lively // 2079f3b769e8SThomas Lively v128_t test_i32x4_sub(v128_t a, v128_t b) { 2080f3b769e8SThomas Lively return wasm_i32x4_sub(a, b); 2081f3b769e8SThomas Lively } 2082f3b769e8SThomas Lively 2083f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_mul( 2084f3b769e8SThomas Lively // CHECK-NEXT: entry: 2085f3b769e8SThomas Lively // CHECK-NEXT: [[MUL_I:%.*]] = mul <4 x i32> [[B:%.*]], [[A:%.*]] 2086f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[MUL_I]] 2087f3b769e8SThomas Lively // 2088f3b769e8SThomas Lively v128_t test_i32x4_mul(v128_t a, v128_t b) { 2089f3b769e8SThomas Lively return wasm_i32x4_mul(a, b); 2090f3b769e8SThomas Lively } 2091f3b769e8SThomas Lively 2092f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_min( 2093f3b769e8SThomas Lively // CHECK-NEXT: entry: 20943391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]]) 2095a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2096f3b769e8SThomas Lively // 2097f3b769e8SThomas Lively v128_t test_i32x4_min(v128_t a, v128_t b) { 2098f3b769e8SThomas Lively return wasm_i32x4_min(a, b); 2099f3b769e8SThomas Lively } 2100f3b769e8SThomas Lively 2101f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_min( 2102f3b769e8SThomas Lively // CHECK-NEXT: entry: 21033391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.umin.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]]) 2104a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2105f3b769e8SThomas Lively // 2106f3b769e8SThomas Lively v128_t test_u32x4_min(v128_t a, v128_t b) { 2107f3b769e8SThomas Lively return wasm_u32x4_min(a, b); 2108f3b769e8SThomas Lively } 2109f3b769e8SThomas Lively 2110f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_max( 2111f3b769e8SThomas Lively // CHECK-NEXT: entry: 21123391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]]) 2113a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2114f3b769e8SThomas Lively // 2115f3b769e8SThomas Lively v128_t test_i32x4_max(v128_t a, v128_t b) { 2116f3b769e8SThomas Lively return wasm_i32x4_max(a, b); 2117f3b769e8SThomas Lively } 2118f3b769e8SThomas Lively 2119f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_max( 2120f3b769e8SThomas Lively // CHECK-NEXT: entry: 21213391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.umax.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]]) 2122a266af72SNikita Popov // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2123f3b769e8SThomas Lively // 2124f3b769e8SThomas Lively v128_t test_u32x4_max(v128_t a, v128_t b) { 2125f3b769e8SThomas Lively return wasm_u32x4_max(a, b); 2126f3b769e8SThomas Lively } 2127f3b769e8SThomas Lively 2128f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_dot_i16x8( 2129f3b769e8SThomas Lively // CHECK-NEXT: entry: 2130f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 2131f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 21321ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x i32> @llvm.wasm.dot(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 2133f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2134f3b769e8SThomas Lively // 2135f3b769e8SThomas Lively v128_t test_i32x4_dot_i16x8(v128_t a, v128_t b) { 2136f3b769e8SThomas Lively return wasm_i32x4_dot_i16x8(a, b); 2137f3b769e8SThomas Lively } 2138f3b769e8SThomas Lively 2139f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_abs( 2140f3b769e8SThomas Lively // CHECK-NEXT: entry: 2141f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 21423391bdc2SNoah Goldstein // CHECK-NEXT: [[ABS_I:%.*]] = tail call <2 x i64> @llvm.abs.v2i64(<2 x i64> [[TMP0]], i1 false) 2143e073de83SJun Ma // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[ABS_I]] to <4 x i32> 2144e073de83SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2145f3b769e8SThomas Lively // 2146f3b769e8SThomas Lively v128_t test_i64x2_abs(v128_t a) { 2147f3b769e8SThomas Lively return wasm_i64x2_abs(a); 2148f3b769e8SThomas Lively } 2149f3b769e8SThomas Lively 2150f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_neg( 2151f3b769e8SThomas Lively // CHECK-NEXT: entry: 2152f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 2153f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = sub <2 x i64> zeroinitializer, [[TMP0]] 2154f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[SUB_I]] to <4 x i32> 2155f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2156f3b769e8SThomas Lively // 2157f3b769e8SThomas Lively v128_t test_i64x2_neg(v128_t a) { 2158f3b769e8SThomas Lively return wasm_i64x2_neg(a); 2159f3b769e8SThomas Lively } 2160f3b769e8SThomas Lively 2161f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_all_true( 2162f3b769e8SThomas Lively // CHECK-NEXT: entry: 2163f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 21641ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.alltrue.v2i64(<2 x i64> [[TMP0]]) 2165f3b769e8SThomas Lively // CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP1]], 0 2166f3b769e8SThomas Lively // CHECK-NEXT: ret i1 [[TOBOOL_I]] 2167f3b769e8SThomas Lively // 2168f3b769e8SThomas Lively bool test_i64x2_all_true(v128_t a) { 2169f3b769e8SThomas Lively return wasm_i64x2_all_true(a); 2170f3b769e8SThomas Lively } 2171f3b769e8SThomas Lively 2172f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_bitmask( 2173f3b769e8SThomas Lively // CHECK-NEXT: entry: 2174f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 21751ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.bitmask.v2i64(<2 x i64> [[TMP0]]) 2176f3b769e8SThomas Lively // CHECK-NEXT: ret i32 [[TMP1]] 2177f3b769e8SThomas Lively // 2178fd3bd63dSThomas Lively uint32_t test_i64x2_bitmask(v128_t a) { 2179f3b769e8SThomas Lively return wasm_i64x2_bitmask(a); 2180f3b769e8SThomas Lively } 2181f3b769e8SThomas Lively 2182f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_shl( 2183f3b769e8SThomas Lively // CHECK-NEXT: entry: 2184f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 2185f253bb64SJun Ma // CHECK-NEXT: [[TMP1:%.*]] = and i32 [[B:%.*]], 63 2186a5f34155SNikita Popov // CHECK-NEXT: [[AND_I:%.*]] = zext nneg i32 [[TMP1]] to i64 2187a5f34155SNikita Popov // CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <2 x i64> poison, i64 [[AND_I]], i64 0 2188f3b769e8SThomas Lively // CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <2 x i64> [[SPLAT_SPLATINSERT_I]], <2 x i64> poison, <2 x i32> zeroinitializer 2189f3b769e8SThomas Lively // CHECK-NEXT: [[SHL_I:%.*]] = shl <2 x i64> [[TMP0]], [[SPLAT_SPLAT_I]] 2190f253bb64SJun Ma // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SHL_I]] to <4 x i32> 2191f253bb64SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2192f3b769e8SThomas Lively // 219364a9957bSThomas Lively v128_t test_i64x2_shl(v128_t a, uint32_t b) { 2194f3b769e8SThomas Lively return wasm_i64x2_shl(a, b); 2195f3b769e8SThomas Lively } 2196f3b769e8SThomas Lively 2197f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_shr( 2198f3b769e8SThomas Lively // CHECK-NEXT: entry: 2199f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 2200f253bb64SJun Ma // CHECK-NEXT: [[TMP1:%.*]] = and i32 [[B:%.*]], 63 2201a5f34155SNikita Popov // CHECK-NEXT: [[AND_I:%.*]] = zext nneg i32 [[TMP1]] to i64 2202a5f34155SNikita Popov // CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <2 x i64> poison, i64 [[AND_I]], i64 0 2203f3b769e8SThomas Lively // CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <2 x i64> [[SPLAT_SPLATINSERT_I]], <2 x i64> poison, <2 x i32> zeroinitializer 2204f3b769e8SThomas Lively // CHECK-NEXT: [[SHR_I:%.*]] = ashr <2 x i64> [[TMP0]], [[SPLAT_SPLAT_I]] 2205f253bb64SJun Ma // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SHR_I]] to <4 x i32> 2206f253bb64SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2207f3b769e8SThomas Lively // 220864a9957bSThomas Lively v128_t test_i64x2_shr(v128_t a, uint32_t b) { 2209f3b769e8SThomas Lively return wasm_i64x2_shr(a, b); 2210f3b769e8SThomas Lively } 2211f3b769e8SThomas Lively 2212f3b769e8SThomas Lively // CHECK-LABEL: @test_u64x2_shr( 2213f3b769e8SThomas Lively // CHECK-NEXT: entry: 2214f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 2215f253bb64SJun Ma // CHECK-NEXT: [[TMP1:%.*]] = and i32 [[B:%.*]], 63 2216a5f34155SNikita Popov // CHECK-NEXT: [[AND_I:%.*]] = zext nneg i32 [[TMP1]] to i64 2217a5f34155SNikita Popov // CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <2 x i64> poison, i64 [[AND_I]], i64 0 2218f3b769e8SThomas Lively // CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <2 x i64> [[SPLAT_SPLATINSERT_I]], <2 x i64> poison, <2 x i32> zeroinitializer 2219f3b769e8SThomas Lively // CHECK-NEXT: [[SHR_I:%.*]] = lshr <2 x i64> [[TMP0]], [[SPLAT_SPLAT_I]] 2220f253bb64SJun Ma // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SHR_I]] to <4 x i32> 2221f253bb64SJun Ma // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2222f3b769e8SThomas Lively // 222364a9957bSThomas Lively v128_t test_u64x2_shr(v128_t a, uint32_t b) { 2224f3b769e8SThomas Lively return wasm_u64x2_shr(a, b); 2225f3b769e8SThomas Lively } 2226f3b769e8SThomas Lively 2227f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_add( 2228f3b769e8SThomas Lively // CHECK-NEXT: entry: 2229f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 2230f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x i64> 2231f3b769e8SThomas Lively // CHECK-NEXT: [[ADD_I:%.*]] = add <2 x i64> [[TMP1]], [[TMP0]] 2232f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[ADD_I]] to <4 x i32> 2233f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2234f3b769e8SThomas Lively // 2235f3b769e8SThomas Lively v128_t test_i64x2_add(v128_t a, v128_t b) { 2236f3b769e8SThomas Lively return wasm_i64x2_add(a, b); 2237f3b769e8SThomas Lively } 2238f3b769e8SThomas Lively 2239f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_sub( 2240f3b769e8SThomas Lively // CHECK-NEXT: entry: 2241f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 2242f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x i64> 2243f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = sub <2 x i64> [[TMP0]], [[TMP1]] 2244f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SUB_I]] to <4 x i32> 2245f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2246f3b769e8SThomas Lively // 2247f3b769e8SThomas Lively v128_t test_i64x2_sub(v128_t a, v128_t b) { 2248f3b769e8SThomas Lively return wasm_i64x2_sub(a, b); 2249f3b769e8SThomas Lively } 2250f3b769e8SThomas Lively 2251f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_mul( 2252f3b769e8SThomas Lively // CHECK-NEXT: entry: 2253f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x i64> 2254f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x i64> 2255f3b769e8SThomas Lively // CHECK-NEXT: [[MUL_I:%.*]] = mul <2 x i64> [[TMP1]], [[TMP0]] 2256f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32> 2257f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2258f3b769e8SThomas Lively // 2259f3b769e8SThomas Lively v128_t test_i64x2_mul(v128_t a, v128_t b) { 2260f3b769e8SThomas Lively return wasm_i64x2_mul(a, b); 2261f3b769e8SThomas Lively } 2262f3b769e8SThomas Lively 2263f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_abs( 2264f3b769e8SThomas Lively // CHECK-NEXT: entry: 2265f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 22661ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> [[TMP0]]) 2267f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32> 2268f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2269f3b769e8SThomas Lively // 2270f3b769e8SThomas Lively v128_t test_f32x4_abs(v128_t a) { 2271f3b769e8SThomas Lively return wasm_f32x4_abs(a); 2272f3b769e8SThomas Lively } 2273f3b769e8SThomas Lively 2274f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_neg( 2275f3b769e8SThomas Lively // CHECK-NEXT: entry: 2276f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 2277f3b769e8SThomas Lively // CHECK-NEXT: [[FNEG_I:%.*]] = fneg <4 x float> [[TMP0]] 2278f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[FNEG_I]] to <4 x i32> 2279f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2280f3b769e8SThomas Lively // 2281f3b769e8SThomas Lively v128_t test_f32x4_neg(v128_t a) { 2282f3b769e8SThomas Lively return wasm_f32x4_neg(a); 2283f3b769e8SThomas Lively } 2284f3b769e8SThomas Lively 2285f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_sqrt( 2286f3b769e8SThomas Lively // CHECK-NEXT: entry: 2287f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 22881ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.sqrt.v4f32(<4 x float> [[TMP0]]) 2289f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32> 2290f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2291f3b769e8SThomas Lively // 2292f3b769e8SThomas Lively v128_t test_f32x4_sqrt(v128_t a) { 2293f3b769e8SThomas Lively return wasm_f32x4_sqrt(a); 2294f3b769e8SThomas Lively } 2295f3b769e8SThomas Lively 2296f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_ceil( 2297f3b769e8SThomas Lively // CHECK-NEXT: entry: 2298f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 22991ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.ceil.v4f32(<4 x float> [[TMP0]]) 2300f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32> 2301f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2302f3b769e8SThomas Lively // 2303f3b769e8SThomas Lively v128_t test_f32x4_ceil(v128_t a) { 2304f3b769e8SThomas Lively return wasm_f32x4_ceil(a); 2305f3b769e8SThomas Lively } 2306f3b769e8SThomas Lively 2307f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_floor( 2308f3b769e8SThomas Lively // CHECK-NEXT: entry: 2309f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 23101ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.floor.v4f32(<4 x float> [[TMP0]]) 2311f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32> 2312f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2313f3b769e8SThomas Lively // 2314f3b769e8SThomas Lively v128_t test_f32x4_floor(v128_t a) { 2315f3b769e8SThomas Lively return wasm_f32x4_floor(a); 2316f3b769e8SThomas Lively } 2317f3b769e8SThomas Lively 2318f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_trunc( 2319f3b769e8SThomas Lively // CHECK-NEXT: entry: 2320f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 23211ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.trunc.v4f32(<4 x float> [[TMP0]]) 2322f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32> 2323f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2324f3b769e8SThomas Lively // 2325f3b769e8SThomas Lively v128_t test_f32x4_trunc(v128_t a) { 2326f3b769e8SThomas Lively return wasm_f32x4_trunc(a); 2327f3b769e8SThomas Lively } 2328f3b769e8SThomas Lively 2329f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_nearest( 2330f3b769e8SThomas Lively // CHECK-NEXT: entry: 2331f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 23321ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.nearbyint.v4f32(<4 x float> [[TMP0]]) 2333f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32> 2334f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2335f3b769e8SThomas Lively // 2336f3b769e8SThomas Lively v128_t test_f32x4_nearest(v128_t a) { 2337f3b769e8SThomas Lively return wasm_f32x4_nearest(a); 2338f3b769e8SThomas Lively } 2339f3b769e8SThomas Lively 2340f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_add( 2341f3b769e8SThomas Lively // CHECK-NEXT: entry: 2342f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 2343f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 2344f3b769e8SThomas Lively // CHECK-NEXT: [[ADD_I:%.*]] = fadd <4 x float> [[TMP0]], [[TMP1]] 2345f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[ADD_I]] to <4 x i32> 2346f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2347f3b769e8SThomas Lively // 2348f3b769e8SThomas Lively v128_t test_f32x4_add(v128_t a, v128_t b) { 2349f3b769e8SThomas Lively return wasm_f32x4_add(a, b); 2350f3b769e8SThomas Lively } 2351f3b769e8SThomas Lively 2352f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_sub( 2353f3b769e8SThomas Lively // CHECK-NEXT: entry: 2354f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 2355f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 2356f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = fsub <4 x float> [[TMP0]], [[TMP1]] 2357f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[SUB_I]] to <4 x i32> 2358f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2359f3b769e8SThomas Lively // 2360f3b769e8SThomas Lively v128_t test_f32x4_sub(v128_t a, v128_t b) { 2361f3b769e8SThomas Lively return wasm_f32x4_sub(a, b); 2362f3b769e8SThomas Lively } 2363f3b769e8SThomas Lively 2364f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_mul( 2365f3b769e8SThomas Lively // CHECK-NEXT: entry: 2366f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 2367f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 2368f3b769e8SThomas Lively // CHECK-NEXT: [[MUL_I:%.*]] = fmul <4 x float> [[TMP0]], [[TMP1]] 2369f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[MUL_I]] to <4 x i32> 2370f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2371f3b769e8SThomas Lively // 2372f3b769e8SThomas Lively v128_t test_f32x4_mul(v128_t a, v128_t b) { 2373f3b769e8SThomas Lively return wasm_f32x4_mul(a, b); 2374f3b769e8SThomas Lively } 2375f3b769e8SThomas Lively 2376f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_div( 2377f3b769e8SThomas Lively // CHECK-NEXT: entry: 2378f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 2379f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 2380f3b769e8SThomas Lively // CHECK-NEXT: [[DIV_I:%.*]] = fdiv <4 x float> [[TMP0]], [[TMP1]] 2381f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[DIV_I]] to <4 x i32> 2382f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2383f3b769e8SThomas Lively // 2384f3b769e8SThomas Lively v128_t test_f32x4_div(v128_t a, v128_t b) { 2385f3b769e8SThomas Lively return wasm_f32x4_div(a, b); 2386f3b769e8SThomas Lively } 2387f3b769e8SThomas Lively 2388f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_min( 2389f3b769e8SThomas Lively // CHECK-NEXT: entry: 2390f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 2391f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 23921ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.minimum.v4f32(<4 x float> [[TMP0]], <4 x float> [[TMP1]]) 2393f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32> 2394f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2395f3b769e8SThomas Lively // 2396f3b769e8SThomas Lively v128_t test_f32x4_min(v128_t a, v128_t b) { 2397f3b769e8SThomas Lively return wasm_f32x4_min(a, b); 2398f3b769e8SThomas Lively } 2399f3b769e8SThomas Lively 2400f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_max( 2401f3b769e8SThomas Lively // CHECK-NEXT: entry: 2402f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 2403f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 24041ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.maximum.v4f32(<4 x float> [[TMP0]], <4 x float> [[TMP1]]) 2405f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32> 2406f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2407f3b769e8SThomas Lively // 2408f3b769e8SThomas Lively v128_t test_f32x4_max(v128_t a, v128_t b) { 2409f3b769e8SThomas Lively return wasm_f32x4_max(a, b); 2410f3b769e8SThomas Lively } 2411f3b769e8SThomas Lively 2412f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_pmin( 2413f3b769e8SThomas Lively // CHECK-NEXT: entry: 241488962ceaSThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 241588962ceaSThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 24161ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.wasm.pmin.v4f32(<4 x float> [[TMP0]], <4 x float> [[TMP1]]) 241788962ceaSThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32> 241888962ceaSThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2419f3b769e8SThomas Lively // 2420f3b769e8SThomas Lively v128_t test_f32x4_pmin(v128_t a, v128_t b) { 2421f3b769e8SThomas Lively return wasm_f32x4_pmin(a, b); 2422f3b769e8SThomas Lively } 2423f3b769e8SThomas Lively 2424f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_pmax( 2425f3b769e8SThomas Lively // CHECK-NEXT: entry: 2426f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 2427f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <4 x float> 24281ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.wasm.pmax.v4f32(<4 x float> [[TMP0]], <4 x float> [[TMP1]]) 242988962ceaSThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32> 243088962ceaSThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2431f3b769e8SThomas Lively // 2432f3b769e8SThomas Lively v128_t test_f32x4_pmax(v128_t a, v128_t b) { 2433f3b769e8SThomas Lively return wasm_f32x4_pmax(a, b); 2434f3b769e8SThomas Lively } 2435f3b769e8SThomas Lively 2436f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_abs( 2437f3b769e8SThomas Lively // CHECK-NEXT: entry: 2438f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 24391ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> [[TMP0]]) 2440f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32> 2441f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2442f3b769e8SThomas Lively // 2443f3b769e8SThomas Lively v128_t test_f64x2_abs(v128_t a) { 2444f3b769e8SThomas Lively return wasm_f64x2_abs(a); 2445f3b769e8SThomas Lively } 2446f3b769e8SThomas Lively 2447f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_neg( 2448f3b769e8SThomas Lively // CHECK-NEXT: entry: 2449f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 2450f3b769e8SThomas Lively // CHECK-NEXT: [[FNEG_I:%.*]] = fneg <2 x double> [[TMP0]] 2451f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x double> [[FNEG_I]] to <4 x i32> 2452f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2453f3b769e8SThomas Lively // 2454f3b769e8SThomas Lively v128_t test_f64x2_neg(v128_t a) { 2455f3b769e8SThomas Lively return wasm_f64x2_neg(a); 2456f3b769e8SThomas Lively } 2457f3b769e8SThomas Lively 2458f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_sqrt( 2459f3b769e8SThomas Lively // CHECK-NEXT: entry: 2460f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 24611ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> [[TMP0]]) 2462f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32> 2463f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2464f3b769e8SThomas Lively // 2465f3b769e8SThomas Lively v128_t test_f64x2_sqrt(v128_t a) { 2466f3b769e8SThomas Lively return wasm_f64x2_sqrt(a); 2467f3b769e8SThomas Lively } 2468f3b769e8SThomas Lively 2469f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_ceil( 2470f3b769e8SThomas Lively // CHECK-NEXT: entry: 2471f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 24721ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.ceil.v2f64(<2 x double> [[TMP0]]) 2473f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32> 2474f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2475f3b769e8SThomas Lively // 2476f3b769e8SThomas Lively v128_t test_f64x2_ceil(v128_t a) { 2477f3b769e8SThomas Lively return wasm_f64x2_ceil(a); 2478f3b769e8SThomas Lively } 2479f3b769e8SThomas Lively 2480f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_floor( 2481f3b769e8SThomas Lively // CHECK-NEXT: entry: 2482f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 24831ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.floor.v2f64(<2 x double> [[TMP0]]) 2484f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32> 2485f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2486f3b769e8SThomas Lively // 2487f3b769e8SThomas Lively v128_t test_f64x2_floor(v128_t a) { 2488f3b769e8SThomas Lively return wasm_f64x2_floor(a); 2489f3b769e8SThomas Lively } 2490f3b769e8SThomas Lively 2491f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_trunc( 2492f3b769e8SThomas Lively // CHECK-NEXT: entry: 2493f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 24941ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.trunc.v2f64(<2 x double> [[TMP0]]) 2495f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32> 2496f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2497f3b769e8SThomas Lively // 2498f3b769e8SThomas Lively v128_t test_f64x2_trunc(v128_t a) { 2499f3b769e8SThomas Lively return wasm_f64x2_trunc(a); 2500f3b769e8SThomas Lively } 2501f3b769e8SThomas Lively 2502f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_nearest( 2503f3b769e8SThomas Lively // CHECK-NEXT: entry: 2504f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 25051ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.nearbyint.v2f64(<2 x double> [[TMP0]]) 2506f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32> 2507f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2508f3b769e8SThomas Lively // 2509f3b769e8SThomas Lively v128_t test_f64x2_nearest(v128_t a) { 2510f3b769e8SThomas Lively return wasm_f64x2_nearest(a); 2511f3b769e8SThomas Lively } 2512f3b769e8SThomas Lively 2513f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_add( 2514f3b769e8SThomas Lively // CHECK-NEXT: entry: 2515f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 2516f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 2517f3b769e8SThomas Lively // CHECK-NEXT: [[ADD_I:%.*]] = fadd <2 x double> [[TMP0]], [[TMP1]] 2518f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[ADD_I]] to <4 x i32> 2519f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2520f3b769e8SThomas Lively // 2521f3b769e8SThomas Lively v128_t test_f64x2_add(v128_t a, v128_t b) { 2522f3b769e8SThomas Lively return wasm_f64x2_add(a, b); 2523f3b769e8SThomas Lively } 2524f3b769e8SThomas Lively 2525f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_sub( 2526f3b769e8SThomas Lively // CHECK-NEXT: entry: 2527f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 2528f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 2529f3b769e8SThomas Lively // CHECK-NEXT: [[SUB_I:%.*]] = fsub <2 x double> [[TMP0]], [[TMP1]] 2530f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[SUB_I]] to <4 x i32> 2531f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2532f3b769e8SThomas Lively // 2533f3b769e8SThomas Lively v128_t test_f64x2_sub(v128_t a, v128_t b) { 2534f3b769e8SThomas Lively return wasm_f64x2_sub(a, b); 2535f3b769e8SThomas Lively } 2536f3b769e8SThomas Lively 2537f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_mul( 2538f3b769e8SThomas Lively // CHECK-NEXT: entry: 2539f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 2540f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 2541f3b769e8SThomas Lively // CHECK-NEXT: [[MUL_I:%.*]] = fmul <2 x double> [[TMP0]], [[TMP1]] 2542f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[MUL_I]] to <4 x i32> 2543f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2544f3b769e8SThomas Lively // 2545f3b769e8SThomas Lively v128_t test_f64x2_mul(v128_t a, v128_t b) { 2546f3b769e8SThomas Lively return wasm_f64x2_mul(a, b); 2547f3b769e8SThomas Lively } 2548f3b769e8SThomas Lively 2549f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_div( 2550f3b769e8SThomas Lively // CHECK-NEXT: entry: 2551f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 2552f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 2553f3b769e8SThomas Lively // CHECK-NEXT: [[DIV_I:%.*]] = fdiv <2 x double> [[TMP0]], [[TMP1]] 2554f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[DIV_I]] to <4 x i32> 2555f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2556f3b769e8SThomas Lively // 2557f3b769e8SThomas Lively v128_t test_f64x2_div(v128_t a, v128_t b) { 2558f3b769e8SThomas Lively return wasm_f64x2_div(a, b); 2559f3b769e8SThomas Lively } 2560f3b769e8SThomas Lively 2561f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_min( 2562f3b769e8SThomas Lively // CHECK-NEXT: entry: 2563f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 2564f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 25651ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <2 x double> @llvm.minimum.v2f64(<2 x double> [[TMP0]], <2 x double> [[TMP1]]) 2566f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <4 x i32> 2567f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2568f3b769e8SThomas Lively // 2569f3b769e8SThomas Lively v128_t test_f64x2_min(v128_t a, v128_t b) { 2570f3b769e8SThomas Lively return wasm_f64x2_min(a, b); 2571f3b769e8SThomas Lively } 2572f3b769e8SThomas Lively 2573f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_max( 2574f3b769e8SThomas Lively // CHECK-NEXT: entry: 2575f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 2576f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 25771ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <2 x double> @llvm.maximum.v2f64(<2 x double> [[TMP0]], <2 x double> [[TMP1]]) 2578f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <4 x i32> 2579f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2580f3b769e8SThomas Lively // 2581f3b769e8SThomas Lively v128_t test_f64x2_max(v128_t a, v128_t b) { 2582f3b769e8SThomas Lively return wasm_f64x2_max(a, b); 2583f3b769e8SThomas Lively } 2584f3b769e8SThomas Lively 2585f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_pmin( 2586f3b769e8SThomas Lively // CHECK-NEXT: entry: 258788962ceaSThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 258888962ceaSThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 25891ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <2 x double> @llvm.wasm.pmin.v2f64(<2 x double> [[TMP0]], <2 x double> [[TMP1]]) 2590f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <4 x i32> 2591f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2592f3b769e8SThomas Lively // 2593f3b769e8SThomas Lively v128_t test_f64x2_pmin(v128_t a, v128_t b) { 2594f3b769e8SThomas Lively return wasm_f64x2_pmin(a, b); 2595f3b769e8SThomas Lively } 2596f3b769e8SThomas Lively 2597f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_pmax( 2598f3b769e8SThomas Lively // CHECK-NEXT: entry: 2599f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 2600f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <2 x double> 26011ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <2 x double> @llvm.wasm.pmax.v2f64(<2 x double> [[TMP0]], <2 x double> [[TMP1]]) 2602f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <4 x i32> 2603f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2604f3b769e8SThomas Lively // 2605f3b769e8SThomas Lively v128_t test_f64x2_pmax(v128_t a, v128_t b) { 2606f3b769e8SThomas Lively return wasm_f64x2_pmax(a, b); 2607f3b769e8SThomas Lively } 2608f3b769e8SThomas Lively 2609f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_trunc_sat_f32x4( 2610f3b769e8SThomas Lively // CHECK-NEXT: entry: 2611f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 26121ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i32> @llvm.fptosi.sat.v4i32.v4f32(<4 x float> [[TMP0]]) 2613f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2614f3b769e8SThomas Lively // 2615f3b769e8SThomas Lively v128_t test_i32x4_trunc_sat_f32x4(v128_t a) { 2616f3b769e8SThomas Lively return wasm_i32x4_trunc_sat_f32x4(a); 2617f3b769e8SThomas Lively } 2618f3b769e8SThomas Lively 2619f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_trunc_sat_f32x4( 2620f3b769e8SThomas Lively // CHECK-NEXT: entry: 2621f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 26221ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i32> @llvm.fptoui.sat.v4i32.v4f32(<4 x float> [[TMP0]]) 2623f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2624f3b769e8SThomas Lively // 2625f3b769e8SThomas Lively v128_t test_u32x4_trunc_sat_f32x4(v128_t a) { 2626f3b769e8SThomas Lively return wasm_u32x4_trunc_sat_f32x4(a); 2627f3b769e8SThomas Lively } 2628f3b769e8SThomas Lively 2629f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_convert_i32x4( 2630f3b769e8SThomas Lively // CHECK-NEXT: entry: 2631f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sitofp <4 x i32> [[A:%.*]] to <4 x float> 2632f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[CONV_I]] to <4 x i32> 2633f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2634f3b769e8SThomas Lively // 2635f3b769e8SThomas Lively v128_t test_f32x4_convert_i32x4(v128_t a) { 2636f3b769e8SThomas Lively return wasm_f32x4_convert_i32x4(a); 2637f3b769e8SThomas Lively } 2638f3b769e8SThomas Lively 2639f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_convert_u32x4( 2640f3b769e8SThomas Lively // CHECK-NEXT: entry: 2641f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = uitofp <4 x i32> [[A:%.*]] to <4 x float> 2642f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[CONV_I]] to <4 x i32> 2643f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2644f3b769e8SThomas Lively // 2645f3b769e8SThomas Lively v128_t test_f32x4_convert_u32x4(v128_t a) { 2646f3b769e8SThomas Lively return wasm_f32x4_convert_u32x4(a); 2647f3b769e8SThomas Lively } 2648f3b769e8SThomas Lively 2649f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_convert_low_i32x4( 2650f3b769e8SThomas Lively // CHECK-NEXT: entry: 2651a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 0, i32 1> 2652f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sitofp <2 x i32> [[VECINIT2_I]] to <2 x double> 2653f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[CONV_I]] to <4 x i32> 2654f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2655f3b769e8SThomas Lively // 2656f3b769e8SThomas Lively v128_t test_f64x2_convert_low_i32x4(v128_t a) { 2657f3b769e8SThomas Lively return wasm_f64x2_convert_low_i32x4(a); 2658f3b769e8SThomas Lively } 2659f3b769e8SThomas Lively 2660f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_convert_low_u32x4( 2661f3b769e8SThomas Lively // CHECK-NEXT: entry: 2662a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 0, i32 1> 2663f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = uitofp <2 x i32> [[VECINIT2_I]] to <2 x double> 2664f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[CONV_I]] to <4 x i32> 2665f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2666f3b769e8SThomas Lively // 2667f3b769e8SThomas Lively v128_t test_f64x2_convert_low_u32x4(v128_t a) { 2668f3b769e8SThomas Lively return wasm_f64x2_convert_low_u32x4(a); 2669f3b769e8SThomas Lively } 2670f3b769e8SThomas Lively 2671f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_trunc_sat_f64x2_zero( 2672f3b769e8SThomas Lively // CHECK-NEXT: entry: 2673f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 26741ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i32> @llvm.fptosi.sat.v2i32.v2f64(<2 x double> [[TMP0]]) 2675f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i32> [[TMP1]], <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 2676f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2677f3b769e8SThomas Lively // 2678f3b769e8SThomas Lively v128_t test_i32x4_trunc_sat_f64x2_zero(v128_t a) { 2679f3b769e8SThomas Lively return wasm_i32x4_trunc_sat_f64x2_zero(a); 2680f3b769e8SThomas Lively } 2681f3b769e8SThomas Lively 2682f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_trunc_sat_f64x2_zero( 2683f3b769e8SThomas Lively // CHECK-NEXT: entry: 2684f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 26851ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i32> @llvm.fptoui.sat.v2i32.v2f64(<2 x double> [[TMP0]]) 2686f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i32> [[TMP1]], <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 2687f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2688f3b769e8SThomas Lively // 2689f3b769e8SThomas Lively v128_t test_u32x4_trunc_sat_f64x2_zero(v128_t a) { 2690f3b769e8SThomas Lively return wasm_u32x4_trunc_sat_f64x2_zero(a); 2691f3b769e8SThomas Lively } 2692f3b769e8SThomas Lively 2693f3b769e8SThomas Lively // CHECK-LABEL: @test_f32x4_demote_f64x2_zero( 2694f3b769e8SThomas Lively // CHECK-NEXT: entry: 2695f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <2 x double> 2696cbabfc63SThomas Lively // CHECK-NEXT: [[SHUFFLE_I:%.*]] = shufflevector <2 x double> [[TMP0]], <2 x double> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 2697cbabfc63SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = fptrunc <4 x double> [[SHUFFLE_I]] to <4 x float> 2698cbabfc63SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[CONV_I]] to <4 x i32> 2699cbabfc63SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2700f3b769e8SThomas Lively // 2701f3b769e8SThomas Lively v128_t test_f32x4_demote_f64x2_zero(v128_t a) { 2702f3b769e8SThomas Lively return wasm_f32x4_demote_f64x2_zero(a); 2703f3b769e8SThomas Lively } 2704f3b769e8SThomas Lively 2705f3b769e8SThomas Lively // CHECK-LABEL: @test_f64x2_promote_low_f32x4( 2706f3b769e8SThomas Lively // CHECK-NEXT: entry: 2707f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <4 x float> 2708a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x float> [[TMP0]], <4 x float> poison, <2 x i32> <i32 0, i32 1> 2709e5220104SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = fpext <2 x float> [[VECINIT2_I]] to <2 x double> 2710e5220104SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x double> [[CONV_I]] to <4 x i32> 2711e5220104SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2712f3b769e8SThomas Lively // 2713f3b769e8SThomas Lively v128_t test_f64x2_promote_low_f32x4(v128_t a) { 2714f3b769e8SThomas Lively return wasm_f64x2_promote_low_f32x4(a); 2715f3b769e8SThomas Lively } 2716f3b769e8SThomas Lively 2717f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_shuffle( 2718f3b769e8SThomas Lively // CHECK-NEXT: entry: 2719f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 2720f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 2721f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.shuffle(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]], i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0) 2722f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 2723f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2724f3b769e8SThomas Lively // 2725f3b769e8SThomas Lively v128_t test_i8x16_shuffle(v128_t a, v128_t b) { 2726f3b769e8SThomas Lively return wasm_i8x16_shuffle(a, b, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); 2727f3b769e8SThomas Lively } 2728f3b769e8SThomas Lively 2729f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_shuffle( 2730f3b769e8SThomas Lively // CHECK-NEXT: entry: 2731f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 2732f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 2733f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.shuffle(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]], i32 14, i32 15, i32 12, i32 13, i32 10, i32 11, i32 8, i32 9, i32 6, i32 7, i32 4, i32 5, i32 2, i32 3, i32 0, i32 1) 2734f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 2735f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2736f3b769e8SThomas Lively // 2737f3b769e8SThomas Lively v128_t test_i16x8_shuffle(v128_t a, v128_t b) { 2738f3b769e8SThomas Lively return wasm_i16x8_shuffle(a, b, 7, 6, 5, 4, 3, 2, 1, 0); 2739f3b769e8SThomas Lively } 2740f3b769e8SThomas Lively 2741f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_shuffle( 2742f3b769e8SThomas Lively // CHECK-NEXT: entry: 2743f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 2744f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 2745f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.shuffle(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]], i32 12, i32 13, i32 14, i32 15, i32 8, i32 9, i32 10, i32 11, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3) 2746f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 2747f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2748f3b769e8SThomas Lively // 2749f3b769e8SThomas Lively v128_t test_i32x4_shuffle(v128_t a, v128_t b) { 2750f3b769e8SThomas Lively return wasm_i32x4_shuffle(a, b, 3, 2, 1, 0); 2751f3b769e8SThomas Lively } 2752f3b769e8SThomas Lively 2753f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_shuffle( 2754f3b769e8SThomas Lively // CHECK-NEXT: entry: 2755f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 2756f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 2757f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.shuffle(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]], i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7) 2758f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 2759f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2760f3b769e8SThomas Lively // 2761f3b769e8SThomas Lively v128_t test_i64x2_shuffle(v128_t a, v128_t b) { 2762f3b769e8SThomas Lively return wasm_i64x2_shuffle(a, b, 1, 0); 2763f3b769e8SThomas Lively } 2764f3b769e8SThomas Lively 2765f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_swizzle( 2766f3b769e8SThomas Lively // CHECK-NEXT: entry: 2767f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 2768f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 27691ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.swizzle(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]]) 2770f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 2771f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2772f3b769e8SThomas Lively // 2773f3b769e8SThomas Lively v128_t test_i8x16_swizzle(v128_t a, v128_t b) { 2774f3b769e8SThomas Lively return wasm_i8x16_swizzle(a, b); 2775f3b769e8SThomas Lively } 2776f3b769e8SThomas Lively 2777f3b769e8SThomas Lively // CHECK-LABEL: @test_i8x16_narrow_i16x8( 2778f3b769e8SThomas Lively // CHECK-NEXT: entry: 2779f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 2780f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 27811ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.narrow.signed.v16i8.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 2782f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 2783f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2784f3b769e8SThomas Lively // 2785f3b769e8SThomas Lively v128_t test_i8x16_narrow_i16x8(v128_t a, v128_t b) { 2786f3b769e8SThomas Lively return wasm_i8x16_narrow_i16x8(a, b); 2787f3b769e8SThomas Lively } 2788f3b769e8SThomas Lively 2789f3b769e8SThomas Lively // CHECK-LABEL: @test_u8x16_narrow_i16x8( 2790f3b769e8SThomas Lively // CHECK-NEXT: entry: 2791f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 2792f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 27931ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.narrow.unsigned.v16i8.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 2794f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> 2795f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 2796f3b769e8SThomas Lively // 2797f3b769e8SThomas Lively v128_t test_u8x16_narrow_i16x8(v128_t a, v128_t b) { 2798f3b769e8SThomas Lively return wasm_u8x16_narrow_i16x8(a, b); 2799f3b769e8SThomas Lively } 2800f3b769e8SThomas Lively 2801f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_narrow_i32x4( 2802f3b769e8SThomas Lively // CHECK-NEXT: entry: 28033391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP0:%.*]] = tail call <8 x i16> @llvm.wasm.narrow.signed.v8i16.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]]) 2804f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <4 x i32> 2805f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2806f3b769e8SThomas Lively // 2807f3b769e8SThomas Lively v128_t test_i16x8_narrow_i32x4(v128_t a, v128_t b) { 2808f3b769e8SThomas Lively return wasm_i16x8_narrow_i32x4(a, b); 2809f3b769e8SThomas Lively } 2810f3b769e8SThomas Lively 2811f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_narrow_i32x4( 2812f3b769e8SThomas Lively // CHECK-NEXT: entry: 28133391bdc2SNoah Goldstein // CHECK-NEXT: [[TMP0:%.*]] = tail call <8 x i16> @llvm.wasm.narrow.unsigned.v8i16.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]]) 2814f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <4 x i32> 2815f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2816f3b769e8SThomas Lively // 2817f3b769e8SThomas Lively v128_t test_u16x8_narrow_i32x4(v128_t a, v128_t b) { 2818f3b769e8SThomas Lively return wasm_u16x8_narrow_i32x4(a, b); 2819f3b769e8SThomas Lively } 2820f3b769e8SThomas Lively 2821f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_extend_low_i8x16( 2822f3b769e8SThomas Lively // CHECK-NEXT: entry: 2823f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 2824a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I:%.*]] = shufflevector <16 x i8> [[TMP0]], <16 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> 2825f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sext <8 x i8> [[VECINIT14_I]] to <8 x i16> 2826f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32> 2827f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2828f3b769e8SThomas Lively // 2829f3b769e8SThomas Lively v128_t test_i16x8_extend_low_i8x16(v128_t a) { 2830f3b769e8SThomas Lively return wasm_i16x8_extend_low_i8x16(a); 2831f3b769e8SThomas Lively } 2832f3b769e8SThomas Lively 2833f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_extend_high_i8x16( 2834f3b769e8SThomas Lively // CHECK-NEXT: entry: 2835f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 2836a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I:%.*]] = shufflevector <16 x i8> [[TMP0]], <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> 2837f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sext <8 x i8> [[VECINIT14_I]] to <8 x i16> 2838f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32> 2839f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2840f3b769e8SThomas Lively // 2841f3b769e8SThomas Lively v128_t test_i16x8_extend_high_i8x16(v128_t a) { 2842f3b769e8SThomas Lively return wasm_i16x8_extend_high_i8x16(a); 2843f3b769e8SThomas Lively } 2844f3b769e8SThomas Lively 2845f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_extend_low_u8x16( 2846f3b769e8SThomas Lively // CHECK-NEXT: entry: 2847f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 2848a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I:%.*]] = shufflevector <16 x i8> [[TMP0]], <16 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> 2849f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = zext <8 x i8> [[VECINIT14_I]] to <8 x i16> 2850f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32> 2851f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2852f3b769e8SThomas Lively // 2853f3b769e8SThomas Lively v128_t test_u16x8_extend_low_u8x16(v128_t a) { 2854f3b769e8SThomas Lively return wasm_u16x8_extend_low_u8x16(a); 2855f3b769e8SThomas Lively } 2856f3b769e8SThomas Lively 2857f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_extend_high_u8x16( 2858f3b769e8SThomas Lively // CHECK-NEXT: entry: 2859f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 2860a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I:%.*]] = shufflevector <16 x i8> [[TMP0]], <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> 2861f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = zext <8 x i8> [[VECINIT14_I]] to <8 x i16> 2862f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32> 2863f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2864f3b769e8SThomas Lively // 2865f3b769e8SThomas Lively v128_t test_u16x8_extend_high_u8x16(v128_t a) { 2866f3b769e8SThomas Lively return wasm_u16x8_extend_high_u8x16(a); 2867f3b769e8SThomas Lively } 2868f3b769e8SThomas Lively 2869f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_extend_low_i16x8( 2870f3b769e8SThomas Lively // CHECK-NEXT: entry: 2871f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 2872a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 2873f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sext <4 x i16> [[VECINIT6_I]] to <4 x i32> 2874f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[CONV_I]] 2875f3b769e8SThomas Lively // 2876f3b769e8SThomas Lively v128_t test_i32x4_extend_low_i16x8(v128_t a) { 2877f3b769e8SThomas Lively return wasm_i32x4_extend_low_i16x8(a); 2878f3b769e8SThomas Lively } 2879f3b769e8SThomas Lively 2880f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_extend_high_i16x8( 2881f3b769e8SThomas Lively // CHECK-NEXT: entry: 2882f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 2883a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> 2884f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sext <4 x i16> [[VECINIT6_I]] to <4 x i32> 2885f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[CONV_I]] 2886f3b769e8SThomas Lively // 2887f3b769e8SThomas Lively v128_t test_i32x4_extend_high_i16x8(v128_t a) { 2888f3b769e8SThomas Lively return wasm_i32x4_extend_high_i16x8(a); 2889f3b769e8SThomas Lively } 2890f3b769e8SThomas Lively 2891f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_extend_low_u16x8( 2892f3b769e8SThomas Lively // CHECK-NEXT: entry: 2893f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 2894a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 2895f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = zext <4 x i16> [[VECINIT6_I]] to <4 x i32> 2896f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[CONV_I]] 2897f3b769e8SThomas Lively // 2898f3b769e8SThomas Lively v128_t test_u32x4_extend_low_u16x8(v128_t a) { 2899f3b769e8SThomas Lively return wasm_u32x4_extend_low_u16x8(a); 2900f3b769e8SThomas Lively } 2901f3b769e8SThomas Lively 2902f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_extend_high_u16x8( 2903f3b769e8SThomas Lively // CHECK-NEXT: entry: 2904f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 2905a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> 2906f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = zext <4 x i16> [[VECINIT6_I]] to <4 x i32> 2907f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[CONV_I]] 2908f3b769e8SThomas Lively // 2909f3b769e8SThomas Lively v128_t test_u32x4_extend_high_u16x8(v128_t a) { 2910f3b769e8SThomas Lively return wasm_u32x4_extend_high_u16x8(a); 2911f3b769e8SThomas Lively } 2912f3b769e8SThomas Lively 2913f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_extend_low_i32x4( 2914f3b769e8SThomas Lively // CHECK-NEXT: entry: 2915a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 0, i32 1> 2916f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sext <2 x i32> [[VECINIT2_I]] to <2 x i64> 2917f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32> 2918f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2919f3b769e8SThomas Lively // 2920f3b769e8SThomas Lively v128_t test_i64x2_extend_low_i32x4(v128_t a) { 2921f3b769e8SThomas Lively return wasm_i64x2_extend_low_i32x4(a); 2922f3b769e8SThomas Lively } 2923f3b769e8SThomas Lively 2924f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_extend_high_i32x4( 2925f3b769e8SThomas Lively // CHECK-NEXT: entry: 2926a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 2, i32 3> 2927f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = sext <2 x i32> [[VECINIT2_I]] to <2 x i64> 2928f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32> 2929f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2930f3b769e8SThomas Lively // 2931f3b769e8SThomas Lively v128_t test_i64x2_extend_high_i32x4(v128_t a) { 2932f3b769e8SThomas Lively return wasm_i64x2_extend_high_i32x4(a); 2933f3b769e8SThomas Lively } 2934f3b769e8SThomas Lively 2935f3b769e8SThomas Lively // CHECK-LABEL: @test_u64x2_extend_low_u32x4( 2936f3b769e8SThomas Lively // CHECK-NEXT: entry: 2937a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 0, i32 1> 2938f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = zext <2 x i32> [[VECINIT2_I]] to <2 x i64> 2939f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32> 2940f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2941f3b769e8SThomas Lively // 2942f3b769e8SThomas Lively v128_t test_u64x2_extend_low_u32x4(v128_t a) { 2943f3b769e8SThomas Lively return wasm_u64x2_extend_low_u32x4(a); 2944f3b769e8SThomas Lively } 2945f3b769e8SThomas Lively 2946f3b769e8SThomas Lively // CHECK-LABEL: @test_u64x2_extend_high_u32x4( 2947f3b769e8SThomas Lively // CHECK-NEXT: entry: 2948a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 2, i32 3> 2949f3b769e8SThomas Lively // CHECK-NEXT: [[CONV_I:%.*]] = zext <2 x i32> [[VECINIT2_I]] to <2 x i64> 2950f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32> 2951f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 2952f3b769e8SThomas Lively // 2953f3b769e8SThomas Lively v128_t test_u64x2_extend_high_u32x4(v128_t a) { 2954f3b769e8SThomas Lively return wasm_u64x2_extend_high_u32x4(a); 2955f3b769e8SThomas Lively } 2956f3b769e8SThomas Lively 2957f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_extadd_pairwise_i8x16( 2958f3b769e8SThomas Lively // CHECK-NEXT: entry: 2959f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 29601ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i16> @llvm.wasm.extadd.pairwise.signed.v8i16(<16 x i8> [[TMP0]]) 2961f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[TMP1]] to <4 x i32> 2962f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2963f3b769e8SThomas Lively // 2964f3b769e8SThomas Lively v128_t test_i16x8_extadd_pairwise_i8x16(v128_t a) { 2965f3b769e8SThomas Lively return wasm_i16x8_extadd_pairwise_i8x16(a); 2966f3b769e8SThomas Lively } 2967f3b769e8SThomas Lively 2968f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_extadd_pairwise_u8x16( 2969f3b769e8SThomas Lively // CHECK-NEXT: entry: 2970f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 29711ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i16> @llvm.wasm.extadd.pairwise.unsigned.v8i16(<16 x i8> [[TMP0]]) 2972f3b769e8SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[TMP1]] to <4 x i32> 2973f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 2974f3b769e8SThomas Lively // 2975f3b769e8SThomas Lively v128_t test_u16x8_extadd_pairwise_u8x16(v128_t a) { 2976f3b769e8SThomas Lively return wasm_u16x8_extadd_pairwise_u8x16(a); 2977f3b769e8SThomas Lively } 2978f3b769e8SThomas Lively 2979f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_extadd_pairwise_i16x8( 2980f3b769e8SThomas Lively // CHECK-NEXT: entry: 2981f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 29821ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i32> @llvm.wasm.extadd.pairwise.signed.v4i32(<8 x i16> [[TMP0]]) 2983f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2984f3b769e8SThomas Lively // 2985f3b769e8SThomas Lively v128_t test_i32x4_extadd_pairwise_i16x8(v128_t a) { 2986f3b769e8SThomas Lively return wasm_i32x4_extadd_pairwise_i16x8(a); 2987f3b769e8SThomas Lively } 2988f3b769e8SThomas Lively 2989f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_extadd_pairwise_u16x8( 2990f3b769e8SThomas Lively // CHECK-NEXT: entry: 2991f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 29921ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i32> @llvm.wasm.extadd.pairwise.unsigned.v4i32(<8 x i16> [[TMP0]]) 2993f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP1]] 2994f3b769e8SThomas Lively // 2995f3b769e8SThomas Lively v128_t test_u32x4_extadd_pairwise_u16x8(v128_t a) { 2996f3b769e8SThomas Lively return wasm_u32x4_extadd_pairwise_u16x8(a); 2997f3b769e8SThomas Lively } 2998f3b769e8SThomas Lively 2999f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_extmul_low_i8x16( 3000f3b769e8SThomas Lively // CHECK-NEXT: entry: 3001f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 3002a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I2_I:%.*]] = shufflevector <16 x i8> [[TMP0]], <16 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> 300333786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <8 x i8> [[VECINIT14_I2_I]] to <8 x i16> 3004a5f34155SNikita Popov // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 3005a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I_I:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> 3006a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = sext <8 x i8> [[VECINIT14_I_I]] to <8 x i16> 3007a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <8 x i16> [[CONV_I_I]], [[CONV_I3_I]] 300833786576SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32> 300933786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 3010f3b769e8SThomas Lively // 3011f3b769e8SThomas Lively v128_t test_i16x8_extmul_low_i8x16(v128_t a, v128_t b) { 3012f3b769e8SThomas Lively return wasm_i16x8_extmul_low_i8x16(a, b); 3013f3b769e8SThomas Lively } 3014f3b769e8SThomas Lively 3015f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_extmul_high_i8x16( 3016f3b769e8SThomas Lively // CHECK-NEXT: entry: 3017f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 3018a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I2_I:%.*]] = shufflevector <16 x i8> [[TMP0]], <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> 301933786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <8 x i8> [[VECINIT14_I2_I]] to <8 x i16> 3020a5f34155SNikita Popov // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 3021a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I_I:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> 3022a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = sext <8 x i8> [[VECINIT14_I_I]] to <8 x i16> 3023a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <8 x i16> [[CONV_I_I]], [[CONV_I3_I]] 302433786576SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32> 302533786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 3026f3b769e8SThomas Lively // 3027f3b769e8SThomas Lively v128_t test_i16x8_extmul_high_i8x16(v128_t a, v128_t b) { 3028f3b769e8SThomas Lively return wasm_i16x8_extmul_high_i8x16(a, b); 3029f3b769e8SThomas Lively } 3030f3b769e8SThomas Lively 3031f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_extmul_low_u8x16( 3032f3b769e8SThomas Lively // CHECK-NEXT: entry: 3033f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 3034a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I2_I:%.*]] = shufflevector <16 x i8> [[TMP0]], <16 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> 303533786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <8 x i8> [[VECINIT14_I2_I]] to <8 x i16> 3036a5f34155SNikita Popov // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 3037a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I_I:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> 3038a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = zext <8 x i8> [[VECINIT14_I_I]] to <8 x i16> 3039a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <8 x i16> [[CONV_I_I]], [[CONV_I3_I]] 304033786576SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32> 304133786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 3042f3b769e8SThomas Lively // 3043f3b769e8SThomas Lively v128_t test_u16x8_extmul_low_u8x16(v128_t a, v128_t b) { 3044f3b769e8SThomas Lively return wasm_u16x8_extmul_low_u8x16(a, b); 3045f3b769e8SThomas Lively } 3046f3b769e8SThomas Lively 3047f3b769e8SThomas Lively // CHECK-LABEL: @test_u16x8_extmul_high_u8x16( 3048f3b769e8SThomas Lively // CHECK-NEXT: entry: 3049f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <16 x i8> 3050a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I2_I:%.*]] = shufflevector <16 x i8> [[TMP0]], <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> 305133786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <8 x i8> [[VECINIT14_I2_I]] to <8 x i16> 3052a5f34155SNikita Popov // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <16 x i8> 3053a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT14_I_I:%.*]] = shufflevector <16 x i8> [[TMP1]], <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> 3054a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = zext <8 x i8> [[VECINIT14_I_I]] to <8 x i16> 3055a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <8 x i16> [[CONV_I_I]], [[CONV_I3_I]] 305633786576SThomas Lively // CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32> 305733786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP2]] 3058f3b769e8SThomas Lively // 3059f3b769e8SThomas Lively v128_t test_u16x8_extmul_high_u8x16(v128_t a, v128_t b) { 3060f3b769e8SThomas Lively return wasm_u16x8_extmul_high_u8x16(a, b); 3061f3b769e8SThomas Lively } 3062f3b769e8SThomas Lively 3063f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_extmul_low_i16x8( 3064f3b769e8SThomas Lively // CHECK-NEXT: entry: 3065f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 3066a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I2_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 306733786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <4 x i16> [[VECINIT6_I2_I]] to <4 x i32> 3068a5f34155SNikita Popov // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 3069a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I_I:%.*]] = shufflevector <8 x i16> [[TMP1]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 3070a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = sext <4 x i16> [[VECINIT6_I_I]] to <4 x i32> 3071a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <4 x i32> [[CONV_I_I]], [[CONV_I3_I]] 307233786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[MUL_I]] 3073f3b769e8SThomas Lively // 3074f3b769e8SThomas Lively v128_t test_i32x4_extmul_low_i16x8(v128_t a, v128_t b) { 3075f3b769e8SThomas Lively return wasm_i32x4_extmul_low_i16x8(a, b); 3076f3b769e8SThomas Lively } 3077f3b769e8SThomas Lively 3078f3b769e8SThomas Lively // CHECK-LABEL: @test_i32x4_extmul_high_i16x8( 3079f3b769e8SThomas Lively // CHECK-NEXT: entry: 3080f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 3081a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I2_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> 308233786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <4 x i16> [[VECINIT6_I2_I]] to <4 x i32> 3083a5f34155SNikita Popov // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 3084a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I_I:%.*]] = shufflevector <8 x i16> [[TMP1]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> 3085a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = sext <4 x i16> [[VECINIT6_I_I]] to <4 x i32> 3086a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <4 x i32> [[CONV_I_I]], [[CONV_I3_I]] 308733786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[MUL_I]] 3088f3b769e8SThomas Lively // 3089f3b769e8SThomas Lively v128_t test_i32x4_extmul_high_i16x8(v128_t a, v128_t b) { 3090f3b769e8SThomas Lively return wasm_i32x4_extmul_high_i16x8(a, b); 3091f3b769e8SThomas Lively } 3092f3b769e8SThomas Lively 3093f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_extmul_low_u16x8( 3094f3b769e8SThomas Lively // CHECK-NEXT: entry: 3095f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 3096a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I2_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 309733786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <4 x i16> [[VECINIT6_I2_I]] to <4 x i32> 3098a5f34155SNikita Popov // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 3099a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I_I:%.*]] = shufflevector <8 x i16> [[TMP1]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> 3100a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = zext <4 x i16> [[VECINIT6_I_I]] to <4 x i32> 3101a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <4 x i32> [[CONV_I_I]], [[CONV_I3_I]] 310233786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[MUL_I]] 3103f3b769e8SThomas Lively // 3104f3b769e8SThomas Lively v128_t test_u32x4_extmul_low_u16x8(v128_t a, v128_t b) { 3105f3b769e8SThomas Lively return wasm_u32x4_extmul_low_u16x8(a, b); 3106f3b769e8SThomas Lively } 3107f3b769e8SThomas Lively 3108f3b769e8SThomas Lively // CHECK-LABEL: @test_u32x4_extmul_high_u16x8( 3109f3b769e8SThomas Lively // CHECK-NEXT: entry: 3110f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 3111a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I2_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> 311233786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <4 x i16> [[VECINIT6_I2_I]] to <4 x i32> 3113a5f34155SNikita Popov // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 3114a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT6_I_I:%.*]] = shufflevector <8 x i16> [[TMP1]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> 3115a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = zext <4 x i16> [[VECINIT6_I_I]] to <4 x i32> 3116a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <4 x i32> [[CONV_I_I]], [[CONV_I3_I]] 311733786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[MUL_I]] 3118f3b769e8SThomas Lively // 3119f3b769e8SThomas Lively v128_t test_u32x4_extmul_high_u16x8(v128_t a, v128_t b) { 3120f3b769e8SThomas Lively return wasm_u32x4_extmul_high_u16x8(a, b); 3121f3b769e8SThomas Lively } 3122f3b769e8SThomas Lively 3123f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_extmul_low_i32x4( 3124f3b769e8SThomas Lively // CHECK-NEXT: entry: 3125a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 0, i32 1> 312633786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <2 x i32> [[VECINIT2_I2_I]] to <2 x i64> 3127a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I_I:%.*]] = shufflevector <4 x i32> [[B:%.*]], <4 x i32> poison, <2 x i32> <i32 0, i32 1> 3128a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = sext <2 x i32> [[VECINIT2_I_I]] to <2 x i64> 3129a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <2 x i64> [[CONV_I_I]], [[CONV_I3_I]] 313033786576SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32> 313133786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 3132f3b769e8SThomas Lively // 3133f3b769e8SThomas Lively v128_t test_i64x2_extmul_low_i32x4(v128_t a, v128_t b) { 3134f3b769e8SThomas Lively return wasm_i64x2_extmul_low_i32x4(a, b); 3135f3b769e8SThomas Lively } 3136f3b769e8SThomas Lively 3137f3b769e8SThomas Lively // CHECK-LABEL: @test_i64x2_extmul_high_i32x4( 3138f3b769e8SThomas Lively // CHECK-NEXT: entry: 3139a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 2, i32 3> 314033786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <2 x i32> [[VECINIT2_I2_I]] to <2 x i64> 3141a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I_I:%.*]] = shufflevector <4 x i32> [[B:%.*]], <4 x i32> poison, <2 x i32> <i32 2, i32 3> 3142a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = sext <2 x i32> [[VECINIT2_I_I]] to <2 x i64> 3143a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <2 x i64> [[CONV_I_I]], [[CONV_I3_I]] 314433786576SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32> 314533786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 3146f3b769e8SThomas Lively // 3147f3b769e8SThomas Lively v128_t test_i64x2_extmul_high_i32x4(v128_t a, v128_t b) { 3148f3b769e8SThomas Lively return wasm_i64x2_extmul_high_i32x4(a, b); 3149f3b769e8SThomas Lively } 3150f3b769e8SThomas Lively 3151f3b769e8SThomas Lively // CHECK-LABEL: @test_u64x2_extmul_low_u32x4( 3152f3b769e8SThomas Lively // CHECK-NEXT: entry: 3153a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 0, i32 1> 315433786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <2 x i32> [[VECINIT2_I2_I]] to <2 x i64> 3155a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I_I:%.*]] = shufflevector <4 x i32> [[B:%.*]], <4 x i32> poison, <2 x i32> <i32 0, i32 1> 3156a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = zext <2 x i32> [[VECINIT2_I_I]] to <2 x i64> 3157a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <2 x i64> [[CONV_I_I]], [[CONV_I3_I]] 315833786576SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32> 315933786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 3160f3b769e8SThomas Lively // 3161f3b769e8SThomas Lively v128_t test_u64x2_extmul_low_u32x4(v128_t a, v128_t b) { 3162f3b769e8SThomas Lively return wasm_u64x2_extmul_low_u32x4(a, b); 3163f3b769e8SThomas Lively } 3164f3b769e8SThomas Lively 3165f3b769e8SThomas Lively // CHECK-LABEL: @test_u64x2_extmul_high_u32x4( 3166f3b769e8SThomas Lively // CHECK-NEXT: entry: 3167a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I2_I:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> poison, <2 x i32> <i32 2, i32 3> 316833786576SThomas Lively // CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <2 x i32> [[VECINIT2_I2_I]] to <2 x i64> 3169a5f34155SNikita Popov // CHECK-NEXT: [[VECINIT2_I_I:%.*]] = shufflevector <4 x i32> [[B:%.*]], <4 x i32> poison, <2 x i32> <i32 2, i32 3> 3170a5f34155SNikita Popov // CHECK-NEXT: [[CONV_I_I:%.*]] = zext <2 x i32> [[VECINIT2_I_I]] to <2 x i64> 3171a5f34155SNikita Popov // CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <2 x i64> [[CONV_I_I]], [[CONV_I3_I]] 317233786576SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32> 317333786576SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP0]] 3174f3b769e8SThomas Lively // 3175f3b769e8SThomas Lively v128_t test_u64x2_extmul_high_u32x4(v128_t a, v128_t b) { 3176f3b769e8SThomas Lively return wasm_u64x2_extmul_high_u32x4(a, b); 3177f3b769e8SThomas Lively } 3178f3b769e8SThomas Lively 3179f3b769e8SThomas Lively // CHECK-LABEL: @test_i16x8_q15mulr_sat( 3180f3b769e8SThomas Lively // CHECK-NEXT: entry: 3181f3b769e8SThomas Lively // CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A:%.*]] to <8 x i16> 3182f3b769e8SThomas Lively // CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B:%.*]] to <8 x i16> 31831ddc51d8SNicolai Hähnle // CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.wasm.q15mulr.sat.signed(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]]) 3184f3b769e8SThomas Lively // CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32> 3185f3b769e8SThomas Lively // CHECK-NEXT: ret <4 x i32> [[TMP3]] 3186f3b769e8SThomas Lively // 3187f3b769e8SThomas Lively v128_t test_i16x8_q15mulr_sat(v128_t a, v128_t b) { 3188f3b769e8SThomas Lively return wasm_i16x8_q15mulr_sat(a, b); 3189f3b769e8SThomas Lively } 3190