3473 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 62// REQUIRES: webassembly-registered-target, asserts3 4// FIXME: This should not be using -O2 and implicitly testing the entire IR opt pipeline.5 6// RUN: %clang %s -O2 -emit-llvm -S -o - -target wasm32-unknown-unknown -msimd128 -Wall -Weverything -Wno-missing-prototypes -fno-lax-vector-conversions -Werror | FileCheck %s7 8#include <wasm_simd128.h>9 10// CHECK-LABEL: define hidden <4 x i32> @test_v128_load(11// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {12// CHECK-NEXT: [[ENTRY:.*:]]13// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6:![0-9]+]]14// CHECK-NEXT: ret <4 x i32> [[TMP0]]15//16v128_t test_v128_load(const void *mem) {17 return wasm_v128_load(mem);18}19 20// CHECK-LABEL: define hidden <4 x i32> @test_v128_load8_splat(21// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {22// CHECK-NEXT: [[ENTRY:.*:]]23// CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]24// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[TMP0]], i64 025// CHECK-NEXT: [[VECINIT16_I:%.*]] = shufflevector <16 x i8> [[VECINIT_I]], <16 x i8> poison, <16 x i32> zeroinitializer26// CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[VECINIT16_I]] to <4 x i32>27// CHECK-NEXT: ret <4 x i32> [[TMP1]]28//29v128_t test_v128_load8_splat(const void *mem) {30 return wasm_v128_load8_splat(mem);31}32 33// CHECK-LABEL: define hidden <4 x i32> @test_v128_load16_splat(34// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {35// CHECK-NEXT: [[ENTRY:.*:]]36// CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]37// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[TMP0]], i64 038// CHECK-NEXT: [[VECINIT8_I:%.*]] = shufflevector <8 x i16> [[VECINIT_I]], <8 x i16> poison, <8 x i32> zeroinitializer39// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINIT8_I]] to <4 x i32>40// CHECK-NEXT: ret <4 x i32> [[TMP1]]41//42v128_t test_v128_load16_splat(const void *mem) {43 return wasm_v128_load16_splat(mem);44}45 46// CHECK-LABEL: define hidden <4 x i32> @test_v128_load32_splat(47// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {48// CHECK-NEXT: [[ENTRY:.*:]]49// CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]50// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[TMP0]], i64 051// CHECK-NEXT: [[VECINIT4_I:%.*]] = shufflevector <4 x i32> [[VECINIT_I]], <4 x i32> poison, <4 x i32> zeroinitializer52// CHECK-NEXT: ret <4 x i32> [[VECINIT4_I]]53//54v128_t test_v128_load32_splat(const void *mem) {55 return wasm_v128_load32_splat(mem);56}57 58// CHECK-LABEL: define hidden <4 x i32> @test_v128_load64_splat(59// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {60// CHECK-NEXT: [[ENTRY:.*:]]61// CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]62// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[TMP0]], i64 063// CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <2 x i64> [[VECINIT_I]], <2 x i64> poison, <2 x i32> zeroinitializer64// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[VECINIT2_I]] to <4 x i32>65// CHECK-NEXT: ret <4 x i32> [[TMP1]]66//67v128_t test_v128_load64_splat(const void *mem) {68 return wasm_v128_load64_splat(mem);69}70 71// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_load8x8(72// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {73// CHECK-NEXT: [[ENTRY:.*:]]74// CHECK-NEXT: [[TMP0:%.*]] = load <8 x i8>, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]75// CHECK-NEXT: [[CONV_I:%.*]] = sext <8 x i8> [[TMP0]] to <8 x i16>76// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32>77// CHECK-NEXT: ret <4 x i32> [[TMP1]]78//79v128_t test_i16x8_load8x8(const void *mem) {80 return wasm_i16x8_load8x8(mem);81}82 83// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_load8x8(84// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {85// CHECK-NEXT: [[ENTRY:.*:]]86// CHECK-NEXT: [[TMP0:%.*]] = load <8 x i8>, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]87// CHECK-NEXT: [[CONV_I:%.*]] = zext <8 x i8> [[TMP0]] to <8 x i16>88// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32>89// CHECK-NEXT: ret <4 x i32> [[TMP1]]90//91v128_t test_u16x8_load8x8(const void *mem) {92 return wasm_u16x8_load8x8(mem);93}94 95// CHECK-LABEL: define hidden range(i32 -32768, 32768) <4 x i32> @test_i32x4_load16x4(96// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {97// CHECK-NEXT: [[ENTRY:.*:]]98// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i16>, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]99// CHECK-NEXT: [[CONV_I:%.*]] = sext <4 x i16> [[TMP0]] to <4 x i32>100// CHECK-NEXT: ret <4 x i32> [[CONV_I]]101//102v128_t test_i32x4_load16x4(const void *mem) {103 return wasm_i32x4_load16x4(mem);104}105 106// CHECK-LABEL: define hidden range(i32 0, 65536) <4 x i32> @test_u32x4_load16x4(107// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {108// CHECK-NEXT: [[ENTRY:.*:]]109// CHECK-NEXT: [[TMP0:%.*]] = load <4 x i16>, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]110// CHECK-NEXT: [[CONV_I:%.*]] = zext <4 x i16> [[TMP0]] to <4 x i32>111// CHECK-NEXT: ret <4 x i32> [[CONV_I]]112//113v128_t test_u32x4_load16x4(const void *mem) {114 return wasm_u32x4_load16x4(mem);115}116 117// CHECK-LABEL: define hidden <4 x i32> @test_i64x2_load32x2(118// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {119// CHECK-NEXT: [[ENTRY:.*:]]120// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]121// CHECK-NEXT: [[CONV_I:%.*]] = sext <2 x i32> [[TMP0]] to <2 x i64>122// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32>123// CHECK-NEXT: ret <4 x i32> [[TMP1]]124//125v128_t test_i64x2_load32x2(const void *mem) {126 return wasm_i64x2_load32x2(mem);127}128 129// CHECK-LABEL: define hidden <4 x i32> @test_u64x2_load32x2(130// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {131// CHECK-NEXT: [[ENTRY:.*:]]132// CHECK-NEXT: [[TMP0:%.*]] = load <2 x i32>, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]133// CHECK-NEXT: [[CONV_I:%.*]] = zext <2 x i32> [[TMP0]] to <2 x i64>134// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32>135// CHECK-NEXT: ret <4 x i32> [[TMP1]]136//137v128_t test_u64x2_load32x2(const void *mem) {138 return wasm_u64x2_load32x2(mem);139}140 141// CHECK-LABEL: define hidden <4 x i32> @test_v128_load32_zero(142// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {143// CHECK-NEXT: [[ENTRY:.*:]]144// CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]145// CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 [[TMP0]], i64 0146// CHECK-NEXT: ret <4 x i32> [[VECINIT4_I]]147//148v128_t test_v128_load32_zero(const void *mem) {149 return wasm_v128_load32_zero(mem);150}151 152// CHECK-LABEL: define hidden <4 x i32> @test_v128_load64_zero(153// CHECK-SAME: ptr noundef readonly captures(none) [[MEM:%.*]]) local_unnamed_addr #[[ATTR0]] {154// CHECK-NEXT: [[ENTRY:.*:]]155// CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]156// CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <2 x i64> <i64 poison, i64 0>, i64 [[TMP0]], i64 0157// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[VECINIT2_I]] to <4 x i32>158// CHECK-NEXT: ret <4 x i32> [[TMP1]]159//160v128_t test_v128_load64_zero(const void *mem) {161 return wasm_v128_load64_zero(mem);162}163 164// CHECK-LABEL: define hidden <4 x i32> @test_v128_load8_lane(165// CHECK-SAME: ptr noundef readonly captures(none) [[PTR:%.*]], <4 x i32> noundef [[VEC:%.*]]) local_unnamed_addr #[[ATTR0]] {166// CHECK-NEXT: [[ENTRY:.*:]]167// CHECK-NEXT: [[TMP0:%.*]] = load i8, ptr [[PTR]], align 1, !tbaa [[CHAR_TBAA6]]168// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[VEC]] to <16 x i8>169// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <16 x i8> [[TMP1]], i8 [[TMP0]], i64 15170// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[VECINS_I]] to <4 x i32>171// CHECK-NEXT: ret <4 x i32> [[TMP2]]172//173v128_t test_v128_load8_lane(const uint8_t *ptr, v128_t vec) {174 return wasm_v128_load8_lane(ptr, vec, 15);175}176 177// CHECK-LABEL: define hidden <4 x i32> @test_v128_load16_lane(178// CHECK-SAME: ptr noundef readonly captures(none) [[PTR:%.*]], <4 x i32> noundef [[VEC:%.*]]) local_unnamed_addr #[[ATTR0]] {179// CHECK-NEXT: [[ENTRY:.*:]]180// CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[PTR]], align 1, !tbaa [[CHAR_TBAA6]]181// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[VEC]] to <8 x i16>182// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <8 x i16> [[TMP1]], i16 [[TMP0]], i64 7183// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[VECINS_I]] to <4 x i32>184// CHECK-NEXT: ret <4 x i32> [[TMP2]]185//186v128_t test_v128_load16_lane(const uint16_t *ptr, v128_t vec) {187 return wasm_v128_load16_lane(ptr, vec, 7);188}189 190// CHECK-LABEL: define hidden <4 x i32> @test_v128_load32_lane(191// CHECK-SAME: ptr noundef readonly captures(none) [[PTR:%.*]], <4 x i32> noundef [[VEC:%.*]]) local_unnamed_addr #[[ATTR0]] {192// CHECK-NEXT: [[ENTRY:.*:]]193// CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[PTR]], align 1, !tbaa [[CHAR_TBAA6]]194// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x i32> [[VEC]], i32 [[TMP0]], i64 3195// CHECK-NEXT: ret <4 x i32> [[VECINS_I]]196//197v128_t test_v128_load32_lane(const uint32_t *ptr, v128_t vec) {198 return wasm_v128_load32_lane(ptr, vec, 3);199}200 201// CHECK-LABEL: define hidden <4 x i32> @test_v128_load64_lane(202// CHECK-SAME: ptr noundef readonly captures(none) [[PTR:%.*]], <4 x i32> noundef [[VEC:%.*]]) local_unnamed_addr #[[ATTR0]] {203// CHECK-NEXT: [[ENTRY:.*:]]204// CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[PTR]], align 1, !tbaa [[CHAR_TBAA6]]205// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[VEC]] to <2 x i64>206// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <2 x i64> [[TMP1]], i64 [[TMP0]], i64 1207// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[VECINS_I]] to <4 x i32>208// CHECK-NEXT: ret <4 x i32> [[TMP2]]209//210v128_t test_v128_load64_lane(const uint64_t *ptr, v128_t vec) {211 return wasm_v128_load64_lane(ptr, vec, 1);212}213 214// CHECK-LABEL: define hidden void @test_v128_store(215// CHECK-SAME: ptr noundef writeonly captures(none) initializes((0, 16)) [[MEM:%.*]], <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR1:[0-9]+]] {216// CHECK-NEXT: [[ENTRY:.*:]]217// CHECK-NEXT: store <4 x i32> [[A]], ptr [[MEM]], align 1, !tbaa [[CHAR_TBAA6]]218// CHECK-NEXT: ret void219//220void test_v128_store(void *mem, v128_t a) {221 wasm_v128_store(mem, a);222}223 224// CHECK-LABEL: define hidden void @test_v128_store8_lane(225// CHECK-SAME: ptr noundef writeonly captures(none) initializes((0, 1)) [[PTR:%.*]], <4 x i32> noundef [[VEC:%.*]]) local_unnamed_addr #[[ATTR1]] {226// CHECK-NEXT: [[ENTRY:.*:]]227// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[VEC]] to <16 x i8>228// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <16 x i8> [[TMP0]], i64 15229// CHECK-NEXT: store i8 [[VECEXT_I]], ptr [[PTR]], align 1, !tbaa [[CHAR_TBAA6]]230// CHECK-NEXT: ret void231//232void test_v128_store8_lane(uint8_t *ptr, v128_t vec) {233 wasm_v128_store8_lane(ptr, vec, 15);234}235 236// CHECK-LABEL: define hidden void @test_v128_store16_lane(237// CHECK-SAME: ptr noundef writeonly captures(none) initializes((0, 2)) [[PTR:%.*]], <4 x i32> noundef [[VEC:%.*]]) local_unnamed_addr #[[ATTR1]] {238// CHECK-NEXT: [[ENTRY:.*:]]239// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[VEC]] to <8 x i16>240// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <8 x i16> [[TMP0]], i64 7241// CHECK-NEXT: store i16 [[VECEXT_I]], ptr [[PTR]], align 1, !tbaa [[CHAR_TBAA6]]242// CHECK-NEXT: ret void243//244void test_v128_store16_lane(uint16_t *ptr, v128_t vec) {245 wasm_v128_store16_lane(ptr, vec, 7);246}247 248// CHECK-LABEL: define hidden void @test_v128_store32_lane(249// CHECK-SAME: ptr noundef writeonly captures(none) initializes((0, 4)) [[PTR:%.*]], <4 x i32> noundef [[VEC:%.*]]) local_unnamed_addr #[[ATTR1]] {250// CHECK-NEXT: [[ENTRY:.*:]]251// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[VEC]], i64 3252// CHECK-NEXT: store i32 [[VECEXT_I]], ptr [[PTR]], align 1, !tbaa [[CHAR_TBAA6]]253// CHECK-NEXT: ret void254//255void test_v128_store32_lane(uint32_t *ptr, v128_t vec) {256 wasm_v128_store32_lane(ptr, vec, 3);257}258 259// CHECK-LABEL: define hidden void @test_v128_store64_lane(260// CHECK-SAME: ptr noundef writeonly captures(none) initializes((0, 8)) [[PTR:%.*]], <4 x i32> noundef [[VEC:%.*]]) local_unnamed_addr #[[ATTR1]] {261// CHECK-NEXT: [[ENTRY:.*:]]262// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[VEC]] to <2 x i64>263// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <2 x i64> [[TMP0]], i64 1264// CHECK-NEXT: store i64 [[VECEXT_I]], ptr [[PTR]], align 1, !tbaa [[CHAR_TBAA6]]265// CHECK-NEXT: ret void266//267void test_v128_store64_lane(uint64_t *ptr, v128_t vec) {268 wasm_v128_store64_lane(ptr, vec, 1);269}270 271// CHECK-LABEL: define hidden <4 x i32> @test_i8x16_make(272// CHECK-SAME: i8 noundef signext [[C0:%.*]], i8 noundef signext [[C1:%.*]], i8 noundef signext [[C2:%.*]], i8 noundef signext [[C3:%.*]], i8 noundef signext [[C4:%.*]], i8 noundef signext [[C5:%.*]], i8 noundef signext [[C6:%.*]], i8 noundef signext [[C7:%.*]], i8 noundef signext [[C8:%.*]], i8 noundef signext [[C9:%.*]], i8 noundef signext [[C10:%.*]], i8 noundef signext [[C11:%.*]], i8 noundef signext [[C12:%.*]], i8 noundef signext [[C13:%.*]], i8 noundef signext [[C14:%.*]], i8 noundef signext [[C15:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {273// CHECK-NEXT: [[ENTRY:.*:]]274// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[C0]], i64 0275// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <16 x i8> [[VECINIT_I]], i8 [[C1]], i64 1276// CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <16 x i8> [[VECINIT1_I]], i8 [[C2]], i64 2277// CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <16 x i8> [[VECINIT2_I]], i8 [[C3]], i64 3278// CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <16 x i8> [[VECINIT3_I]], i8 [[C4]], i64 4279// CHECK-NEXT: [[VECINIT5_I:%.*]] = insertelement <16 x i8> [[VECINIT4_I]], i8 [[C5]], i64 5280// CHECK-NEXT: [[VECINIT6_I:%.*]] = insertelement <16 x i8> [[VECINIT5_I]], i8 [[C6]], i64 6281// CHECK-NEXT: [[VECINIT7_I:%.*]] = insertelement <16 x i8> [[VECINIT6_I]], i8 [[C7]], i64 7282// CHECK-NEXT: [[VECINIT8_I:%.*]] = insertelement <16 x i8> [[VECINIT7_I]], i8 [[C8]], i64 8283// CHECK-NEXT: [[VECINIT9_I:%.*]] = insertelement <16 x i8> [[VECINIT8_I]], i8 [[C9]], i64 9284// CHECK-NEXT: [[VECINIT10_I:%.*]] = insertelement <16 x i8> [[VECINIT9_I]], i8 [[C10]], i64 10285// CHECK-NEXT: [[VECINIT11_I:%.*]] = insertelement <16 x i8> [[VECINIT10_I]], i8 [[C11]], i64 11286// CHECK-NEXT: [[VECINIT12_I:%.*]] = insertelement <16 x i8> [[VECINIT11_I]], i8 [[C12]], i64 12287// CHECK-NEXT: [[VECINIT13_I:%.*]] = insertelement <16 x i8> [[VECINIT12_I]], i8 [[C13]], i64 13288// CHECK-NEXT: [[VECINIT14_I:%.*]] = insertelement <16 x i8> [[VECINIT13_I]], i8 [[C14]], i64 14289// CHECK-NEXT: [[VECINIT15_I:%.*]] = insertelement <16 x i8> [[VECINIT14_I]], i8 [[C15]], i64 15290// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[VECINIT15_I]] to <4 x i32>291// CHECK-NEXT: ret <4 x i32> [[TMP0]]292//293v128_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) {294 return wasm_i8x16_make(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15);295}296 297// CHECK-LABEL: define hidden <4 x i32> @test_u8x16_make(298// CHECK-SAME: i8 noundef zeroext [[C0:%.*]], i8 noundef zeroext [[C1:%.*]], i8 noundef zeroext [[C2:%.*]], i8 noundef zeroext [[C3:%.*]], i8 noundef zeroext [[C4:%.*]], i8 noundef zeroext [[C5:%.*]], i8 noundef zeroext [[C6:%.*]], i8 noundef zeroext [[C7:%.*]], i8 noundef zeroext [[C8:%.*]], i8 noundef zeroext [[C9:%.*]], i8 noundef zeroext [[C10:%.*]], i8 noundef zeroext [[C11:%.*]], i8 noundef zeroext [[C12:%.*]], i8 noundef zeroext [[C13:%.*]], i8 noundef zeroext [[C14:%.*]], i8 noundef zeroext [[C15:%.*]]) local_unnamed_addr #[[ATTR2]] {299// CHECK-NEXT: [[ENTRY:.*:]]300// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[C0]], i64 0301// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <16 x i8> [[VECINIT_I]], i8 [[C1]], i64 1302// CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <16 x i8> [[VECINIT1_I]], i8 [[C2]], i64 2303// CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <16 x i8> [[VECINIT2_I]], i8 [[C3]], i64 3304// CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <16 x i8> [[VECINIT3_I]], i8 [[C4]], i64 4305// CHECK-NEXT: [[VECINIT5_I:%.*]] = insertelement <16 x i8> [[VECINIT4_I]], i8 [[C5]], i64 5306// CHECK-NEXT: [[VECINIT6_I:%.*]] = insertelement <16 x i8> [[VECINIT5_I]], i8 [[C6]], i64 6307// CHECK-NEXT: [[VECINIT7_I:%.*]] = insertelement <16 x i8> [[VECINIT6_I]], i8 [[C7]], i64 7308// CHECK-NEXT: [[VECINIT8_I:%.*]] = insertelement <16 x i8> [[VECINIT7_I]], i8 [[C8]], i64 8309// CHECK-NEXT: [[VECINIT9_I:%.*]] = insertelement <16 x i8> [[VECINIT8_I]], i8 [[C9]], i64 9310// CHECK-NEXT: [[VECINIT10_I:%.*]] = insertelement <16 x i8> [[VECINIT9_I]], i8 [[C10]], i64 10311// CHECK-NEXT: [[VECINIT11_I:%.*]] = insertelement <16 x i8> [[VECINIT10_I]], i8 [[C11]], i64 11312// CHECK-NEXT: [[VECINIT12_I:%.*]] = insertelement <16 x i8> [[VECINIT11_I]], i8 [[C12]], i64 12313// CHECK-NEXT: [[VECINIT13_I:%.*]] = insertelement <16 x i8> [[VECINIT12_I]], i8 [[C13]], i64 13314// CHECK-NEXT: [[VECINIT14_I:%.*]] = insertelement <16 x i8> [[VECINIT13_I]], i8 [[C14]], i64 14315// CHECK-NEXT: [[VECINIT15_I:%.*]] = insertelement <16 x i8> [[VECINIT14_I]], i8 [[C15]], i64 15316// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[VECINIT15_I]] to <4 x i32>317// CHECK-NEXT: ret <4 x i32> [[TMP0]]318//319v128_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) {320 return wasm_u8x16_make(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15);321}322 323// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_make(324// CHECK-SAME: i16 noundef signext [[C0:%.*]], i16 noundef signext [[C1:%.*]], i16 noundef signext [[C2:%.*]], i16 noundef signext [[C3:%.*]], i16 noundef signext [[C4:%.*]], i16 noundef signext [[C5:%.*]], i16 noundef signext [[C6:%.*]], i16 noundef signext [[C7:%.*]]) local_unnamed_addr #[[ATTR2]] {325// CHECK-NEXT: [[ENTRY:.*:]]326// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[C0]], i64 0327// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <8 x i16> [[VECINIT_I]], i16 [[C1]], i64 1328// CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <8 x i16> [[VECINIT1_I]], i16 [[C2]], i64 2329// CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <8 x i16> [[VECINIT2_I]], i16 [[C3]], i64 3330// CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <8 x i16> [[VECINIT3_I]], i16 [[C4]], i64 4331// CHECK-NEXT: [[VECINIT5_I:%.*]] = insertelement <8 x i16> [[VECINIT4_I]], i16 [[C5]], i64 5332// CHECK-NEXT: [[VECINIT6_I:%.*]] = insertelement <8 x i16> [[VECINIT5_I]], i16 [[C6]], i64 6333// CHECK-NEXT: [[VECINIT7_I:%.*]] = insertelement <8 x i16> [[VECINIT6_I]], i16 [[C7]], i64 7334// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <4 x i32>335// CHECK-NEXT: ret <4 x i32> [[TMP0]]336//337v128_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) {338 return wasm_i16x8_make(c0, c1, c2, c3, c4, c5, c6, c7);339}340 341// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_make(342// CHECK-SAME: i16 noundef zeroext [[C0:%.*]], i16 noundef zeroext [[C1:%.*]], i16 noundef zeroext [[C2:%.*]], i16 noundef zeroext [[C3:%.*]], i16 noundef zeroext [[C4:%.*]], i16 noundef zeroext [[C5:%.*]], i16 noundef zeroext [[C6:%.*]], i16 noundef zeroext [[C7:%.*]]) local_unnamed_addr #[[ATTR2]] {343// CHECK-NEXT: [[ENTRY:.*:]]344// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[C0]], i64 0345// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <8 x i16> [[VECINIT_I]], i16 [[C1]], i64 1346// CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <8 x i16> [[VECINIT1_I]], i16 [[C2]], i64 2347// CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <8 x i16> [[VECINIT2_I]], i16 [[C3]], i64 3348// CHECK-NEXT: [[VECINIT4_I:%.*]] = insertelement <8 x i16> [[VECINIT3_I]], i16 [[C4]], i64 4349// CHECK-NEXT: [[VECINIT5_I:%.*]] = insertelement <8 x i16> [[VECINIT4_I]], i16 [[C5]], i64 5350// CHECK-NEXT: [[VECINIT6_I:%.*]] = insertelement <8 x i16> [[VECINIT5_I]], i16 [[C6]], i64 6351// CHECK-NEXT: [[VECINIT7_I:%.*]] = insertelement <8 x i16> [[VECINIT6_I]], i16 [[C7]], i64 7352// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <4 x i32>353// CHECK-NEXT: ret <4 x i32> [[TMP0]]354//355v128_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) {356 return wasm_u16x8_make(c0, c1, c2, c3, c4, c5, c6, c7);357}358 359// CHECK-LABEL: define hidden <4 x i32> @test_i32x4_make(360// CHECK-SAME: i32 noundef [[C0:%.*]], i32 noundef [[C1:%.*]], i32 noundef [[C2:%.*]], i32 noundef [[C3:%.*]]) local_unnamed_addr #[[ATTR2]] {361// CHECK-NEXT: [[ENTRY:.*:]]362// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[C0]], i64 0363// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <4 x i32> [[VECINIT_I]], i32 [[C1]], i64 1364// CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x i32> [[VECINIT1_I]], i32 [[C2]], i64 2365// CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <4 x i32> [[VECINIT2_I]], i32 [[C3]], i64 3366// CHECK-NEXT: ret <4 x i32> [[VECINIT3_I]]367//368v128_t test_i32x4_make(int32_t c0, int32_t c1, int32_t c2, int32_t c3) {369 return wasm_i32x4_make(c0, c1, c2, c3);370}371 372// CHECK-LABEL: define hidden <4 x i32> @test_u32x4_make(373// CHECK-SAME: i32 noundef [[C0:%.*]], i32 noundef [[C1:%.*]], i32 noundef [[C2:%.*]], i32 noundef [[C3:%.*]]) local_unnamed_addr #[[ATTR2]] {374// CHECK-NEXT: [[ENTRY:.*:]]375// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[C0]], i64 0376// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <4 x i32> [[VECINIT_I]], i32 [[C1]], i64 1377// CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x i32> [[VECINIT1_I]], i32 [[C2]], i64 2378// CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <4 x i32> [[VECINIT2_I]], i32 [[C3]], i64 3379// CHECK-NEXT: ret <4 x i32> [[VECINIT3_I]]380//381v128_t test_u32x4_make(uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3) {382 return wasm_u32x4_make(c0, c1, c2, c3);383}384 385// CHECK-LABEL: define hidden <4 x i32> @test_i64x2_make(386// CHECK-SAME: i64 noundef [[C0:%.*]], i64 noundef [[C1:%.*]]) local_unnamed_addr #[[ATTR2]] {387// CHECK-NEXT: [[ENTRY:.*:]]388// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[C0]], i64 0389// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x i64> [[VECINIT_I]], i64 [[C1]], i64 1390// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[VECINIT1_I]] to <4 x i32>391// CHECK-NEXT: ret <4 x i32> [[TMP0]]392//393v128_t test_i64x2_make(int64_t c0, int64_t c1) {394 return wasm_i64x2_make(c0, c1);395}396 397// CHECK-LABEL: define hidden <4 x i32> @test_u64x2_make(398// CHECK-SAME: i64 noundef [[C0:%.*]], i64 noundef [[C1:%.*]]) local_unnamed_addr #[[ATTR2]] {399// CHECK-NEXT: [[ENTRY:.*:]]400// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[C0]], i64 0401// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x i64> [[VECINIT_I]], i64 [[C1]], i64 1402// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[VECINIT1_I]] to <4 x i32>403// CHECK-NEXT: ret <4 x i32> [[TMP0]]404//405v128_t test_u64x2_make(uint64_t c0, uint64_t c1) {406 return wasm_u64x2_make(c0, c1);407}408 409// CHECK-LABEL: define hidden <4 x i32> @test_f32x4_make(410// CHECK-SAME: float noundef [[C0:%.*]], float noundef [[C1:%.*]], float noundef [[C2:%.*]], float noundef [[C3:%.*]]) local_unnamed_addr #[[ATTR2]] {411// CHECK-NEXT: [[ENTRY:.*:]]412// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x float> poison, float [[C0]], i64 0413// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <4 x float> [[VECINIT_I]], float [[C1]], i64 1414// CHECK-NEXT: [[VECINIT2_I:%.*]] = insertelement <4 x float> [[VECINIT1_I]], float [[C2]], i64 2415// CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <4 x float> [[VECINIT2_I]], float [[C3]], i64 3416// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[VECINIT3_I]] to <4 x i32>417// CHECK-NEXT: ret <4 x i32> [[TMP0]]418//419v128_t test_f32x4_make(float c0, float c1, float c2, float c3) {420 return wasm_f32x4_make(c0, c1, c2, c3);421}422 423// CHECK-LABEL: define hidden <4 x i32> @test_f64x2_make(424// CHECK-SAME: double noundef [[C0:%.*]], double noundef [[C1:%.*]]) local_unnamed_addr #[[ATTR2]] {425// CHECK-NEXT: [[ENTRY:.*:]]426// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x double> poison, double [[C0]], i64 0427// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double [[C1]], i64 1428// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[VECINIT1_I]] to <4 x i32>429// CHECK-NEXT: ret <4 x i32> [[TMP0]]430//431v128_t test_f64x2_make(double c0, double c1) {432 return wasm_f64x2_make(c0, c1);433}434 435// CHECK-LABEL: define hidden noundef range(i32 50462976, 252579085) <4 x i32> @test_i8x16_const(436// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {437// CHECK-NEXT: [[ENTRY:.*:]]438// CHECK-NEXT: ret <4 x i32> <i32 50462976, i32 117835012, i32 185207048, i32 252579084>439//440v128_t test_i8x16_const(void) {441 return wasm_i8x16_const(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);442}443 444// CHECK-LABEL: define hidden noundef range(i32 50462976, 252579085) <4 x i32> @test_u8x16_const(445// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {446// CHECK-NEXT: [[ENTRY:.*:]]447// CHECK-NEXT: ret <4 x i32> <i32 50462976, i32 117835012, i32 185207048, i32 252579084>448//449v128_t test_u8x16_const(void) {450 return wasm_u8x16_const(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);451}452 453// CHECK-LABEL: define hidden noundef range(i32 65536, 458759) <4 x i32> @test_i16x8_const(454// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {455// CHECK-NEXT: [[ENTRY:.*:]]456// CHECK-NEXT: ret <4 x i32> <i32 65536, i32 196610, i32 327684, i32 458758>457//458v128_t test_i16x8_const(void) {459 return wasm_i16x8_const(0, 1, 2, 3, 4, 5, 6, 7);460}461 462// CHECK-LABEL: define hidden noundef range(i32 65536, 458759) <4 x i32> @test_u16x8_const(463// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {464// CHECK-NEXT: [[ENTRY:.*:]]465// CHECK-NEXT: ret <4 x i32> <i32 65536, i32 196610, i32 327684, i32 458758>466//467v128_t test_u16x8_const(void) {468 return wasm_u16x8_const(0, 1, 2, 3, 4, 5, 6, 7);469}470 471// CHECK-LABEL: define hidden noundef range(i32 0, 4) <4 x i32> @test_i32x4_const(472// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {473// CHECK-NEXT: [[ENTRY:.*:]]474// CHECK-NEXT: ret <4 x i32> <i32 0, i32 1, i32 2, i32 3>475//476v128_t test_i32x4_const(void) {477 return wasm_i32x4_const(0, 1, 2, 3);478}479 480// CHECK-LABEL: define hidden noundef range(i32 0, 4) <4 x i32> @test_u32x4_const(481// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {482// CHECK-NEXT: [[ENTRY:.*:]]483// CHECK-NEXT: ret <4 x i32> <i32 0, i32 1, i32 2, i32 3>484//485v128_t test_u32x4_const(void) {486 return wasm_u32x4_const(0, 1, 2, 3);487}488 489// CHECK-LABEL: define hidden noundef range(i32 0, 2) <4 x i32> @test_i64x2_const(490// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {491// CHECK-NEXT: [[ENTRY:.*:]]492// CHECK-NEXT: ret <4 x i32> <i32 0, i32 0, i32 1, i32 0>493//494v128_t test_i64x2_const(void) {495 return wasm_i64x2_const(0, 1);496}497 498// CHECK-LABEL: define hidden noundef range(i32 0, 2) <4 x i32> @test_u64x2_const(499// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {500// CHECK-NEXT: [[ENTRY:.*:]]501// CHECK-NEXT: ret <4 x i32> <i32 0, i32 0, i32 1, i32 0>502//503v128_t test_u64x2_const(void) {504 return wasm_u64x2_const(0, 1);505}506 507// CHECK-LABEL: define hidden noundef range(i32 0, 1077936129) <4 x i32> @test_f32x4_const(508// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {509// CHECK-NEXT: [[ENTRY:.*:]]510// CHECK-NEXT: ret <4 x i32> <i32 0, i32 1065353216, i32 1073741824, i32 1077936128>511//512v128_t test_f32x4_const(void) {513 return wasm_f32x4_const(0, 1, 2, 3);514}515 516// CHECK-LABEL: define hidden noundef range(i32 0, 1072693249) <4 x i32> @test_f64x2_const(517// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {518// CHECK-NEXT: [[ENTRY:.*:]]519// CHECK-NEXT: ret <4 x i32> <i32 0, i32 0, i32 0, i32 1072693248>520//521v128_t test_f64x2_const(void) {522 return wasm_f64x2_const(0, 1);523}524 525// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_const_splat(526// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {527// CHECK-NEXT: [[ENTRY:.*:]]528// CHECK-NEXT: ret <4 x i32> splat (i32 707406378)529//530v128_t test_i8x16_const_splat(void) {531 return wasm_i8x16_const_splat(42);532}533 534// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_const_splat(535// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {536// CHECK-NEXT: [[ENTRY:.*:]]537// CHECK-NEXT: ret <4 x i32> splat (i32 707406378)538//539v128_t test_u8x16_const_splat(void) {540 return wasm_u8x16_const_splat(42);541}542 543// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_const_splat(544// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {545// CHECK-NEXT: [[ENTRY:.*:]]546// CHECK-NEXT: ret <4 x i32> splat (i32 2752554)547//548v128_t test_i16x8_const_splat(void) {549 return wasm_i16x8_const_splat(42);550}551 552// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_const_splat(553// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {554// CHECK-NEXT: [[ENTRY:.*:]]555// CHECK-NEXT: ret <4 x i32> splat (i32 2752554)556//557v128_t test_u16x8_const_splat(void) {558 return wasm_u16x8_const_splat(42);559}560 561// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_const_splat(562// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {563// CHECK-NEXT: [[ENTRY:.*:]]564// CHECK-NEXT: ret <4 x i32> splat (i32 42)565//566v128_t test_i32x4_const_splat(void) {567 return wasm_i32x4_const_splat(42);568}569 570// CHECK-LABEL: define hidden noundef <4 x i32> @test_u32x4_const_splat(571// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {572// CHECK-NEXT: [[ENTRY:.*:]]573// CHECK-NEXT: ret <4 x i32> splat (i32 42)574//575v128_t test_u32x4_const_splat(void) {576 return wasm_u32x4_const_splat(42);577}578 579// CHECK-LABEL: define hidden noundef range(i32 0, 43) <4 x i32> @test_i64x2_const_splat(580// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {581// CHECK-NEXT: [[ENTRY:.*:]]582// CHECK-NEXT: ret <4 x i32> <i32 42, i32 0, i32 42, i32 0>583//584v128_t test_i64x2_const_splat(void) {585 return wasm_i64x2_const_splat(42);586}587 588// CHECK-LABEL: define hidden noundef range(i32 0, 43) <4 x i32> @test_u64x2_const_splat(589// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {590// CHECK-NEXT: [[ENTRY:.*:]]591// CHECK-NEXT: ret <4 x i32> <i32 42, i32 0, i32 42, i32 0>592//593v128_t test_u64x2_const_splat(void) {594 return wasm_u64x2_const_splat(42);595}596 597// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_const_splat(598// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {599// CHECK-NEXT: [[ENTRY:.*:]]600// CHECK-NEXT: ret <4 x i32> splat (i32 1109917696)601//602v128_t test_f32x4_const_splat(void) {603 return wasm_f32x4_const_splat(42);604}605 606// CHECK-LABEL: define hidden noundef range(i32 0, 1078263809) <4 x i32> @test_f64x2_const_splat(607// CHECK-SAME: ) local_unnamed_addr #[[ATTR2]] {608// CHECK-NEXT: [[ENTRY:.*:]]609// CHECK-NEXT: ret <4 x i32> <i32 0, i32 1078263808, i32 0, i32 1078263808>610//611v128_t test_f64x2_const_splat(void) {612 return wasm_f64x2_const_splat(42);613}614 615// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_splat(616// CHECK-SAME: i8 noundef signext [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {617// CHECK-NEXT: [[ENTRY:.*:]]618// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[A]], i64 0619// CHECK-NEXT: [[VECINIT15_I:%.*]] = shufflevector <16 x i8> [[VECINIT_I]], <16 x i8> poison, <16 x i32> zeroinitializer620// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[VECINIT15_I]] to <4 x i32>621// CHECK-NEXT: ret <4 x i32> [[TMP0]]622//623v128_t test_i8x16_splat(int8_t a) {624 return wasm_i8x16_splat(a);625}626 627// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_splat(628// CHECK-SAME: i8 noundef zeroext [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {629// CHECK-NEXT: [[ENTRY:.*:]]630// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <16 x i8> poison, i8 [[A]], i64 0631// CHECK-NEXT: [[VECINIT15_I:%.*]] = shufflevector <16 x i8> [[VECINIT_I]], <16 x i8> poison, <16 x i32> zeroinitializer632// CHECK-NEXT: [[TMP0:%.*]] = bitcast <16 x i8> [[VECINIT15_I]] to <4 x i32>633// CHECK-NEXT: ret <4 x i32> [[TMP0]]634//635v128_t test_u8x16_splat(uint8_t a) {636 return wasm_u8x16_splat(a);637}638 639// CHECK-LABEL: define hidden noundef signext i8 @test_i8x16_extract_lane(640// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {641// CHECK-NEXT: [[ENTRY:.*:]]642// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>643// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <16 x i8> [[TMP0]], i64 15644// CHECK-NEXT: ret i8 [[VECEXT_I]]645//646int8_t test_i8x16_extract_lane(v128_t a) {647 return wasm_i8x16_extract_lane(a, 15);648}649 650// CHECK-LABEL: define hidden noundef zeroext i8 @test_u8x16_extract_lane(651// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {652// CHECK-NEXT: [[ENTRY:.*:]]653// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>654// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <16 x i8> [[TMP0]], i64 15655// CHECK-NEXT: ret i8 [[VECEXT_I]]656//657uint8_t test_u8x16_extract_lane(v128_t a) {658 return wasm_u8x16_extract_lane(a, 15);659}660 661// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_replace_lane(662// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i8 noundef signext [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {663// CHECK-NEXT: [[ENTRY:.*:]]664// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>665// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <16 x i8> [[TMP0]], i8 [[B]], i64 15666// CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[VECINS_I]] to <4 x i32>667// CHECK-NEXT: ret <4 x i32> [[TMP1]]668//669v128_t test_i8x16_replace_lane(v128_t a, int8_t b) {670 return wasm_i8x16_replace_lane(a, 15, b);671}672 673// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_replace_lane(674// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i8 noundef zeroext [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {675// CHECK-NEXT: [[ENTRY:.*:]]676// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>677// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <16 x i8> [[TMP0]], i8 [[B]], i64 15678// CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[VECINS_I]] to <4 x i32>679// CHECK-NEXT: ret <4 x i32> [[TMP1]]680//681v128_t test_u8x16_replace_lane(v128_t a, uint8_t b) {682 return wasm_u8x16_replace_lane(a, 15, b);683}684 685// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_splat(686// CHECK-SAME: i16 noundef signext [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {687// CHECK-NEXT: [[ENTRY:.*:]]688// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[A]], i64 0689// CHECK-NEXT: [[VECINIT7_I:%.*]] = shufflevector <8 x i16> [[VECINIT_I]], <8 x i16> poison, <8 x i32> zeroinitializer690// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <4 x i32>691// CHECK-NEXT: ret <4 x i32> [[TMP0]]692//693v128_t test_i16x8_splat(int16_t a) {694 return wasm_i16x8_splat(a);695}696 697// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_splat(698// CHECK-SAME: i16 noundef zeroext [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {699// CHECK-NEXT: [[ENTRY:.*:]]700// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <8 x i16> poison, i16 [[A]], i64 0701// CHECK-NEXT: [[VECINIT7_I:%.*]] = shufflevector <8 x i16> [[VECINIT_I]], <8 x i16> poison, <8 x i32> zeroinitializer702// CHECK-NEXT: [[TMP0:%.*]] = bitcast <8 x i16> [[VECINIT7_I]] to <4 x i32>703// CHECK-NEXT: ret <4 x i32> [[TMP0]]704//705v128_t test_u16x8_splat(uint16_t a) {706 return wasm_u16x8_splat(a);707}708 709// CHECK-LABEL: define hidden noundef signext i16 @test_i16x8_extract_lane(710// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {711// CHECK-NEXT: [[ENTRY:.*:]]712// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>713// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <8 x i16> [[TMP0]], i64 7714// CHECK-NEXT: ret i16 [[VECEXT_I]]715//716int16_t test_i16x8_extract_lane(v128_t a) {717 return wasm_i16x8_extract_lane(a, 7);718}719 720// CHECK-LABEL: define hidden noundef zeroext i16 @test_u16x8_extract_lane(721// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {722// CHECK-NEXT: [[ENTRY:.*:]]723// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>724// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <8 x i16> [[TMP0]], i64 7725// CHECK-NEXT: ret i16 [[VECEXT_I]]726//727uint16_t test_u16x8_extract_lane(v128_t a) {728 return wasm_u16x8_extract_lane(a, 7);729}730 731// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_replace_lane(732// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i16 noundef signext [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {733// CHECK-NEXT: [[ENTRY:.*:]]734// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>735// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <8 x i16> [[TMP0]], i16 [[B]], i64 7736// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINS_I]] to <4 x i32>737// CHECK-NEXT: ret <4 x i32> [[TMP1]]738//739v128_t test_i16x8_replace_lane(v128_t a, int16_t b) {740 return wasm_i16x8_replace_lane(a, 7, b);741}742 743// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_replace_lane(744// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i16 noundef zeroext [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {745// CHECK-NEXT: [[ENTRY:.*:]]746// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>747// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <8 x i16> [[TMP0]], i16 [[B]], i64 7748// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[VECINS_I]] to <4 x i32>749// CHECK-NEXT: ret <4 x i32> [[TMP1]]750//751v128_t test_u16x8_replace_lane(v128_t a, uint16_t b) {752 return wasm_u16x8_replace_lane(a, 7, b);753}754 755// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_splat(756// CHECK-SAME: i32 noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {757// CHECK-NEXT: [[ENTRY:.*:]]758// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[A]], i64 0759// CHECK-NEXT: [[VECINIT3_I:%.*]] = shufflevector <4 x i32> [[VECINIT_I]], <4 x i32> poison, <4 x i32> zeroinitializer760// CHECK-NEXT: ret <4 x i32> [[VECINIT3_I]]761//762v128_t test_i32x4_splat(int32_t a) {763 return wasm_i32x4_splat(a);764}765 766// CHECK-LABEL: define hidden noundef <4 x i32> @test_u32x4_splat(767// CHECK-SAME: i32 noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {768// CHECK-NEXT: [[ENTRY:.*:]]769// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x i32> poison, i32 [[A]], i64 0770// CHECK-NEXT: [[VECINIT3_I:%.*]] = shufflevector <4 x i32> [[VECINIT_I]], <4 x i32> poison, <4 x i32> zeroinitializer771// CHECK-NEXT: ret <4 x i32> [[VECINIT3_I]]772//773v128_t test_u32x4_splat(uint32_t a) {774 return wasm_u32x4_splat(a);775}776 777// CHECK-LABEL: define hidden noundef i32 @test_i32x4_extract_lane(778// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {779// CHECK-NEXT: [[ENTRY:.*:]]780// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[A]], i64 3781// CHECK-NEXT: ret i32 [[VECEXT_I]]782//783int32_t test_i32x4_extract_lane(v128_t a) {784 return wasm_i32x4_extract_lane(a, 3);785}786 787// CHECK-LABEL: define hidden noundef i32 @test_u32x4_extract_lane(788// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {789// CHECK-NEXT: [[ENTRY:.*:]]790// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x i32> [[A]], i64 3791// CHECK-NEXT: ret i32 [[VECEXT_I]]792//793uint32_t test_u32x4_extract_lane(v128_t a) {794 return wasm_u32x4_extract_lane(a, 3);795}796 797// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_replace_lane(798// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {799// CHECK-NEXT: [[ENTRY:.*:]]800// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x i32> [[A]], i32 [[B]], i64 3801// CHECK-NEXT: ret <4 x i32> [[VECINS_I]]802//803v128_t test_i32x4_replace_lane(v128_t a, int32_t b) {804 return wasm_i32x4_replace_lane(a, 3, b);805}806 807// CHECK-LABEL: define hidden noundef <4 x i32> @test_u32x4_replace_lane(808// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {809// CHECK-NEXT: [[ENTRY:.*:]]810// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x i32> [[A]], i32 [[B]], i64 3811// CHECK-NEXT: ret <4 x i32> [[VECINS_I]]812//813v128_t test_u32x4_replace_lane(v128_t a, uint32_t b) {814 return wasm_u32x4_replace_lane(a, 3, b);815}816 817// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_splat(818// CHECK-SAME: i64 noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {819// CHECK-NEXT: [[ENTRY:.*:]]820// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[A]], i64 0821// CHECK-NEXT: [[VECINIT1_I:%.*]] = shufflevector <2 x i64> [[VECINIT_I]], <2 x i64> poison, <2 x i32> zeroinitializer822// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[VECINIT1_I]] to <4 x i32>823// CHECK-NEXT: ret <4 x i32> [[TMP0]]824//825v128_t test_i64x2_splat(int64_t a) {826 return wasm_i64x2_splat(a);827}828 829// CHECK-LABEL: define hidden noundef <4 x i32> @test_u64x2_splat(830// CHECK-SAME: i64 noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {831// CHECK-NEXT: [[ENTRY:.*:]]832// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x i64> poison, i64 [[A]], i64 0833// CHECK-NEXT: [[VECINIT1_I:%.*]] = shufflevector <2 x i64> [[VECINIT_I]], <2 x i64> poison, <2 x i32> zeroinitializer834// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[VECINIT1_I]] to <4 x i32>835// CHECK-NEXT: ret <4 x i32> [[TMP0]]836//837v128_t test_u64x2_splat(uint64_t a) {838 return wasm_u64x2_splat(a);839}840 841// CHECK-LABEL: define hidden noundef i64 @test_i64x2_extract_lane(842// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {843// CHECK-NEXT: [[ENTRY:.*:]]844// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>845// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <2 x i64> [[TMP0]], i64 1846// CHECK-NEXT: ret i64 [[VECEXT_I]]847//848int64_t test_i64x2_extract_lane(v128_t a) {849 return wasm_i64x2_extract_lane(a, 1);850}851 852// CHECK-LABEL: define hidden noundef i64 @test_u64x2_extract_lane(853// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {854// CHECK-NEXT: [[ENTRY:.*:]]855// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>856// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <2 x i64> [[TMP0]], i64 1857// CHECK-NEXT: ret i64 [[VECEXT_I]]858//859uint64_t test_u64x2_extract_lane(v128_t a) {860 return wasm_u64x2_extract_lane(a, 1);861}862 863// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_replace_lane(864// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i64 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {865// CHECK-NEXT: [[ENTRY:.*:]]866// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>867// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B]], i64 1868// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[VECINS_I]] to <4 x i32>869// CHECK-NEXT: ret <4 x i32> [[TMP1]]870//871v128_t test_i64x2_replace_lane(v128_t a, int64_t b) {872 return wasm_i64x2_replace_lane(a, 1, b);873}874 875// CHECK-LABEL: define hidden noundef <4 x i32> @test_u64x2_replace_lane(876// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i64 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {877// CHECK-NEXT: [[ENTRY:.*:]]878// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>879// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <2 x i64> [[TMP0]], i64 [[B]], i64 1880// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[VECINS_I]] to <4 x i32>881// CHECK-NEXT: ret <4 x i32> [[TMP1]]882//883v128_t test_u64x2_replace_lane(v128_t a, uint64_t b) {884 return wasm_u64x2_replace_lane(a, 1, b);885}886 887// CHECK-LABEL: define hidden <4 x i32> @test_f32x4_splat(888// CHECK-SAME: float noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {889// CHECK-NEXT: [[ENTRY:.*:]]890// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x float> poison, float [[A]], i64 0891// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[VECINIT_I]] to <4 x i32>892// CHECK-NEXT: [[TMP1:%.*]] = shufflevector <4 x i32> [[TMP0]], <4 x i32> poison, <4 x i32> zeroinitializer893// CHECK-NEXT: ret <4 x i32> [[TMP1]]894//895v128_t test_f32x4_splat(float a) {896 return wasm_f32x4_splat(a);897}898 899// CHECK-LABEL: define hidden noundef float @test_f32x4_extract_lane(900// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {901// CHECK-NEXT: [[ENTRY:.*:]]902// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>903// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <4 x float> [[TMP0]], i64 3904// CHECK-NEXT: ret float [[VECEXT_I]]905//906float test_f32x4_extract_lane(v128_t a) {907 return wasm_f32x4_extract_lane(a, 3);908}909 910// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_replace_lane(911// CHECK-SAME: <4 x i32> noundef [[A:%.*]], float noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {912// CHECK-NEXT: [[ENTRY:.*:]]913// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>914// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <4 x float> [[TMP0]], float [[B]], i64 3915// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[VECINS_I]] to <4 x i32>916// CHECK-NEXT: ret <4 x i32> [[TMP1]]917//918v128_t test_f32x4_replace_lane(v128_t a, float b) {919 return wasm_f32x4_replace_lane(a, 3, b);920}921 922// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_splat(923// CHECK-SAME: double noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {924// CHECK-NEXT: [[ENTRY:.*:]]925// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x double> poison, double [[A]], i64 0926// CHECK-NEXT: [[VECINIT1_I:%.*]] = shufflevector <2 x double> [[VECINIT_I]], <2 x double> poison, <2 x i32> zeroinitializer927// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[VECINIT1_I]] to <4 x i32>928// CHECK-NEXT: ret <4 x i32> [[TMP0]]929//930v128_t test_f64x2_splat(double a) {931 return wasm_f64x2_splat(a);932}933 934// CHECK-LABEL: define hidden noundef double @test_f64x2_extract_lane(935// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {936// CHECK-NEXT: [[ENTRY:.*:]]937// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>938// CHECK-NEXT: [[VECEXT_I:%.*]] = extractelement <2 x double> [[TMP0]], i64 1939// CHECK-NEXT: ret double [[VECEXT_I]]940//941double test_f64x2_extract_lane(v128_t a) {942 return wasm_f64x2_extract_lane(a, 1);943}944 945// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_replace_lane(946// CHECK-SAME: <4 x i32> noundef [[A:%.*]], double noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {947// CHECK-NEXT: [[ENTRY:.*:]]948// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>949// CHECK-NEXT: [[VECINS_I:%.*]] = insertelement <2 x double> [[TMP0]], double [[B]], i64 1950// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x double> [[VECINS_I]] to <4 x i32>951// CHECK-NEXT: ret <4 x i32> [[TMP1]]952//953v128_t test_f64x2_replace_lane(v128_t a, double b) {954 return wasm_f64x2_replace_lane(a, 1, b);955}956 957// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_eq(958// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {959// CHECK-NEXT: [[ENTRY:.*:]]960// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>961// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>962// CHECK-NEXT: [[CMP_I:%.*]] = icmp eq <16 x i8> [[TMP0]], [[TMP1]]963// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>964// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>965// CHECK-NEXT: ret <4 x i32> [[TMP2]]966//967v128_t test_i8x16_eq(v128_t a, v128_t b) {968 return wasm_i8x16_eq(a, b);969}970 971// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_ne(972// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {973// CHECK-NEXT: [[ENTRY:.*:]]974// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>975// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>976// CHECK-NEXT: [[CMP_I:%.*]] = icmp ne <16 x i8> [[TMP0]], [[TMP1]]977// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>978// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>979// CHECK-NEXT: ret <4 x i32> [[TMP2]]980//981v128_t test_i8x16_ne(v128_t a, v128_t b) {982 return wasm_i8x16_ne(a, b);983}984 985// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_lt(986// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {987// CHECK-NEXT: [[ENTRY:.*:]]988// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>989// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>990// CHECK-NEXT: [[CMP_I:%.*]] = icmp slt <16 x i8> [[TMP0]], [[TMP1]]991// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>992// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>993// CHECK-NEXT: ret <4 x i32> [[TMP2]]994//995v128_t test_i8x16_lt(v128_t a, v128_t b) {996 return wasm_i8x16_lt(a, b);997}998 999// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_lt(1000// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1001// CHECK-NEXT: [[ENTRY:.*:]]1002// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1003// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1004// CHECK-NEXT: [[CMP_I:%.*]] = icmp ult <16 x i8> [[TMP0]], [[TMP1]]1005// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>1006// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>1007// CHECK-NEXT: ret <4 x i32> [[TMP2]]1008//1009v128_t test_u8x16_lt(v128_t a, v128_t b) {1010 return wasm_u8x16_lt(a, b);1011}1012 1013// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_gt(1014// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1015// CHECK-NEXT: [[ENTRY:.*:]]1016// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1017// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1018// CHECK-NEXT: [[CMP_I:%.*]] = icmp sgt <16 x i8> [[TMP0]], [[TMP1]]1019// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>1020// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>1021// CHECK-NEXT: ret <4 x i32> [[TMP2]]1022//1023v128_t test_i8x16_gt(v128_t a, v128_t b) {1024 return wasm_i8x16_gt(a, b);1025}1026 1027// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_gt(1028// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1029// CHECK-NEXT: [[ENTRY:.*:]]1030// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1031// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1032// CHECK-NEXT: [[CMP_I:%.*]] = icmp ugt <16 x i8> [[TMP0]], [[TMP1]]1033// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>1034// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>1035// CHECK-NEXT: ret <4 x i32> [[TMP2]]1036//1037v128_t test_u8x16_gt(v128_t a, v128_t b) {1038 return wasm_u8x16_gt(a, b);1039}1040 1041// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_le(1042// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1043// CHECK-NEXT: [[ENTRY:.*:]]1044// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1045// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1046// CHECK-NEXT: [[CMP_I:%.*]] = icmp sle <16 x i8> [[TMP0]], [[TMP1]]1047// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>1048// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>1049// CHECK-NEXT: ret <4 x i32> [[TMP2]]1050//1051v128_t test_i8x16_le(v128_t a, v128_t b) {1052 return wasm_i8x16_le(a, b);1053}1054 1055// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_le(1056// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1057// CHECK-NEXT: [[ENTRY:.*:]]1058// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1059// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1060// CHECK-NEXT: [[CMP_I:%.*]] = icmp ule <16 x i8> [[TMP0]], [[TMP1]]1061// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>1062// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>1063// CHECK-NEXT: ret <4 x i32> [[TMP2]]1064//1065v128_t test_u8x16_le(v128_t a, v128_t b) {1066 return wasm_u8x16_le(a, b);1067}1068 1069// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_ge(1070// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1071// CHECK-NEXT: [[ENTRY:.*:]]1072// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1073// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1074// CHECK-NEXT: [[CMP_I:%.*]] = icmp sge <16 x i8> [[TMP0]], [[TMP1]]1075// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>1076// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>1077// CHECK-NEXT: ret <4 x i32> [[TMP2]]1078//1079v128_t test_i8x16_ge(v128_t a, v128_t b) {1080 return wasm_i8x16_ge(a, b);1081}1082 1083// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_ge(1084// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1085// CHECK-NEXT: [[ENTRY:.*:]]1086// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1087// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1088// CHECK-NEXT: [[CMP_I:%.*]] = icmp uge <16 x i8> [[TMP0]], [[TMP1]]1089// CHECK-NEXT: [[SEXT_I:%.*]] = sext <16 x i1> [[CMP_I]] to <16 x i8>1090// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SEXT_I]] to <4 x i32>1091// CHECK-NEXT: ret <4 x i32> [[TMP2]]1092//1093v128_t test_u8x16_ge(v128_t a, v128_t b) {1094 return wasm_u8x16_ge(a, b);1095}1096 1097// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_eq(1098// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1099// CHECK-NEXT: [[ENTRY:.*:]]1100// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1101// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1102// CHECK-NEXT: [[CMP_I:%.*]] = icmp eq <8 x i16> [[TMP0]], [[TMP1]]1103// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1104// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1105// CHECK-NEXT: ret <4 x i32> [[TMP2]]1106//1107v128_t test_i16x8_eq(v128_t a, v128_t b) {1108 return wasm_i16x8_eq(a, b);1109}1110 1111// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_ne(1112// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1113// CHECK-NEXT: [[ENTRY:.*:]]1114// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1115// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1116// CHECK-NEXT: [[CMP_I:%.*]] = icmp ne <8 x i16> [[TMP0]], [[TMP1]]1117// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1118// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1119// CHECK-NEXT: ret <4 x i32> [[TMP2]]1120//1121v128_t test_i16x8_ne(v128_t a, v128_t b) {1122 return wasm_i16x8_ne(a, b);1123}1124 1125// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_lt(1126// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1127// CHECK-NEXT: [[ENTRY:.*:]]1128// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1129// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1130// CHECK-NEXT: [[CMP_I:%.*]] = icmp slt <8 x i16> [[TMP0]], [[TMP1]]1131// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1132// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1133// CHECK-NEXT: ret <4 x i32> [[TMP2]]1134//1135v128_t test_i16x8_lt(v128_t a, v128_t b) {1136 return wasm_i16x8_lt(a, b);1137}1138 1139// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_lt(1140// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1141// CHECK-NEXT: [[ENTRY:.*:]]1142// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1143// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1144// CHECK-NEXT: [[CMP_I:%.*]] = icmp ult <8 x i16> [[TMP0]], [[TMP1]]1145// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1146// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1147// CHECK-NEXT: ret <4 x i32> [[TMP2]]1148//1149v128_t test_u16x8_lt(v128_t a, v128_t b) {1150 return wasm_u16x8_lt(a, b);1151}1152 1153// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_gt(1154// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1155// CHECK-NEXT: [[ENTRY:.*:]]1156// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1157// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1158// CHECK-NEXT: [[CMP_I:%.*]] = icmp sgt <8 x i16> [[TMP0]], [[TMP1]]1159// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1160// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1161// CHECK-NEXT: ret <4 x i32> [[TMP2]]1162//1163v128_t test_i16x8_gt(v128_t a, v128_t b) {1164 return wasm_i16x8_gt(a, b);1165}1166 1167// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_gt(1168// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1169// CHECK-NEXT: [[ENTRY:.*:]]1170// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1171// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1172// CHECK-NEXT: [[CMP_I:%.*]] = icmp ugt <8 x i16> [[TMP0]], [[TMP1]]1173// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1174// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1175// CHECK-NEXT: ret <4 x i32> [[TMP2]]1176//1177v128_t test_u16x8_gt(v128_t a, v128_t b) {1178 return wasm_u16x8_gt(a, b);1179}1180 1181// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_le(1182// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1183// CHECK-NEXT: [[ENTRY:.*:]]1184// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1185// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1186// CHECK-NEXT: [[CMP_I:%.*]] = icmp sle <8 x i16> [[TMP0]], [[TMP1]]1187// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1188// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1189// CHECK-NEXT: ret <4 x i32> [[TMP2]]1190//1191v128_t test_i16x8_le(v128_t a, v128_t b) {1192 return wasm_i16x8_le(a, b);1193}1194 1195// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_le(1196// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1197// CHECK-NEXT: [[ENTRY:.*:]]1198// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1199// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1200// CHECK-NEXT: [[CMP_I:%.*]] = icmp ule <8 x i16> [[TMP0]], [[TMP1]]1201// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1202// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1203// CHECK-NEXT: ret <4 x i32> [[TMP2]]1204//1205v128_t test_u16x8_le(v128_t a, v128_t b) {1206 return wasm_u16x8_le(a, b);1207}1208 1209// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_ge(1210// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1211// CHECK-NEXT: [[ENTRY:.*:]]1212// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1213// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1214// CHECK-NEXT: [[CMP_I:%.*]] = icmp sge <8 x i16> [[TMP0]], [[TMP1]]1215// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1216// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1217// CHECK-NEXT: ret <4 x i32> [[TMP2]]1218//1219v128_t test_i16x8_ge(v128_t a, v128_t b) {1220 return wasm_i16x8_ge(a, b);1221}1222 1223// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_ge(1224// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1225// CHECK-NEXT: [[ENTRY:.*:]]1226// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1227// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>1228// CHECK-NEXT: [[CMP_I:%.*]] = icmp uge <8 x i16> [[TMP0]], [[TMP1]]1229// CHECK-NEXT: [[SEXT_I:%.*]] = sext <8 x i1> [[CMP_I]] to <8 x i16>1230// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SEXT_I]] to <4 x i32>1231// CHECK-NEXT: ret <4 x i32> [[TMP2]]1232//1233v128_t test_u16x8_ge(v128_t a, v128_t b) {1234 return wasm_u16x8_ge(a, b);1235}1236 1237// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_i32x4_eq(1238// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1239// CHECK-NEXT: [[ENTRY:.*:]]1240// CHECK-NEXT: [[CMP_I:%.*]] = icmp eq <4 x i32> [[A]], [[B]]1241// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1242// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1243//1244v128_t test_i32x4_eq(v128_t a, v128_t b) {1245 return wasm_i32x4_eq(a, b);1246}1247 1248// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_i32x4_ne(1249// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1250// CHECK-NEXT: [[ENTRY:.*:]]1251// CHECK-NEXT: [[CMP_I:%.*]] = icmp ne <4 x i32> [[A]], [[B]]1252// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1253// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1254//1255v128_t test_i32x4_ne(v128_t a, v128_t b) {1256 return wasm_i32x4_ne(a, b);1257}1258 1259// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_i32x4_lt(1260// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1261// CHECK-NEXT: [[ENTRY:.*:]]1262// CHECK-NEXT: [[CMP_I:%.*]] = icmp slt <4 x i32> [[A]], [[B]]1263// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1264// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1265//1266v128_t test_i32x4_lt(v128_t a, v128_t b) {1267 return wasm_i32x4_lt(a, b);1268}1269 1270// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_u32x4_lt(1271// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1272// CHECK-NEXT: [[ENTRY:.*:]]1273// CHECK-NEXT: [[CMP_I:%.*]] = icmp ult <4 x i32> [[A]], [[B]]1274// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1275// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1276//1277v128_t test_u32x4_lt(v128_t a, v128_t b) {1278 return wasm_u32x4_lt(a, b);1279}1280 1281// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_i32x4_gt(1282// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1283// CHECK-NEXT: [[ENTRY:.*:]]1284// CHECK-NEXT: [[CMP_I:%.*]] = icmp sgt <4 x i32> [[A]], [[B]]1285// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1286// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1287//1288v128_t test_i32x4_gt(v128_t a, v128_t b) {1289 return wasm_i32x4_gt(a, b);1290}1291 1292// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_u32x4_gt(1293// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1294// CHECK-NEXT: [[ENTRY:.*:]]1295// CHECK-NEXT: [[CMP_I:%.*]] = icmp ugt <4 x i32> [[A]], [[B]]1296// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1297// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1298//1299v128_t test_u32x4_gt(v128_t a, v128_t b) {1300 return wasm_u32x4_gt(a, b);1301}1302 1303// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_i32x4_le(1304// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1305// CHECK-NEXT: [[ENTRY:.*:]]1306// CHECK-NEXT: [[CMP_I:%.*]] = icmp sle <4 x i32> [[A]], [[B]]1307// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1308// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1309//1310v128_t test_i32x4_le(v128_t a, v128_t b) {1311 return wasm_i32x4_le(a, b);1312}1313 1314// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_u32x4_le(1315// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1316// CHECK-NEXT: [[ENTRY:.*:]]1317// CHECK-NEXT: [[CMP_I:%.*]] = icmp ule <4 x i32> [[A]], [[B]]1318// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1319// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1320//1321v128_t test_u32x4_le(v128_t a, v128_t b) {1322 return wasm_u32x4_le(a, b);1323}1324 1325// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_i32x4_ge(1326// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1327// CHECK-NEXT: [[ENTRY:.*:]]1328// CHECK-NEXT: [[CMP_I:%.*]] = icmp sge <4 x i32> [[A]], [[B]]1329// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1330// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1331//1332v128_t test_i32x4_ge(v128_t a, v128_t b) {1333 return wasm_i32x4_ge(a, b);1334}1335 1336// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_u32x4_ge(1337// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1338// CHECK-NEXT: [[ENTRY:.*:]]1339// CHECK-NEXT: [[CMP_I:%.*]] = icmp uge <4 x i32> [[A]], [[B]]1340// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1341// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1342//1343v128_t test_u32x4_ge(v128_t a, v128_t b) {1344 return wasm_u32x4_ge(a, b);1345}1346 1347// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_eq(1348// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1349// CHECK-NEXT: [[ENTRY:.*:]]1350// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>1351// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x i64>1352// CHECK-NEXT: [[CMP_I:%.*]] = icmp eq <2 x i64> [[TMP0]], [[TMP1]]1353// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1354// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1355// CHECK-NEXT: ret <4 x i32> [[TMP2]]1356//1357v128_t test_i64x2_eq(v128_t a, v128_t b) {1358 return wasm_i64x2_eq(a, b);1359}1360 1361// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_ne(1362// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1363// CHECK-NEXT: [[ENTRY:.*:]]1364// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>1365// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x i64>1366// CHECK-NEXT: [[CMP_I:%.*]] = icmp ne <2 x i64> [[TMP0]], [[TMP1]]1367// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1368// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1369// CHECK-NEXT: ret <4 x i32> [[TMP2]]1370//1371v128_t test_i64x2_ne(v128_t a, v128_t b) {1372 return wasm_i64x2_ne(a, b);1373}1374 1375// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_lt(1376// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1377// CHECK-NEXT: [[ENTRY:.*:]]1378// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>1379// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x i64>1380// CHECK-NEXT: [[CMP_I:%.*]] = icmp slt <2 x i64> [[TMP0]], [[TMP1]]1381// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1382// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1383// CHECK-NEXT: ret <4 x i32> [[TMP2]]1384//1385v128_t test_i64x2_lt(v128_t a, v128_t b) {1386 return wasm_i64x2_lt(a, b);1387}1388 1389// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_gt(1390// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1391// CHECK-NEXT: [[ENTRY:.*:]]1392// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>1393// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x i64>1394// CHECK-NEXT: [[CMP_I:%.*]] = icmp sgt <2 x i64> [[TMP0]], [[TMP1]]1395// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1396// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1397// CHECK-NEXT: ret <4 x i32> [[TMP2]]1398//1399v128_t test_i64x2_gt(v128_t a, v128_t b) {1400 return wasm_i64x2_gt(a, b);1401}1402 1403// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_le(1404// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1405// CHECK-NEXT: [[ENTRY:.*:]]1406// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>1407// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x i64>1408// CHECK-NEXT: [[CMP_I:%.*]] = icmp sle <2 x i64> [[TMP0]], [[TMP1]]1409// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1410// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1411// CHECK-NEXT: ret <4 x i32> [[TMP2]]1412//1413v128_t test_i64x2_le(v128_t a, v128_t b) {1414 return wasm_i64x2_le(a, b);1415}1416 1417// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_ge(1418// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1419// CHECK-NEXT: [[ENTRY:.*:]]1420// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>1421// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x i64>1422// CHECK-NEXT: [[CMP_I:%.*]] = icmp sge <2 x i64> [[TMP0]], [[TMP1]]1423// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1424// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1425// CHECK-NEXT: ret <4 x i32> [[TMP2]]1426//1427v128_t test_i64x2_ge(v128_t a, v128_t b) {1428 return wasm_i64x2_ge(a, b);1429}1430 1431// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_f32x4_eq(1432// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1433// CHECK-NEXT: [[ENTRY:.*:]]1434// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>1435// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>1436// CHECK-NEXT: [[CMP_I:%.*]] = fcmp oeq <4 x float> [[TMP0]], [[TMP1]]1437// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1438// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1439//1440v128_t test_f32x4_eq(v128_t a, v128_t b) {1441 return wasm_f32x4_eq(a, b);1442}1443 1444// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_f32x4_ne(1445// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1446// CHECK-NEXT: [[ENTRY:.*:]]1447// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>1448// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>1449// CHECK-NEXT: [[CMP_I:%.*]] = fcmp une <4 x float> [[TMP0]], [[TMP1]]1450// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1451// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1452//1453v128_t test_f32x4_ne(v128_t a, v128_t b) {1454 return wasm_f32x4_ne(a, b);1455}1456 1457// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_f32x4_lt(1458// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1459// CHECK-NEXT: [[ENTRY:.*:]]1460// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>1461// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>1462// CHECK-NEXT: [[CMP_I:%.*]] = fcmp olt <4 x float> [[TMP0]], [[TMP1]]1463// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1464// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1465//1466v128_t test_f32x4_lt(v128_t a, v128_t b) {1467 return wasm_f32x4_lt(a, b);1468}1469 1470// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_f32x4_gt(1471// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1472// CHECK-NEXT: [[ENTRY:.*:]]1473// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>1474// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>1475// CHECK-NEXT: [[CMP_I:%.*]] = fcmp ogt <4 x float> [[TMP0]], [[TMP1]]1476// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1477// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1478//1479v128_t test_f32x4_gt(v128_t a, v128_t b) {1480 return wasm_f32x4_gt(a, b);1481}1482 1483// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_f32x4_le(1484// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1485// CHECK-NEXT: [[ENTRY:.*:]]1486// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>1487// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>1488// CHECK-NEXT: [[CMP_I:%.*]] = fcmp ole <4 x float> [[TMP0]], [[TMP1]]1489// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1490// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1491//1492v128_t test_f32x4_le(v128_t a, v128_t b) {1493 return wasm_f32x4_le(a, b);1494}1495 1496// CHECK-LABEL: define hidden range(i32 -1, 1) <4 x i32> @test_f32x4_ge(1497// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1498// CHECK-NEXT: [[ENTRY:.*:]]1499// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>1500// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>1501// CHECK-NEXT: [[CMP_I:%.*]] = fcmp oge <4 x float> [[TMP0]], [[TMP1]]1502// CHECK-NEXT: [[SEXT_I:%.*]] = sext <4 x i1> [[CMP_I]] to <4 x i32>1503// CHECK-NEXT: ret <4 x i32> [[SEXT_I]]1504//1505v128_t test_f32x4_ge(v128_t a, v128_t b) {1506 return wasm_f32x4_ge(a, b);1507}1508 1509// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_eq(1510// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1511// CHECK-NEXT: [[ENTRY:.*:]]1512// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>1513// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>1514// CHECK-NEXT: [[CMP_I:%.*]] = fcmp oeq <2 x double> [[TMP0]], [[TMP1]]1515// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1516// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1517// CHECK-NEXT: ret <4 x i32> [[TMP2]]1518//1519v128_t test_f64x2_eq(v128_t a, v128_t b) {1520 return wasm_f64x2_eq(a, b);1521}1522 1523// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_ne(1524// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1525// CHECK-NEXT: [[ENTRY:.*:]]1526// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>1527// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>1528// CHECK-NEXT: [[CMP_I:%.*]] = fcmp une <2 x double> [[TMP0]], [[TMP1]]1529// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1530// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1531// CHECK-NEXT: ret <4 x i32> [[TMP2]]1532//1533v128_t test_f64x2_ne(v128_t a, v128_t b) {1534 return wasm_f64x2_ne(a, b);1535}1536 1537// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_lt(1538// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1539// CHECK-NEXT: [[ENTRY:.*:]]1540// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>1541// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>1542// CHECK-NEXT: [[CMP_I:%.*]] = fcmp olt <2 x double> [[TMP0]], [[TMP1]]1543// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1544// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1545// CHECK-NEXT: ret <4 x i32> [[TMP2]]1546//1547v128_t test_f64x2_lt(v128_t a, v128_t b) {1548 return wasm_f64x2_lt(a, b);1549}1550 1551// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_gt(1552// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1553// CHECK-NEXT: [[ENTRY:.*:]]1554// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>1555// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>1556// CHECK-NEXT: [[CMP_I:%.*]] = fcmp ogt <2 x double> [[TMP0]], [[TMP1]]1557// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1558// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1559// CHECK-NEXT: ret <4 x i32> [[TMP2]]1560//1561v128_t test_f64x2_gt(v128_t a, v128_t b) {1562 return wasm_f64x2_gt(a, b);1563}1564 1565// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_le(1566// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1567// CHECK-NEXT: [[ENTRY:.*:]]1568// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>1569// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>1570// CHECK-NEXT: [[CMP_I:%.*]] = fcmp ole <2 x double> [[TMP0]], [[TMP1]]1571// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1572// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1573// CHECK-NEXT: ret <4 x i32> [[TMP2]]1574//1575v128_t test_f64x2_le(v128_t a, v128_t b) {1576 return wasm_f64x2_le(a, b);1577}1578 1579// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_ge(1580// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1581// CHECK-NEXT: [[ENTRY:.*:]]1582// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>1583// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>1584// CHECK-NEXT: [[CMP_I:%.*]] = fcmp oge <2 x double> [[TMP0]], [[TMP1]]1585// CHECK-NEXT: [[SEXT_I:%.*]] = sext <2 x i1> [[CMP_I]] to <2 x i64>1586// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SEXT_I]] to <4 x i32>1587// CHECK-NEXT: ret <4 x i32> [[TMP2]]1588//1589v128_t test_f64x2_ge(v128_t a, v128_t b) {1590 return wasm_f64x2_ge(a, b);1591}1592 1593// CHECK-LABEL: define hidden noundef <4 x i32> @test_v128_not(1594// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1595// CHECK-NEXT: [[ENTRY:.*:]]1596// CHECK-NEXT: [[NOT_I:%.*]] = xor <4 x i32> [[A]], splat (i32 -1)1597// CHECK-NEXT: ret <4 x i32> [[NOT_I]]1598//1599v128_t test_v128_not(v128_t a) {1600 return wasm_v128_not(a);1601}1602 1603// CHECK-LABEL: define hidden noundef <4 x i32> @test_v128_and(1604// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1605// CHECK-NEXT: [[ENTRY:.*:]]1606// CHECK-NEXT: [[AND_I:%.*]] = and <4 x i32> [[B]], [[A]]1607// CHECK-NEXT: ret <4 x i32> [[AND_I]]1608//1609v128_t test_v128_and(v128_t a, v128_t b) {1610 return wasm_v128_and(a, b);1611}1612 1613// CHECK-LABEL: define hidden noundef <4 x i32> @test_v128_or(1614// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1615// CHECK-NEXT: [[ENTRY:.*:]]1616// CHECK-NEXT: [[OR_I:%.*]] = or <4 x i32> [[B]], [[A]]1617// CHECK-NEXT: ret <4 x i32> [[OR_I]]1618//1619v128_t test_v128_or(v128_t a, v128_t b) {1620 return wasm_v128_or(a, b);1621}1622 1623// CHECK-LABEL: define hidden noundef <4 x i32> @test_v128_xor(1624// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1625// CHECK-NEXT: [[ENTRY:.*:]]1626// CHECK-NEXT: [[XOR_I:%.*]] = xor <4 x i32> [[B]], [[A]]1627// CHECK-NEXT: ret <4 x i32> [[XOR_I]]1628//1629v128_t test_v128_xor(v128_t a, v128_t b) {1630 return wasm_v128_xor(a, b);1631}1632 1633// CHECK-LABEL: define hidden noundef <4 x i32> @test_v128_andnot(1634// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1635// CHECK-NEXT: [[ENTRY:.*:]]1636// CHECK-NEXT: [[NOT_I:%.*]] = xor <4 x i32> [[B]], splat (i32 -1)1637// CHECK-NEXT: [[AND_I:%.*]] = and <4 x i32> [[A]], [[NOT_I]]1638// CHECK-NEXT: ret <4 x i32> [[AND_I]]1639//1640v128_t test_v128_andnot(v128_t a, v128_t b) {1641 return wasm_v128_andnot(a, b);1642}1643 1644// CHECK-LABEL: define hidden zeroext i1 @test_v128_any_true(1645// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1646// CHECK-NEXT: [[ENTRY:.*:]]1647// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1648// CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.anytrue.v16i8(<16 x i8> [[TMP0]])1649// CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP1]], 01650// CHECK-NEXT: ret i1 [[TOBOOL_I]]1651//1652bool test_v128_any_true(v128_t a) {1653 return wasm_v128_any_true(a);1654}1655 1656// CHECK-LABEL: define hidden <4 x i32> @test_v128_bitselect(1657// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]], <4 x i32> noundef [[MASK:%.*]]) local_unnamed_addr #[[ATTR2]] {1658// CHECK-NEXT: [[ENTRY:.*:]]1659// CHECK-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.wasm.bitselect.v4i32(<4 x i32> [[A]], <4 x i32> [[B]], <4 x i32> [[MASK]])1660// CHECK-NEXT: ret <4 x i32> [[TMP0]]1661//1662v128_t test_v128_bitselect(v128_t a, v128_t b, v128_t mask) {1663 return wasm_v128_bitselect(a, b, mask);1664}1665 1666// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_abs(1667// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1668// CHECK-NEXT: [[ENTRY:.*:]]1669// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1670// CHECK-NEXT: [[ABS_I:%.*]] = tail call <16 x i8> @llvm.abs.v16i8(<16 x i8> [[TMP0]], i1 false)1671// CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[ABS_I]] to <4 x i32>1672// CHECK-NEXT: ret <4 x i32> [[TMP1]]1673//1674v128_t test_i8x16_abs(v128_t a) {1675 return wasm_i8x16_abs(a);1676}1677 1678// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_neg(1679// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1680// CHECK-NEXT: [[ENTRY:.*:]]1681// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1682// CHECK-NEXT: [[SUB_I:%.*]] = sub <16 x i8> zeroinitializer, [[TMP0]]1683// CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[SUB_I]] to <4 x i32>1684// CHECK-NEXT: ret <4 x i32> [[TMP1]]1685//1686v128_t test_i8x16_neg(v128_t a) {1687 return wasm_i8x16_neg(a);1688}1689 1690// CHECK-LABEL: define hidden zeroext i1 @test_i8x16_all_true(1691// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1692// CHECK-NEXT: [[ENTRY:.*:]]1693// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1694// CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.alltrue.v16i8(<16 x i8> [[TMP0]])1695// CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP1]], 01696// CHECK-NEXT: ret i1 [[TOBOOL_I]]1697//1698bool test_i8x16_all_true(v128_t a) {1699 return wasm_i8x16_all_true(a);1700}1701 1702// CHECK-LABEL: define hidden i32 @test_i8x16_bitmask(1703// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1704// CHECK-NEXT: [[ENTRY:.*:]]1705// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1706// CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.bitmask.v16i8(<16 x i8> [[TMP0]])1707// CHECK-NEXT: ret i32 [[TMP1]]1708//1709uint32_t test_i8x16_bitmask(v128_t a) {1710 return wasm_i8x16_bitmask(a);1711}1712 1713// CHECK-LABEL: define hidden <4 x i32> @test_i8x16_popcnt(1714// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1715// CHECK-NEXT: [[ENTRY:.*:]]1716// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1717// CHECK-NEXT: [[ELT_CTPOP_I:%.*]] = tail call range(i8 0, 9) <16 x i8> @llvm.ctpop.v16i8(<16 x i8> [[TMP0]])1718// CHECK-NEXT: [[TMP1:%.*]] = bitcast <16 x i8> [[ELT_CTPOP_I]] to <4 x i32>1719// CHECK-NEXT: ret <4 x i32> [[TMP1]]1720//1721v128_t test_i8x16_popcnt(v128_t a) {1722 return wasm_i8x16_popcnt(a);1723}1724 1725// CHECK-LABEL: define hidden <4 x i32> @test_i8x16_shl(1726// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1727// CHECK-NEXT: [[ENTRY:.*:]]1728// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1729// CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B]] to i81730// CHECK-NEXT: [[TMP2:%.*]] = and i8 [[TMP1]], 71731// CHECK-NEXT: [[TMP3:%.*]] = insertelement <16 x i8> poison, i8 [[TMP2]], i64 01732// CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <16 x i8> [[TMP3]], <16 x i8> poison, <16 x i32> zeroinitializer1733// CHECK-NEXT: [[SHL_I:%.*]] = shl <16 x i8> [[TMP0]], [[SH_PROM_I]]1734// CHECK-NEXT: [[TMP4:%.*]] = bitcast <16 x i8> [[SHL_I]] to <4 x i32>1735// CHECK-NEXT: ret <4 x i32> [[TMP4]]1736//1737v128_t test_i8x16_shl(v128_t a, uint32_t b) {1738 return wasm_i8x16_shl(a, b);1739}1740 1741// CHECK-LABEL: define hidden <4 x i32> @test_i8x16_shr(1742// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1743// CHECK-NEXT: [[ENTRY:.*:]]1744// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1745// CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B]] to i81746// CHECK-NEXT: [[TMP2:%.*]] = and i8 [[TMP1]], 71747// CHECK-NEXT: [[TMP3:%.*]] = insertelement <16 x i8> poison, i8 [[TMP2]], i64 01748// CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <16 x i8> [[TMP3]], <16 x i8> poison, <16 x i32> zeroinitializer1749// CHECK-NEXT: [[SHR_I:%.*]] = ashr <16 x i8> [[TMP0]], [[SH_PROM_I]]1750// CHECK-NEXT: [[TMP4:%.*]] = bitcast <16 x i8> [[SHR_I]] to <4 x i32>1751// CHECK-NEXT: ret <4 x i32> [[TMP4]]1752//1753v128_t test_i8x16_shr(v128_t a, uint32_t b) {1754 return wasm_i8x16_shr(a, b);1755}1756 1757// CHECK-LABEL: define hidden <4 x i32> @test_u8x16_shr(1758// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1759// CHECK-NEXT: [[ENTRY:.*:]]1760// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1761// CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B]] to i81762// CHECK-NEXT: [[TMP2:%.*]] = and i8 [[TMP1]], 71763// CHECK-NEXT: [[TMP3:%.*]] = insertelement <16 x i8> poison, i8 [[TMP2]], i64 01764// CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <16 x i8> [[TMP3]], <16 x i8> poison, <16 x i32> zeroinitializer1765// CHECK-NEXT: [[SHR_I:%.*]] = lshr <16 x i8> [[TMP0]], [[SH_PROM_I]]1766// CHECK-NEXT: [[TMP4:%.*]] = bitcast <16 x i8> [[SHR_I]] to <4 x i32>1767// CHECK-NEXT: ret <4 x i32> [[TMP4]]1768//1769v128_t test_u8x16_shr(v128_t a, uint32_t b) {1770 return wasm_u8x16_shr(a, b);1771}1772 1773// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_add(1774// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1775// CHECK-NEXT: [[ENTRY:.*:]]1776// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1777// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1778// CHECK-NEXT: [[ADD_I:%.*]] = add <16 x i8> [[TMP1]], [[TMP0]]1779// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ADD_I]] to <4 x i32>1780// CHECK-NEXT: ret <4 x i32> [[TMP2]]1781//1782v128_t test_i8x16_add(v128_t a, v128_t b) {1783 return wasm_i8x16_add(a, b);1784}1785 1786// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_add_sat(1787// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1788// CHECK-NEXT: [[ENTRY:.*:]]1789// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1790// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1791// CHECK-NEXT: [[ELT_SAT_I:%.*]] = tail call <16 x i8> @llvm.sadd.sat.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])1792// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ELT_SAT_I]] to <4 x i32>1793// CHECK-NEXT: ret <4 x i32> [[TMP2]]1794//1795v128_t test_i8x16_add_sat(v128_t a, v128_t b) {1796 return wasm_i8x16_add_sat(a, b);1797}1798 1799// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_add_sat(1800// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1801// CHECK-NEXT: [[ENTRY:.*:]]1802// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1803// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1804// CHECK-NEXT: [[ELT_SAT_I:%.*]] = tail call <16 x i8> @llvm.uadd.sat.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])1805// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ELT_SAT_I]] to <4 x i32>1806// CHECK-NEXT: ret <4 x i32> [[TMP2]]1807//1808v128_t test_u8x16_add_sat(v128_t a, v128_t b) {1809 return wasm_u8x16_add_sat(a, b);1810}1811 1812// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_sub(1813// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1814// CHECK-NEXT: [[ENTRY:.*:]]1815// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1816// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1817// CHECK-NEXT: [[SUB_I:%.*]] = sub <16 x i8> [[TMP0]], [[TMP1]]1818// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[SUB_I]] to <4 x i32>1819// CHECK-NEXT: ret <4 x i32> [[TMP2]]1820//1821v128_t test_i8x16_sub(v128_t a, v128_t b) {1822 return wasm_i8x16_sub(a, b);1823}1824 1825// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_sub_sat(1826// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1827// CHECK-NEXT: [[ENTRY:.*:]]1828// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1829// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1830// CHECK-NEXT: [[ELT_SAT_I:%.*]] = tail call <16 x i8> @llvm.ssub.sat.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])1831// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ELT_SAT_I]] to <4 x i32>1832// CHECK-NEXT: ret <4 x i32> [[TMP2]]1833//1834v128_t test_i8x16_sub_sat(v128_t a, v128_t b) {1835 return wasm_i8x16_sub_sat(a, b);1836}1837 1838// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_sub_sat(1839// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1840// CHECK-NEXT: [[ENTRY:.*:]]1841// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1842// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1843// CHECK-NEXT: [[ELT_SAT_I:%.*]] = tail call <16 x i8> @llvm.usub.sat.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])1844// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ELT_SAT_I]] to <4 x i32>1845// CHECK-NEXT: ret <4 x i32> [[TMP2]]1846//1847v128_t test_u8x16_sub_sat(v128_t a, v128_t b) {1848 return wasm_u8x16_sub_sat(a, b);1849}1850 1851// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_min(1852// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1853// CHECK-NEXT: [[ENTRY:.*:]]1854// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1855// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1856// CHECK-NEXT: [[ELT_MIN_I:%.*]] = tail call <16 x i8> @llvm.smin.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])1857// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ELT_MIN_I]] to <4 x i32>1858// CHECK-NEXT: ret <4 x i32> [[TMP2]]1859//1860v128_t test_i8x16_min(v128_t a, v128_t b) {1861 return wasm_i8x16_min(a, b);1862}1863 1864// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_min(1865// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1866// CHECK-NEXT: [[ENTRY:.*:]]1867// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1868// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1869// CHECK-NEXT: [[ELT_MIN_I:%.*]] = tail call <16 x i8> @llvm.umin.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])1870// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ELT_MIN_I]] to <4 x i32>1871// CHECK-NEXT: ret <4 x i32> [[TMP2]]1872//1873v128_t test_u8x16_min(v128_t a, v128_t b) {1874 return wasm_u8x16_min(a, b);1875}1876 1877// CHECK-LABEL: define hidden noundef <4 x i32> @test_i8x16_max(1878// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1879// CHECK-NEXT: [[ENTRY:.*:]]1880// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1881// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1882// CHECK-NEXT: [[ELT_MAX_I:%.*]] = tail call <16 x i8> @llvm.smax.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])1883// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ELT_MAX_I]] to <4 x i32>1884// CHECK-NEXT: ret <4 x i32> [[TMP2]]1885//1886v128_t test_i8x16_max(v128_t a, v128_t b) {1887 return wasm_i8x16_max(a, b);1888}1889 1890// CHECK-LABEL: define hidden noundef <4 x i32> @test_u8x16_max(1891// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1892// CHECK-NEXT: [[ENTRY:.*:]]1893// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1894// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1895// CHECK-NEXT: [[ELT_MAX_I:%.*]] = tail call <16 x i8> @llvm.umax.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])1896// CHECK-NEXT: [[TMP2:%.*]] = bitcast <16 x i8> [[ELT_MAX_I]] to <4 x i32>1897// CHECK-NEXT: ret <4 x i32> [[TMP2]]1898//1899v128_t test_u8x16_max(v128_t a, v128_t b) {1900 return wasm_u8x16_max(a, b);1901}1902 1903// CHECK-LABEL: define hidden <4 x i32> @test_u8x16_avgr(1904// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1905// CHECK-NEXT: [[ENTRY:.*:]]1906// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>1907// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>1908// CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.avgr.unsigned.v16i8(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])1909// CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>1910// CHECK-NEXT: ret <4 x i32> [[TMP3]]1911//1912v128_t test_u8x16_avgr(v128_t a, v128_t b) {1913 return wasm_u8x16_avgr(a, b);1914}1915 1916// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_abs(1917// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1918// CHECK-NEXT: [[ENTRY:.*:]]1919// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1920// CHECK-NEXT: [[ABS_I:%.*]] = tail call <8 x i16> @llvm.abs.v8i16(<8 x i16> [[TMP0]], i1 false)1921// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[ABS_I]] to <4 x i32>1922// CHECK-NEXT: ret <4 x i32> [[TMP1]]1923//1924v128_t test_i16x8_abs(v128_t a) {1925 return wasm_i16x8_abs(a);1926}1927 1928// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_neg(1929// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1930// CHECK-NEXT: [[ENTRY:.*:]]1931// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1932// CHECK-NEXT: [[SUB_I:%.*]] = sub <8 x i16> zeroinitializer, [[TMP0]]1933// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[SUB_I]] to <4 x i32>1934// CHECK-NEXT: ret <4 x i32> [[TMP1]]1935//1936v128_t test_i16x8_neg(v128_t a) {1937 return wasm_i16x8_neg(a);1938}1939 1940// CHECK-LABEL: define hidden zeroext i1 @test_i16x8_all_true(1941// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1942// CHECK-NEXT: [[ENTRY:.*:]]1943// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1944// CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.alltrue.v8i16(<8 x i16> [[TMP0]])1945// CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP1]], 01946// CHECK-NEXT: ret i1 [[TOBOOL_I]]1947//1948bool test_i16x8_all_true(v128_t a) {1949 return wasm_i16x8_all_true(a);1950}1951 1952// CHECK-LABEL: define hidden i32 @test_i16x8_bitmask(1953// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {1954// CHECK-NEXT: [[ENTRY:.*:]]1955// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1956// CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.bitmask.v8i16(<8 x i16> [[TMP0]])1957// CHECK-NEXT: ret i32 [[TMP1]]1958//1959uint32_t test_i16x8_bitmask(v128_t a) {1960 return wasm_i16x8_bitmask(a);1961}1962 1963// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_shl(1964// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1965// CHECK-NEXT: [[ENTRY:.*:]]1966// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1967// CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B]] to i161968// CHECK-NEXT: [[TMP2:%.*]] = and i16 [[TMP1]], 151969// CHECK-NEXT: [[TMP3:%.*]] = insertelement <8 x i16> poison, i16 [[TMP2]], i64 01970// CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <8 x i16> [[TMP3]], <8 x i16> poison, <8 x i32> zeroinitializer1971// CHECK-NEXT: [[SHL_I:%.*]] = shl <8 x i16> [[TMP0]], [[SH_PROM_I]]1972// CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x i16> [[SHL_I]] to <4 x i32>1973// CHECK-NEXT: ret <4 x i32> [[TMP4]]1974//1975v128_t test_i16x8_shl(v128_t a, uint32_t b) {1976 return wasm_i16x8_shl(a, b);1977}1978 1979// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_shr(1980// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1981// CHECK-NEXT: [[ENTRY:.*:]]1982// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1983// CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B]] to i161984// CHECK-NEXT: [[TMP2:%.*]] = and i16 [[TMP1]], 151985// CHECK-NEXT: [[TMP3:%.*]] = insertelement <8 x i16> poison, i16 [[TMP2]], i64 01986// CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <8 x i16> [[TMP3]], <8 x i16> poison, <8 x i32> zeroinitializer1987// CHECK-NEXT: [[SHR_I:%.*]] = ashr <8 x i16> [[TMP0]], [[SH_PROM_I]]1988// CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x i16> [[SHR_I]] to <4 x i32>1989// CHECK-NEXT: ret <4 x i32> [[TMP4]]1990//1991v128_t test_i16x8_shr(v128_t a, uint32_t b) {1992 return wasm_i16x8_shr(a, b);1993}1994 1995// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_shr(1996// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {1997// CHECK-NEXT: [[ENTRY:.*:]]1998// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>1999// CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[B]] to i162000// CHECK-NEXT: [[TMP2:%.*]] = and i16 [[TMP1]], 152001// CHECK-NEXT: [[TMP3:%.*]] = insertelement <8 x i16> poison, i16 [[TMP2]], i64 02002// CHECK-NEXT: [[SH_PROM_I:%.*]] = shufflevector <8 x i16> [[TMP3]], <8 x i16> poison, <8 x i32> zeroinitializer2003// CHECK-NEXT: [[SHR_I:%.*]] = lshr <8 x i16> [[TMP0]], [[SH_PROM_I]]2004// CHECK-NEXT: [[TMP4:%.*]] = bitcast <8 x i16> [[SHR_I]] to <4 x i32>2005// CHECK-NEXT: ret <4 x i32> [[TMP4]]2006//2007v128_t test_u16x8_shr(v128_t a, uint32_t b) {2008 return wasm_u16x8_shr(a, b);2009}2010 2011// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_add(2012// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2013// CHECK-NEXT: [[ENTRY:.*:]]2014// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2015// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2016// CHECK-NEXT: [[ADD_I:%.*]] = add <8 x i16> [[TMP1]], [[TMP0]]2017// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ADD_I]] to <4 x i32>2018// CHECK-NEXT: ret <4 x i32> [[TMP2]]2019//2020v128_t test_i16x8_add(v128_t a, v128_t b) {2021 return wasm_i16x8_add(a, b);2022}2023 2024// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_add_sat(2025// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2026// CHECK-NEXT: [[ENTRY:.*:]]2027// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2028// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2029// CHECK-NEXT: [[ELT_SAT_I:%.*]] = tail call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2030// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ELT_SAT_I]] to <4 x i32>2031// CHECK-NEXT: ret <4 x i32> [[TMP2]]2032//2033v128_t test_i16x8_add_sat(v128_t a, v128_t b) {2034 return wasm_i16x8_add_sat(a, b);2035}2036 2037// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_add_sat(2038// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2039// CHECK-NEXT: [[ENTRY:.*:]]2040// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2041// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2042// CHECK-NEXT: [[ELT_SAT_I:%.*]] = tail call <8 x i16> @llvm.uadd.sat.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2043// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ELT_SAT_I]] to <4 x i32>2044// CHECK-NEXT: ret <4 x i32> [[TMP2]]2045//2046v128_t test_u16x8_add_sat(v128_t a, v128_t b) {2047 return wasm_u16x8_add_sat(a, b);2048}2049 2050// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_sub(2051// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2052// CHECK-NEXT: [[ENTRY:.*:]]2053// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2054// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2055// CHECK-NEXT: [[SUB_I:%.*]] = sub <8 x i16> [[TMP0]], [[TMP1]]2056// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[SUB_I]] to <4 x i32>2057// CHECK-NEXT: ret <4 x i32> [[TMP2]]2058//2059v128_t test_i16x8_sub(v128_t a, v128_t b) {2060 return wasm_i16x8_sub(a, b);2061}2062 2063// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_sub_sat(2064// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2065// CHECK-NEXT: [[ENTRY:.*:]]2066// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2067// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2068// CHECK-NEXT: [[ELT_SAT_I:%.*]] = tail call <8 x i16> @llvm.ssub.sat.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2069// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ELT_SAT_I]] to <4 x i32>2070// CHECK-NEXT: ret <4 x i32> [[TMP2]]2071//2072v128_t test_i16x8_sub_sat(v128_t a, v128_t b) {2073 return wasm_i16x8_sub_sat(a, b);2074}2075 2076// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_sub_sat(2077// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2078// CHECK-NEXT: [[ENTRY:.*:]]2079// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2080// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2081// CHECK-NEXT: [[ELT_SAT_I:%.*]] = tail call <8 x i16> @llvm.usub.sat.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2082// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ELT_SAT_I]] to <4 x i32>2083// CHECK-NEXT: ret <4 x i32> [[TMP2]]2084//2085v128_t test_u16x8_sub_sat(v128_t a, v128_t b) {2086 return wasm_u16x8_sub_sat(a, b);2087}2088 2089// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_mul(2090// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2091// CHECK-NEXT: [[ENTRY:.*:]]2092// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2093// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2094// CHECK-NEXT: [[MUL_I:%.*]] = mul <8 x i16> [[TMP1]], [[TMP0]]2095// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32>2096// CHECK-NEXT: ret <4 x i32> [[TMP2]]2097//2098v128_t test_i16x8_mul(v128_t a, v128_t b) {2099 return wasm_i16x8_mul(a, b);2100}2101 2102// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_min(2103// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2104// CHECK-NEXT: [[ENTRY:.*:]]2105// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2106// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2107// CHECK-NEXT: [[ELT_MIN_I:%.*]] = tail call <8 x i16> @llvm.smin.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2108// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ELT_MIN_I]] to <4 x i32>2109// CHECK-NEXT: ret <4 x i32> [[TMP2]]2110//2111v128_t test_i16x8_min(v128_t a, v128_t b) {2112 return wasm_i16x8_min(a, b);2113}2114 2115// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_min(2116// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2117// CHECK-NEXT: [[ENTRY:.*:]]2118// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2119// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2120// CHECK-NEXT: [[ELT_MIN_I:%.*]] = tail call <8 x i16> @llvm.umin.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2121// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ELT_MIN_I]] to <4 x i32>2122// CHECK-NEXT: ret <4 x i32> [[TMP2]]2123//2124v128_t test_u16x8_min(v128_t a, v128_t b) {2125 return wasm_u16x8_min(a, b);2126}2127 2128// CHECK-LABEL: define hidden noundef <4 x i32> @test_i16x8_max(2129// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2130// CHECK-NEXT: [[ENTRY:.*:]]2131// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2132// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2133// CHECK-NEXT: [[ELT_MAX_I:%.*]] = tail call <8 x i16> @llvm.smax.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2134// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ELT_MAX_I]] to <4 x i32>2135// CHECK-NEXT: ret <4 x i32> [[TMP2]]2136//2137v128_t test_i16x8_max(v128_t a, v128_t b) {2138 return wasm_i16x8_max(a, b);2139}2140 2141// CHECK-LABEL: define hidden noundef <4 x i32> @test_u16x8_max(2142// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2143// CHECK-NEXT: [[ENTRY:.*:]]2144// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2145// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2146// CHECK-NEXT: [[ELT_MAX_I:%.*]] = tail call <8 x i16> @llvm.umax.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2147// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[ELT_MAX_I]] to <4 x i32>2148// CHECK-NEXT: ret <4 x i32> [[TMP2]]2149//2150v128_t test_u16x8_max(v128_t a, v128_t b) {2151 return wasm_u16x8_max(a, b);2152}2153 2154// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_avgr(2155// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2156// CHECK-NEXT: [[ENTRY:.*:]]2157// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2158// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2159// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.wasm.avgr.unsigned.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2160// CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32>2161// CHECK-NEXT: ret <4 x i32> [[TMP3]]2162//2163v128_t test_u16x8_avgr(v128_t a, v128_t b) {2164 return wasm_u16x8_avgr(a, b);2165}2166 2167// CHECK-LABEL: define hidden noundef range(i32 0, -2147483647) <4 x i32> @test_i32x4_abs(2168// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2169// CHECK-NEXT: [[ENTRY:.*:]]2170// CHECK-NEXT: [[ABS_I:%.*]] = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> [[A]], i1 false)2171// CHECK-NEXT: ret <4 x i32> [[ABS_I]]2172//2173v128_t test_i32x4_abs(v128_t a) {2174 return wasm_i32x4_abs(a);2175}2176 2177// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_neg(2178// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2179// CHECK-NEXT: [[ENTRY:.*:]]2180// CHECK-NEXT: [[SUB_I:%.*]] = sub <4 x i32> zeroinitializer, [[A]]2181// CHECK-NEXT: ret <4 x i32> [[SUB_I]]2182//2183v128_t test_i32x4_neg(v128_t a) {2184 return wasm_i32x4_neg(a);2185}2186 2187// CHECK-LABEL: define hidden zeroext i1 @test_i32x4_all_true(2188// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2189// CHECK-NEXT: [[ENTRY:.*:]]2190// CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.wasm.alltrue.v4i32(<4 x i32> [[A]])2191// CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP0]], 02192// CHECK-NEXT: ret i1 [[TOBOOL_I]]2193//2194bool test_i32x4_all_true(v128_t a) {2195 return wasm_i32x4_all_true(a);2196}2197 2198// CHECK-LABEL: define hidden i32 @test_i32x4_bitmask(2199// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2200// CHECK-NEXT: [[ENTRY:.*:]]2201// CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.wasm.bitmask.v4i32(<4 x i32> [[A]])2202// CHECK-NEXT: ret i32 [[TMP0]]2203//2204uint32_t test_i32x4_bitmask(v128_t a) {2205 return wasm_i32x4_bitmask(a);2206}2207 2208// CHECK-LABEL: define hidden <4 x i32> @test_i32x4_shl(2209// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2210// CHECK-NEXT: [[ENTRY:.*:]]2211// CHECK-NEXT: [[AND_I:%.*]] = and i32 [[B]], 312212// CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <4 x i32> poison, i32 [[AND_I]], i64 02213// CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <4 x i32> [[SPLAT_SPLATINSERT_I]], <4 x i32> poison, <4 x i32> zeroinitializer2214// CHECK-NEXT: [[SHL_I:%.*]] = shl <4 x i32> [[A]], [[SPLAT_SPLAT_I]]2215// CHECK-NEXT: ret <4 x i32> [[SHL_I]]2216//2217v128_t test_i32x4_shl(v128_t a, uint32_t b) {2218 return wasm_i32x4_shl(a, b);2219}2220 2221// CHECK-LABEL: define hidden <4 x i32> @test_i32x4_shr(2222// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2223// CHECK-NEXT: [[ENTRY:.*:]]2224// CHECK-NEXT: [[AND_I:%.*]] = and i32 [[B]], 312225// CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <4 x i32> poison, i32 [[AND_I]], i64 02226// CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <4 x i32> [[SPLAT_SPLATINSERT_I]], <4 x i32> poison, <4 x i32> zeroinitializer2227// CHECK-NEXT: [[SHR_I:%.*]] = ashr <4 x i32> [[A]], [[SPLAT_SPLAT_I]]2228// CHECK-NEXT: ret <4 x i32> [[SHR_I]]2229//2230v128_t test_i32x4_shr(v128_t a, uint32_t b) {2231 return wasm_i32x4_shr(a, b);2232}2233 2234// CHECK-LABEL: define hidden <4 x i32> @test_u32x4_shr(2235// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2236// CHECK-NEXT: [[ENTRY:.*:]]2237// CHECK-NEXT: [[AND_I:%.*]] = and i32 [[B]], 312238// CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <4 x i32> poison, i32 [[AND_I]], i64 02239// CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <4 x i32> [[SPLAT_SPLATINSERT_I]], <4 x i32> poison, <4 x i32> zeroinitializer2240// CHECK-NEXT: [[SHR_I:%.*]] = lshr <4 x i32> [[A]], [[SPLAT_SPLAT_I]]2241// CHECK-NEXT: ret <4 x i32> [[SHR_I]]2242//2243v128_t test_u32x4_shr(v128_t a, uint32_t b) {2244 return wasm_u32x4_shr(a, b);2245}2246 2247// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_add(2248// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2249// CHECK-NEXT: [[ENTRY:.*:]]2250// CHECK-NEXT: [[ADD_I:%.*]] = add <4 x i32> [[B]], [[A]]2251// CHECK-NEXT: ret <4 x i32> [[ADD_I]]2252//2253v128_t test_i32x4_add(v128_t a, v128_t b) {2254 return wasm_i32x4_add(a, b);2255}2256 2257// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_sub(2258// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2259// CHECK-NEXT: [[ENTRY:.*:]]2260// CHECK-NEXT: [[SUB_I:%.*]] = sub <4 x i32> [[A]], [[B]]2261// CHECK-NEXT: ret <4 x i32> [[SUB_I]]2262//2263v128_t test_i32x4_sub(v128_t a, v128_t b) {2264 return wasm_i32x4_sub(a, b);2265}2266 2267// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_mul(2268// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2269// CHECK-NEXT: [[ENTRY:.*:]]2270// CHECK-NEXT: [[MUL_I:%.*]] = mul <4 x i32> [[B]], [[A]]2271// CHECK-NEXT: ret <4 x i32> [[MUL_I]]2272//2273v128_t test_i32x4_mul(v128_t a, v128_t b) {2274 return wasm_i32x4_mul(a, b);2275}2276 2277// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_min(2278// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2279// CHECK-NEXT: [[ENTRY:.*:]]2280// CHECK-NEXT: [[ELT_MIN_I:%.*]] = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> [[A]], <4 x i32> [[B]])2281// CHECK-NEXT: ret <4 x i32> [[ELT_MIN_I]]2282//2283v128_t test_i32x4_min(v128_t a, v128_t b) {2284 return wasm_i32x4_min(a, b);2285}2286 2287// CHECK-LABEL: define hidden noundef <4 x i32> @test_u32x4_min(2288// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2289// CHECK-NEXT: [[ENTRY:.*:]]2290// CHECK-NEXT: [[ELT_MIN_I:%.*]] = tail call <4 x i32> @llvm.umin.v4i32(<4 x i32> [[A]], <4 x i32> [[B]])2291// CHECK-NEXT: ret <4 x i32> [[ELT_MIN_I]]2292//2293v128_t test_u32x4_min(v128_t a, v128_t b) {2294 return wasm_u32x4_min(a, b);2295}2296 2297// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_max(2298// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2299// CHECK-NEXT: [[ENTRY:.*:]]2300// CHECK-NEXT: [[ELT_MAX_I:%.*]] = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> [[A]], <4 x i32> [[B]])2301// CHECK-NEXT: ret <4 x i32> [[ELT_MAX_I]]2302//2303v128_t test_i32x4_max(v128_t a, v128_t b) {2304 return wasm_i32x4_max(a, b);2305}2306 2307// CHECK-LABEL: define hidden noundef <4 x i32> @test_u32x4_max(2308// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2309// CHECK-NEXT: [[ENTRY:.*:]]2310// CHECK-NEXT: [[ELT_MAX_I:%.*]] = tail call <4 x i32> @llvm.umax.v4i32(<4 x i32> [[A]], <4 x i32> [[B]])2311// CHECK-NEXT: ret <4 x i32> [[ELT_MAX_I]]2312//2313v128_t test_u32x4_max(v128_t a, v128_t b) {2314 return wasm_u32x4_max(a, b);2315}2316 2317// CHECK-LABEL: define hidden <4 x i32> @test_i32x4_dot_i16x8(2318// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2319// CHECK-NEXT: [[ENTRY:.*:]]2320// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>2321// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>2322// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x i32> @llvm.wasm.dot(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])2323// CHECK-NEXT: ret <4 x i32> [[TMP2]]2324//2325v128_t test_i32x4_dot_i16x8(v128_t a, v128_t b) {2326 return wasm_i32x4_dot_i16x8(a, b);2327}2328 2329// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_abs(2330// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2331// CHECK-NEXT: [[ENTRY:.*:]]2332// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2333// CHECK-NEXT: [[ABS_I:%.*]] = tail call <2 x i64> @llvm.abs.v2i64(<2 x i64> [[TMP0]], i1 false)2334// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[ABS_I]] to <4 x i32>2335// CHECK-NEXT: ret <4 x i32> [[TMP1]]2336//2337v128_t test_i64x2_abs(v128_t a) {2338 return wasm_i64x2_abs(a);2339}2340 2341// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_neg(2342// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2343// CHECK-NEXT: [[ENTRY:.*:]]2344// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2345// CHECK-NEXT: [[SUB_I:%.*]] = sub <2 x i64> zeroinitializer, [[TMP0]]2346// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[SUB_I]] to <4 x i32>2347// CHECK-NEXT: ret <4 x i32> [[TMP1]]2348//2349v128_t test_i64x2_neg(v128_t a) {2350 return wasm_i64x2_neg(a);2351}2352 2353// CHECK-LABEL: define hidden zeroext i1 @test_i64x2_all_true(2354// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2355// CHECK-NEXT: [[ENTRY:.*:]]2356// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2357// CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.alltrue.v2i64(<2 x i64> [[TMP0]])2358// CHECK-NEXT: [[TOBOOL_I:%.*]] = icmp ne i32 [[TMP1]], 02359// CHECK-NEXT: ret i1 [[TOBOOL_I]]2360//2361bool test_i64x2_all_true(v128_t a) {2362 return wasm_i64x2_all_true(a);2363}2364 2365// CHECK-LABEL: define hidden i32 @test_i64x2_bitmask(2366// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2367// CHECK-NEXT: [[ENTRY:.*:]]2368// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2369// CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @llvm.wasm.bitmask.v2i64(<2 x i64> [[TMP0]])2370// CHECK-NEXT: ret i32 [[TMP1]]2371//2372uint32_t test_i64x2_bitmask(v128_t a) {2373 return wasm_i64x2_bitmask(a);2374}2375 2376// CHECK-LABEL: define hidden <4 x i32> @test_i64x2_shl(2377// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2378// CHECK-NEXT: [[ENTRY:.*:]]2379// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2380// CHECK-NEXT: [[TMP1:%.*]] = and i32 [[B]], 632381// CHECK-NEXT: [[AND_I:%.*]] = zext nneg i32 [[TMP1]] to i642382// CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <2 x i64> poison, i64 [[AND_I]], i64 02383// CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <2 x i64> [[SPLAT_SPLATINSERT_I]], <2 x i64> poison, <2 x i32> zeroinitializer2384// CHECK-NEXT: [[SHL_I:%.*]] = shl <2 x i64> [[TMP0]], [[SPLAT_SPLAT_I]]2385// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SHL_I]] to <4 x i32>2386// CHECK-NEXT: ret <4 x i32> [[TMP2]]2387//2388v128_t test_i64x2_shl(v128_t a, uint32_t b) {2389 return wasm_i64x2_shl(a, b);2390}2391 2392// CHECK-LABEL: define hidden <4 x i32> @test_i64x2_shr(2393// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2394// CHECK-NEXT: [[ENTRY:.*:]]2395// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2396// CHECK-NEXT: [[TMP1:%.*]] = and i32 [[B]], 632397// CHECK-NEXT: [[AND_I:%.*]] = zext nneg i32 [[TMP1]] to i642398// CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <2 x i64> poison, i64 [[AND_I]], i64 02399// CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <2 x i64> [[SPLAT_SPLATINSERT_I]], <2 x i64> poison, <2 x i32> zeroinitializer2400// CHECK-NEXT: [[SHR_I:%.*]] = ashr <2 x i64> [[TMP0]], [[SPLAT_SPLAT_I]]2401// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SHR_I]] to <4 x i32>2402// CHECK-NEXT: ret <4 x i32> [[TMP2]]2403//2404v128_t test_i64x2_shr(v128_t a, uint32_t b) {2405 return wasm_i64x2_shr(a, b);2406}2407 2408// CHECK-LABEL: define hidden <4 x i32> @test_u64x2_shr(2409// CHECK-SAME: <4 x i32> noundef [[A:%.*]], i32 noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2410// CHECK-NEXT: [[ENTRY:.*:]]2411// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2412// CHECK-NEXT: [[TMP1:%.*]] = and i32 [[B]], 632413// CHECK-NEXT: [[AND_I:%.*]] = zext nneg i32 [[TMP1]] to i642414// CHECK-NEXT: [[SPLAT_SPLATINSERT_I:%.*]] = insertelement <2 x i64> poison, i64 [[AND_I]], i64 02415// CHECK-NEXT: [[SPLAT_SPLAT_I:%.*]] = shufflevector <2 x i64> [[SPLAT_SPLATINSERT_I]], <2 x i64> poison, <2 x i32> zeroinitializer2416// CHECK-NEXT: [[SHR_I:%.*]] = lshr <2 x i64> [[TMP0]], [[SPLAT_SPLAT_I]]2417// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SHR_I]] to <4 x i32>2418// CHECK-NEXT: ret <4 x i32> [[TMP2]]2419//2420v128_t test_u64x2_shr(v128_t a, uint32_t b) {2421 return wasm_u64x2_shr(a, b);2422}2423 2424// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_add(2425// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2426// CHECK-NEXT: [[ENTRY:.*:]]2427// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2428// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x i64>2429// CHECK-NEXT: [[ADD_I:%.*]] = add <2 x i64> [[TMP1]], [[TMP0]]2430// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[ADD_I]] to <4 x i32>2431// CHECK-NEXT: ret <4 x i32> [[TMP2]]2432//2433v128_t test_i64x2_add(v128_t a, v128_t b) {2434 return wasm_i64x2_add(a, b);2435}2436 2437// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_sub(2438// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2439// CHECK-NEXT: [[ENTRY:.*:]]2440// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2441// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x i64>2442// CHECK-NEXT: [[SUB_I:%.*]] = sub <2 x i64> [[TMP0]], [[TMP1]]2443// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[SUB_I]] to <4 x i32>2444// CHECK-NEXT: ret <4 x i32> [[TMP2]]2445//2446v128_t test_i64x2_sub(v128_t a, v128_t b) {2447 return wasm_i64x2_sub(a, b);2448}2449 2450// CHECK-LABEL: define hidden noundef <4 x i32> @test_i64x2_mul(2451// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2452// CHECK-NEXT: [[ENTRY:.*:]]2453// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x i64>2454// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x i64>2455// CHECK-NEXT: [[MUL_I:%.*]] = mul <2 x i64> [[TMP1]], [[TMP0]]2456// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32>2457// CHECK-NEXT: ret <4 x i32> [[TMP2]]2458//2459v128_t test_i64x2_mul(v128_t a, v128_t b) {2460 return wasm_i64x2_mul(a, b);2461}2462 2463// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_abs(2464// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2465// CHECK-NEXT: [[ENTRY:.*:]]2466// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2467// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> [[TMP0]])2468// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32>2469// CHECK-NEXT: ret <4 x i32> [[TMP2]]2470//2471v128_t test_f32x4_abs(v128_t a) {2472 return wasm_f32x4_abs(a);2473}2474 2475// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_neg(2476// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2477// CHECK-NEXT: [[ENTRY:.*:]]2478// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2479// CHECK-NEXT: [[FNEG_I:%.*]] = fneg <4 x float> [[TMP0]]2480// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[FNEG_I]] to <4 x i32>2481// CHECK-NEXT: ret <4 x i32> [[TMP1]]2482//2483v128_t test_f32x4_neg(v128_t a) {2484 return wasm_f32x4_neg(a);2485}2486 2487// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_sqrt(2488// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2489// CHECK-NEXT: [[ENTRY:.*:]]2490// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2491// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.sqrt.v4f32(<4 x float> [[TMP0]])2492// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32>2493// CHECK-NEXT: ret <4 x i32> [[TMP2]]2494//2495v128_t test_f32x4_sqrt(v128_t a) {2496 return wasm_f32x4_sqrt(a);2497}2498 2499// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_ceil(2500// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2501// CHECK-NEXT: [[ENTRY:.*:]]2502// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2503// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.ceil.v4f32(<4 x float> [[TMP0]])2504// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32>2505// CHECK-NEXT: ret <4 x i32> [[TMP2]]2506//2507v128_t test_f32x4_ceil(v128_t a) {2508 return wasm_f32x4_ceil(a);2509}2510 2511// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_floor(2512// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2513// CHECK-NEXT: [[ENTRY:.*:]]2514// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2515// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.floor.v4f32(<4 x float> [[TMP0]])2516// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32>2517// CHECK-NEXT: ret <4 x i32> [[TMP2]]2518//2519v128_t test_f32x4_floor(v128_t a) {2520 return wasm_f32x4_floor(a);2521}2522 2523// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_trunc(2524// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2525// CHECK-NEXT: [[ENTRY:.*:]]2526// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2527// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.trunc.v4f32(<4 x float> [[TMP0]])2528// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32>2529// CHECK-NEXT: ret <4 x i32> [[TMP2]]2530//2531v128_t test_f32x4_trunc(v128_t a) {2532 return wasm_f32x4_trunc(a);2533}2534 2535// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_nearest(2536// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2537// CHECK-NEXT: [[ENTRY:.*:]]2538// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2539// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x float> @llvm.nearbyint.v4f32(<4 x float> [[TMP0]])2540// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[TMP1]] to <4 x i32>2541// CHECK-NEXT: ret <4 x i32> [[TMP2]]2542//2543v128_t test_f32x4_nearest(v128_t a) {2544 return wasm_f32x4_nearest(a);2545}2546 2547// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_add(2548// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2549// CHECK-NEXT: [[ENTRY:.*:]]2550// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2551// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>2552// CHECK-NEXT: [[ADD_I:%.*]] = fadd <4 x float> [[TMP0]], [[TMP1]]2553// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[ADD_I]] to <4 x i32>2554// CHECK-NEXT: ret <4 x i32> [[TMP2]]2555//2556v128_t test_f32x4_add(v128_t a, v128_t b) {2557 return wasm_f32x4_add(a, b);2558}2559 2560// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_sub(2561// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2562// CHECK-NEXT: [[ENTRY:.*:]]2563// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2564// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>2565// CHECK-NEXT: [[SUB_I:%.*]] = fsub <4 x float> [[TMP0]], [[TMP1]]2566// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[SUB_I]] to <4 x i32>2567// CHECK-NEXT: ret <4 x i32> [[TMP2]]2568//2569v128_t test_f32x4_sub(v128_t a, v128_t b) {2570 return wasm_f32x4_sub(a, b);2571}2572 2573// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_mul(2574// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2575// CHECK-NEXT: [[ENTRY:.*:]]2576// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2577// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>2578// CHECK-NEXT: [[MUL_I:%.*]] = fmul <4 x float> [[TMP0]], [[TMP1]]2579// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[MUL_I]] to <4 x i32>2580// CHECK-NEXT: ret <4 x i32> [[TMP2]]2581//2582v128_t test_f32x4_mul(v128_t a, v128_t b) {2583 return wasm_f32x4_mul(a, b);2584}2585 2586// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_div(2587// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2588// CHECK-NEXT: [[ENTRY:.*:]]2589// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2590// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>2591// CHECK-NEXT: [[DIV_I:%.*]] = fdiv <4 x float> [[TMP0]], [[TMP1]]2592// CHECK-NEXT: [[TMP2:%.*]] = bitcast <4 x float> [[DIV_I]] to <4 x i32>2593// CHECK-NEXT: ret <4 x i32> [[TMP2]]2594//2595v128_t test_f32x4_div(v128_t a, v128_t b) {2596 return wasm_f32x4_div(a, b);2597}2598 2599// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_min(2600// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2601// CHECK-NEXT: [[ENTRY:.*:]]2602// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2603// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>2604// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.minimum.v4f32(<4 x float> [[TMP0]], <4 x float> [[TMP1]])2605// CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32>2606// CHECK-NEXT: ret <4 x i32> [[TMP3]]2607//2608v128_t test_f32x4_min(v128_t a, v128_t b) {2609 return wasm_f32x4_min(a, b);2610}2611 2612// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_max(2613// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2614// CHECK-NEXT: [[ENTRY:.*:]]2615// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2616// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>2617// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.maximum.v4f32(<4 x float> [[TMP0]], <4 x float> [[TMP1]])2618// CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32>2619// CHECK-NEXT: ret <4 x i32> [[TMP3]]2620//2621v128_t test_f32x4_max(v128_t a, v128_t b) {2622 return wasm_f32x4_max(a, b);2623}2624 2625// CHECK-LABEL: define hidden <4 x i32> @test_f32x4_pmin(2626// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2627// CHECK-NEXT: [[ENTRY:.*:]]2628// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2629// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>2630// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.wasm.pmin.v4f32(<4 x float> [[TMP0]], <4 x float> [[TMP1]])2631// CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32>2632// CHECK-NEXT: ret <4 x i32> [[TMP3]]2633//2634v128_t test_f32x4_pmin(v128_t a, v128_t b) {2635 return wasm_f32x4_pmin(a, b);2636}2637 2638// CHECK-LABEL: define hidden <4 x i32> @test_f32x4_pmax(2639// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2640// CHECK-NEXT: [[ENTRY:.*:]]2641// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2642// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <4 x float>2643// CHECK-NEXT: [[TMP2:%.*]] = tail call <4 x float> @llvm.wasm.pmax.v4f32(<4 x float> [[TMP0]], <4 x float> [[TMP1]])2644// CHECK-NEXT: [[TMP3:%.*]] = bitcast <4 x float> [[TMP2]] to <4 x i32>2645// CHECK-NEXT: ret <4 x i32> [[TMP3]]2646//2647v128_t test_f32x4_pmax(v128_t a, v128_t b) {2648 return wasm_f32x4_pmax(a, b);2649}2650 2651// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_abs(2652// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2653// CHECK-NEXT: [[ENTRY:.*:]]2654// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2655// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> [[TMP0]])2656// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32>2657// CHECK-NEXT: ret <4 x i32> [[TMP2]]2658//2659v128_t test_f64x2_abs(v128_t a) {2660 return wasm_f64x2_abs(a);2661}2662 2663// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_neg(2664// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2665// CHECK-NEXT: [[ENTRY:.*:]]2666// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2667// CHECK-NEXT: [[FNEG_I:%.*]] = fneg <2 x double> [[TMP0]]2668// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x double> [[FNEG_I]] to <4 x i32>2669// CHECK-NEXT: ret <4 x i32> [[TMP1]]2670//2671v128_t test_f64x2_neg(v128_t a) {2672 return wasm_f64x2_neg(a);2673}2674 2675// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_sqrt(2676// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2677// CHECK-NEXT: [[ENTRY:.*:]]2678// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2679// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> [[TMP0]])2680// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32>2681// CHECK-NEXT: ret <4 x i32> [[TMP2]]2682//2683v128_t test_f64x2_sqrt(v128_t a) {2684 return wasm_f64x2_sqrt(a);2685}2686 2687// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_ceil(2688// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2689// CHECK-NEXT: [[ENTRY:.*:]]2690// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2691// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.ceil.v2f64(<2 x double> [[TMP0]])2692// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32>2693// CHECK-NEXT: ret <4 x i32> [[TMP2]]2694//2695v128_t test_f64x2_ceil(v128_t a) {2696 return wasm_f64x2_ceil(a);2697}2698 2699// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_floor(2700// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2701// CHECK-NEXT: [[ENTRY:.*:]]2702// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2703// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.floor.v2f64(<2 x double> [[TMP0]])2704// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32>2705// CHECK-NEXT: ret <4 x i32> [[TMP2]]2706//2707v128_t test_f64x2_floor(v128_t a) {2708 return wasm_f64x2_floor(a);2709}2710 2711// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_trunc(2712// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2713// CHECK-NEXT: [[ENTRY:.*:]]2714// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2715// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.trunc.v2f64(<2 x double> [[TMP0]])2716// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32>2717// CHECK-NEXT: ret <4 x i32> [[TMP2]]2718//2719v128_t test_f64x2_trunc(v128_t a) {2720 return wasm_f64x2_trunc(a);2721}2722 2723// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_nearest(2724// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2725// CHECK-NEXT: [[ENTRY:.*:]]2726// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2727// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x double> @llvm.nearbyint.v2f64(<2 x double> [[TMP0]])2728// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[TMP1]] to <4 x i32>2729// CHECK-NEXT: ret <4 x i32> [[TMP2]]2730//2731v128_t test_f64x2_nearest(v128_t a) {2732 return wasm_f64x2_nearest(a);2733}2734 2735// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_add(2736// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2737// CHECK-NEXT: [[ENTRY:.*:]]2738// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2739// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>2740// CHECK-NEXT: [[ADD_I:%.*]] = fadd <2 x double> [[TMP0]], [[TMP1]]2741// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[ADD_I]] to <4 x i32>2742// CHECK-NEXT: ret <4 x i32> [[TMP2]]2743//2744v128_t test_f64x2_add(v128_t a, v128_t b) {2745 return wasm_f64x2_add(a, b);2746}2747 2748// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_sub(2749// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2750// CHECK-NEXT: [[ENTRY:.*:]]2751// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2752// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>2753// CHECK-NEXT: [[SUB_I:%.*]] = fsub <2 x double> [[TMP0]], [[TMP1]]2754// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[SUB_I]] to <4 x i32>2755// CHECK-NEXT: ret <4 x i32> [[TMP2]]2756//2757v128_t test_f64x2_sub(v128_t a, v128_t b) {2758 return wasm_f64x2_sub(a, b);2759}2760 2761// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_mul(2762// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2763// CHECK-NEXT: [[ENTRY:.*:]]2764// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2765// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>2766// CHECK-NEXT: [[MUL_I:%.*]] = fmul <2 x double> [[TMP0]], [[TMP1]]2767// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[MUL_I]] to <4 x i32>2768// CHECK-NEXT: ret <4 x i32> [[TMP2]]2769//2770v128_t test_f64x2_mul(v128_t a, v128_t b) {2771 return wasm_f64x2_mul(a, b);2772}2773 2774// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_div(2775// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2776// CHECK-NEXT: [[ENTRY:.*:]]2777// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2778// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>2779// CHECK-NEXT: [[DIV_I:%.*]] = fdiv <2 x double> [[TMP0]], [[TMP1]]2780// CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x double> [[DIV_I]] to <4 x i32>2781// CHECK-NEXT: ret <4 x i32> [[TMP2]]2782//2783v128_t test_f64x2_div(v128_t a, v128_t b) {2784 return wasm_f64x2_div(a, b);2785}2786 2787// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_min(2788// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2789// CHECK-NEXT: [[ENTRY:.*:]]2790// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2791// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>2792// CHECK-NEXT: [[TMP2:%.*]] = tail call <2 x double> @llvm.minimum.v2f64(<2 x double> [[TMP0]], <2 x double> [[TMP1]])2793// CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <4 x i32>2794// CHECK-NEXT: ret <4 x i32> [[TMP3]]2795//2796v128_t test_f64x2_min(v128_t a, v128_t b) {2797 return wasm_f64x2_min(a, b);2798}2799 2800// CHECK-LABEL: define hidden noundef <4 x i32> @test_f64x2_max(2801// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2802// CHECK-NEXT: [[ENTRY:.*:]]2803// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2804// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>2805// CHECK-NEXT: [[TMP2:%.*]] = tail call <2 x double> @llvm.maximum.v2f64(<2 x double> [[TMP0]], <2 x double> [[TMP1]])2806// CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <4 x i32>2807// CHECK-NEXT: ret <4 x i32> [[TMP3]]2808//2809v128_t test_f64x2_max(v128_t a, v128_t b) {2810 return wasm_f64x2_max(a, b);2811}2812 2813// CHECK-LABEL: define hidden <4 x i32> @test_f64x2_pmin(2814// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2815// CHECK-NEXT: [[ENTRY:.*:]]2816// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2817// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>2818// CHECK-NEXT: [[TMP2:%.*]] = tail call <2 x double> @llvm.wasm.pmin.v2f64(<2 x double> [[TMP0]], <2 x double> [[TMP1]])2819// CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <4 x i32>2820// CHECK-NEXT: ret <4 x i32> [[TMP3]]2821//2822v128_t test_f64x2_pmin(v128_t a, v128_t b) {2823 return wasm_f64x2_pmin(a, b);2824}2825 2826// CHECK-LABEL: define hidden <4 x i32> @test_f64x2_pmax(2827// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2828// CHECK-NEXT: [[ENTRY:.*:]]2829// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2830// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <2 x double>2831// CHECK-NEXT: [[TMP2:%.*]] = tail call <2 x double> @llvm.wasm.pmax.v2f64(<2 x double> [[TMP0]], <2 x double> [[TMP1]])2832// CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x double> [[TMP2]] to <4 x i32>2833// CHECK-NEXT: ret <4 x i32> [[TMP3]]2834//2835v128_t test_f64x2_pmax(v128_t a, v128_t b) {2836 return wasm_f64x2_pmax(a, b);2837}2838 2839// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_trunc_sat_f32x4(2840// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2841// CHECK-NEXT: [[ENTRY:.*:]]2842// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2843// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i32> @llvm.fptosi.sat.v4i32.v4f32(<4 x float> [[TMP0]])2844// CHECK-NEXT: ret <4 x i32> [[TMP1]]2845//2846v128_t test_i32x4_trunc_sat_f32x4(v128_t a) {2847 return wasm_i32x4_trunc_sat_f32x4(a);2848}2849 2850// CHECK-LABEL: define hidden noundef <4 x i32> @test_u32x4_trunc_sat_f32x4(2851// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2852// CHECK-NEXT: [[ENTRY:.*:]]2853// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2854// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i32> @llvm.fptoui.sat.v4i32.v4f32(<4 x float> [[TMP0]])2855// CHECK-NEXT: ret <4 x i32> [[TMP1]]2856//2857v128_t test_u32x4_trunc_sat_f32x4(v128_t a) {2858 return wasm_u32x4_trunc_sat_f32x4(a);2859}2860 2861// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_convert_i32x4(2862// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2863// CHECK-NEXT: [[ENTRY:.*:]]2864// CHECK-NEXT: [[CONV_I:%.*]] = sitofp <4 x i32> [[A]] to <4 x float>2865// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[CONV_I]] to <4 x i32>2866// CHECK-NEXT: ret <4 x i32> [[TMP0]]2867//2868v128_t test_f32x4_convert_i32x4(v128_t a) {2869 return wasm_f32x4_convert_i32x4(a);2870}2871 2872// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_convert_u32x4(2873// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2874// CHECK-NEXT: [[ENTRY:.*:]]2875// CHECK-NEXT: [[CONV_I:%.*]] = uitofp <4 x i32> [[A]] to <4 x float>2876// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x float> [[CONV_I]] to <4 x i32>2877// CHECK-NEXT: ret <4 x i32> [[TMP0]]2878//2879v128_t test_f32x4_convert_u32x4(v128_t a) {2880 return wasm_f32x4_convert_u32x4(a);2881}2882 2883// CHECK-LABEL: define hidden <4 x i32> @test_f64x2_convert_low_i32x4(2884// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2885// CHECK-NEXT: [[ENTRY:.*:]]2886// CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 0, i32 1>2887// CHECK-NEXT: [[CONV_I:%.*]] = sitofp <2 x i32> [[VECINIT2_I]] to <2 x double>2888// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[CONV_I]] to <4 x i32>2889// CHECK-NEXT: ret <4 x i32> [[TMP0]]2890//2891v128_t test_f64x2_convert_low_i32x4(v128_t a) {2892 return wasm_f64x2_convert_low_i32x4(a);2893}2894 2895// CHECK-LABEL: define hidden <4 x i32> @test_f64x2_convert_low_u32x4(2896// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2897// CHECK-NEXT: [[ENTRY:.*:]]2898// CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 0, i32 1>2899// CHECK-NEXT: [[CONV_I:%.*]] = uitofp <2 x i32> [[VECINIT2_I]] to <2 x double>2900// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x double> [[CONV_I]] to <4 x i32>2901// CHECK-NEXT: ret <4 x i32> [[TMP0]]2902//2903v128_t test_f64x2_convert_low_u32x4(v128_t a) {2904 return wasm_f64x2_convert_low_u32x4(a);2905}2906 2907// CHECK-LABEL: define hidden noundef <4 x i32> @test_i32x4_trunc_sat_f64x2_zero(2908// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2909// CHECK-NEXT: [[ENTRY:.*:]]2910// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2911// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i32> @llvm.fptosi.sat.v2i32.v2f64(<2 x double> [[TMP0]])2912// CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i32> [[TMP1]], <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>2913// CHECK-NEXT: ret <4 x i32> [[TMP2]]2914//2915v128_t test_i32x4_trunc_sat_f64x2_zero(v128_t a) {2916 return wasm_i32x4_trunc_sat_f64x2_zero(a);2917}2918 2919// CHECK-LABEL: define hidden noundef <4 x i32> @test_u32x4_trunc_sat_f64x2_zero(2920// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2921// CHECK-NEXT: [[ENTRY:.*:]]2922// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2923// CHECK-NEXT: [[TMP1:%.*]] = tail call <2 x i32> @llvm.fptoui.sat.v2i32.v2f64(<2 x double> [[TMP0]])2924// CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i32> [[TMP1]], <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>2925// CHECK-NEXT: ret <4 x i32> [[TMP2]]2926//2927v128_t test_u32x4_trunc_sat_f64x2_zero(v128_t a) {2928 return wasm_u32x4_trunc_sat_f64x2_zero(a);2929}2930 2931// CHECK-LABEL: define hidden noundef <4 x i32> @test_f32x4_demote_f64x2_zero(2932// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2933// CHECK-NEXT: [[ENTRY:.*:]]2934// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <2 x double>2935// CHECK-NEXT: [[SHUFFLE_I:%.*]] = shufflevector <2 x double> [[TMP0]], <2 x double> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>2936// CHECK-NEXT: [[CONV_I:%.*]] = fptrunc <4 x double> [[SHUFFLE_I]] to <4 x float>2937// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x float> [[CONV_I]] to <4 x i32>2938// CHECK-NEXT: ret <4 x i32> [[TMP1]]2939//2940v128_t test_f32x4_demote_f64x2_zero(v128_t a) {2941 return wasm_f32x4_demote_f64x2_zero(a);2942}2943 2944// CHECK-LABEL: define hidden <4 x i32> @test_f64x2_promote_low_f32x4(2945// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {2946// CHECK-NEXT: [[ENTRY:.*:]]2947// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <4 x float>2948// CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x float> [[TMP0]], <4 x float> poison, <2 x i32> <i32 0, i32 1>2949// CHECK-NEXT: [[CONV_I:%.*]] = fpext <2 x float> [[VECINIT2_I]] to <2 x double>2950// CHECK-NEXT: [[TMP1:%.*]] = bitcast <2 x double> [[CONV_I]] to <4 x i32>2951// CHECK-NEXT: ret <4 x i32> [[TMP1]]2952//2953v128_t test_f64x2_promote_low_f32x4(v128_t a) {2954 return wasm_f64x2_promote_low_f32x4(a);2955}2956 2957// CHECK-LABEL: define hidden <4 x i32> @test_i8x16_shuffle(2958// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2959// CHECK-NEXT: [[ENTRY:.*:]]2960// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>2961// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>2962// 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)2963// CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>2964// CHECK-NEXT: ret <4 x i32> [[TMP3]]2965//2966v128_t test_i8x16_shuffle(v128_t a, v128_t b) {2967 return wasm_i8x16_shuffle(a, b, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);2968}2969 2970// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_shuffle(2971// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2972// CHECK-NEXT: [[ENTRY:.*:]]2973// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>2974// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>2975// 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)2976// CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>2977// CHECK-NEXT: ret <4 x i32> [[TMP3]]2978//2979v128_t test_i16x8_shuffle(v128_t a, v128_t b) {2980 return wasm_i16x8_shuffle(a, b, 7, 6, 5, 4, 3, 2, 1, 0);2981}2982 2983// CHECK-LABEL: define hidden <4 x i32> @test_i32x4_shuffle(2984// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2985// CHECK-NEXT: [[ENTRY:.*:]]2986// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>2987// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>2988// 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)2989// CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>2990// CHECK-NEXT: ret <4 x i32> [[TMP3]]2991//2992v128_t test_i32x4_shuffle(v128_t a, v128_t b) {2993 return wasm_i32x4_shuffle(a, b, 3, 2, 1, 0);2994}2995 2996// CHECK-LABEL: define hidden <4 x i32> @test_i64x2_shuffle(2997// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {2998// CHECK-NEXT: [[ENTRY:.*:]]2999// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3000// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>3001// 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)3002// CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>3003// CHECK-NEXT: ret <4 x i32> [[TMP3]]3004//3005v128_t test_i64x2_shuffle(v128_t a, v128_t b) {3006 return wasm_i64x2_shuffle(a, b, 1, 0);3007}3008 3009// CHECK-LABEL: define hidden <4 x i32> @test_i8x16_swizzle(3010// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3011// CHECK-NEXT: [[ENTRY:.*:]]3012// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3013// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>3014// CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.swizzle(<16 x i8> [[TMP0]], <16 x i8> [[TMP1]])3015// CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>3016// CHECK-NEXT: ret <4 x i32> [[TMP3]]3017//3018v128_t test_i8x16_swizzle(v128_t a, v128_t b) {3019 return wasm_i8x16_swizzle(a, b);3020}3021 3022// CHECK-LABEL: define hidden <4 x i32> @test_i8x16_narrow_i16x8(3023// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3024// CHECK-NEXT: [[ENTRY:.*:]]3025// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3026// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>3027// CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.narrow.signed.v16i8.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])3028// CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>3029// CHECK-NEXT: ret <4 x i32> [[TMP3]]3030//3031v128_t test_i8x16_narrow_i16x8(v128_t a, v128_t b) {3032 return wasm_i8x16_narrow_i16x8(a, b);3033}3034 3035// CHECK-LABEL: define hidden <4 x i32> @test_u8x16_narrow_i16x8(3036// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3037// CHECK-NEXT: [[ENTRY:.*:]]3038// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3039// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>3040// CHECK-NEXT: [[TMP2:%.*]] = tail call <16 x i8> @llvm.wasm.narrow.unsigned.v16i8.v8i16(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])3041// CHECK-NEXT: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32>3042// CHECK-NEXT: ret <4 x i32> [[TMP3]]3043//3044v128_t test_u8x16_narrow_i16x8(v128_t a, v128_t b) {3045 return wasm_u8x16_narrow_i16x8(a, b);3046}3047 3048// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_narrow_i32x4(3049// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3050// CHECK-NEXT: [[ENTRY:.*:]]3051// CHECK-NEXT: [[TMP0:%.*]] = tail call <8 x i16> @llvm.wasm.narrow.signed.v8i16.v4i32(<4 x i32> [[A]], <4 x i32> [[B]])3052// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <4 x i32>3053// CHECK-NEXT: ret <4 x i32> [[TMP1]]3054//3055v128_t test_i16x8_narrow_i32x4(v128_t a, v128_t b) {3056 return wasm_i16x8_narrow_i32x4(a, b);3057}3058 3059// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_narrow_i32x4(3060// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3061// CHECK-NEXT: [[ENTRY:.*:]]3062// CHECK-NEXT: [[TMP0:%.*]] = tail call <8 x i16> @llvm.wasm.narrow.unsigned.v8i16.v4i32(<4 x i32> [[A]], <4 x i32> [[B]])3063// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[TMP0]] to <4 x i32>3064// CHECK-NEXT: ret <4 x i32> [[TMP1]]3065//3066v128_t test_u16x8_narrow_i32x4(v128_t a, v128_t b) {3067 return wasm_u16x8_narrow_i32x4(a, b);3068}3069 3070// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_extend_low_i8x16(3071// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3072// CHECK-NEXT: [[ENTRY:.*:]]3073// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3074// 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>3075// CHECK-NEXT: [[CONV_I:%.*]] = sext <8 x i8> [[VECINIT14_I]] to <8 x i16>3076// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32>3077// CHECK-NEXT: ret <4 x i32> [[TMP1]]3078//3079v128_t test_i16x8_extend_low_i8x16(v128_t a) {3080 return wasm_i16x8_extend_low_i8x16(a);3081}3082 3083// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_extend_high_i8x16(3084// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3085// CHECK-NEXT: [[ENTRY:.*:]]3086// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3087// 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>3088// CHECK-NEXT: [[CONV_I:%.*]] = sext <8 x i8> [[VECINIT14_I]] to <8 x i16>3089// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32>3090// CHECK-NEXT: ret <4 x i32> [[TMP1]]3091//3092v128_t test_i16x8_extend_high_i8x16(v128_t a) {3093 return wasm_i16x8_extend_high_i8x16(a);3094}3095 3096// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_extend_low_u8x16(3097// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3098// CHECK-NEXT: [[ENTRY:.*:]]3099// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3100// 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>3101// CHECK-NEXT: [[CONV_I:%.*]] = zext <8 x i8> [[VECINIT14_I]] to <8 x i16>3102// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32>3103// CHECK-NEXT: ret <4 x i32> [[TMP1]]3104//3105v128_t test_u16x8_extend_low_u8x16(v128_t a) {3106 return wasm_u16x8_extend_low_u8x16(a);3107}3108 3109// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_extend_high_u8x16(3110// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3111// CHECK-NEXT: [[ENTRY:.*:]]3112// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3113// 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>3114// CHECK-NEXT: [[CONV_I:%.*]] = zext <8 x i8> [[VECINIT14_I]] to <8 x i16>3115// CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i16> [[CONV_I]] to <4 x i32>3116// CHECK-NEXT: ret <4 x i32> [[TMP1]]3117//3118v128_t test_u16x8_extend_high_u8x16(v128_t a) {3119 return wasm_u16x8_extend_high_u8x16(a);3120}3121 3122// CHECK-LABEL: define hidden range(i32 -32768, 32768) <4 x i32> @test_i32x4_extend_low_i16x8(3123// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3124// CHECK-NEXT: [[ENTRY:.*:]]3125// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3126// CHECK-NEXT: [[VECINIT6_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>3127// CHECK-NEXT: [[CONV_I:%.*]] = sext <4 x i16> [[VECINIT6_I]] to <4 x i32>3128// CHECK-NEXT: ret <4 x i32> [[CONV_I]]3129//3130v128_t test_i32x4_extend_low_i16x8(v128_t a) {3131 return wasm_i32x4_extend_low_i16x8(a);3132}3133 3134// CHECK-LABEL: define hidden range(i32 -32768, 32768) <4 x i32> @test_i32x4_extend_high_i16x8(3135// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3136// CHECK-NEXT: [[ENTRY:.*:]]3137// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3138// CHECK-NEXT: [[VECINIT6_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>3139// CHECK-NEXT: [[CONV_I:%.*]] = sext <4 x i16> [[VECINIT6_I]] to <4 x i32>3140// CHECK-NEXT: ret <4 x i32> [[CONV_I]]3141//3142v128_t test_i32x4_extend_high_i16x8(v128_t a) {3143 return wasm_i32x4_extend_high_i16x8(a);3144}3145 3146// CHECK-LABEL: define hidden range(i32 0, 65536) <4 x i32> @test_u32x4_extend_low_u16x8(3147// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3148// CHECK-NEXT: [[ENTRY:.*:]]3149// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3150// CHECK-NEXT: [[VECINIT6_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>3151// CHECK-NEXT: [[CONV_I:%.*]] = zext <4 x i16> [[VECINIT6_I]] to <4 x i32>3152// CHECK-NEXT: ret <4 x i32> [[CONV_I]]3153//3154v128_t test_u32x4_extend_low_u16x8(v128_t a) {3155 return wasm_u32x4_extend_low_u16x8(a);3156}3157 3158// CHECK-LABEL: define hidden range(i32 0, 65536) <4 x i32> @test_u32x4_extend_high_u16x8(3159// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3160// CHECK-NEXT: [[ENTRY:.*:]]3161// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3162// CHECK-NEXT: [[VECINIT6_I:%.*]] = shufflevector <8 x i16> [[TMP0]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>3163// CHECK-NEXT: [[CONV_I:%.*]] = zext <4 x i16> [[VECINIT6_I]] to <4 x i32>3164// CHECK-NEXT: ret <4 x i32> [[CONV_I]]3165//3166v128_t test_u32x4_extend_high_u16x8(v128_t a) {3167 return wasm_u32x4_extend_high_u16x8(a);3168}3169 3170// CHECK-LABEL: define hidden <4 x i32> @test_i64x2_extend_low_i32x4(3171// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3172// CHECK-NEXT: [[ENTRY:.*:]]3173// CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 0, i32 1>3174// CHECK-NEXT: [[CONV_I:%.*]] = sext <2 x i32> [[VECINIT2_I]] to <2 x i64>3175// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32>3176// CHECK-NEXT: ret <4 x i32> [[TMP0]]3177//3178v128_t test_i64x2_extend_low_i32x4(v128_t a) {3179 return wasm_i64x2_extend_low_i32x4(a);3180}3181 3182// CHECK-LABEL: define hidden <4 x i32> @test_i64x2_extend_high_i32x4(3183// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3184// CHECK-NEXT: [[ENTRY:.*:]]3185// CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 2, i32 3>3186// CHECK-NEXT: [[CONV_I:%.*]] = sext <2 x i32> [[VECINIT2_I]] to <2 x i64>3187// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32>3188// CHECK-NEXT: ret <4 x i32> [[TMP0]]3189//3190v128_t test_i64x2_extend_high_i32x4(v128_t a) {3191 return wasm_i64x2_extend_high_i32x4(a);3192}3193 3194// CHECK-LABEL: define hidden <4 x i32> @test_u64x2_extend_low_u32x4(3195// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3196// CHECK-NEXT: [[ENTRY:.*:]]3197// CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 0, i32 1>3198// CHECK-NEXT: [[CONV_I:%.*]] = zext <2 x i32> [[VECINIT2_I]] to <2 x i64>3199// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32>3200// CHECK-NEXT: ret <4 x i32> [[TMP0]]3201//3202v128_t test_u64x2_extend_low_u32x4(v128_t a) {3203 return wasm_u64x2_extend_low_u32x4(a);3204}3205 3206// CHECK-LABEL: define hidden <4 x i32> @test_u64x2_extend_high_u32x4(3207// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3208// CHECK-NEXT: [[ENTRY:.*:]]3209// CHECK-NEXT: [[VECINIT2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 2, i32 3>3210// CHECK-NEXT: [[CONV_I:%.*]] = zext <2 x i32> [[VECINIT2_I]] to <2 x i64>3211// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[CONV_I]] to <4 x i32>3212// CHECK-NEXT: ret <4 x i32> [[TMP0]]3213//3214v128_t test_u64x2_extend_high_u32x4(v128_t a) {3215 return wasm_u64x2_extend_high_u32x4(a);3216}3217 3218// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_extadd_pairwise_i8x16(3219// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3220// CHECK-NEXT: [[ENTRY:.*:]]3221// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3222// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i16> @llvm.wasm.extadd.pairwise.signed.v8i16(<16 x i8> [[TMP0]])3223// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[TMP1]] to <4 x i32>3224// CHECK-NEXT: ret <4 x i32> [[TMP2]]3225//3226v128_t test_i16x8_extadd_pairwise_i8x16(v128_t a) {3227 return wasm_i16x8_extadd_pairwise_i8x16(a);3228}3229 3230// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_extadd_pairwise_u8x16(3231// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3232// CHECK-NEXT: [[ENTRY:.*:]]3233// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3234// CHECK-NEXT: [[TMP1:%.*]] = tail call <8 x i16> @llvm.wasm.extadd.pairwise.unsigned.v8i16(<16 x i8> [[TMP0]])3235// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[TMP1]] to <4 x i32>3236// CHECK-NEXT: ret <4 x i32> [[TMP2]]3237//3238v128_t test_u16x8_extadd_pairwise_u8x16(v128_t a) {3239 return wasm_u16x8_extadd_pairwise_u8x16(a);3240}3241 3242// CHECK-LABEL: define hidden <4 x i32> @test_i32x4_extadd_pairwise_i16x8(3243// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3244// CHECK-NEXT: [[ENTRY:.*:]]3245// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3246// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i32> @llvm.wasm.extadd.pairwise.signed.v4i32(<8 x i16> [[TMP0]])3247// CHECK-NEXT: ret <4 x i32> [[TMP1]]3248//3249v128_t test_i32x4_extadd_pairwise_i16x8(v128_t a) {3250 return wasm_i32x4_extadd_pairwise_i16x8(a);3251}3252 3253// CHECK-LABEL: define hidden <4 x i32> @test_u32x4_extadd_pairwise_u16x8(3254// CHECK-SAME: <4 x i32> noundef [[A:%.*]]) local_unnamed_addr #[[ATTR2]] {3255// CHECK-NEXT: [[ENTRY:.*:]]3256// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3257// CHECK-NEXT: [[TMP1:%.*]] = tail call <4 x i32> @llvm.wasm.extadd.pairwise.unsigned.v4i32(<8 x i16> [[TMP0]])3258// CHECK-NEXT: ret <4 x i32> [[TMP1]]3259//3260v128_t test_u32x4_extadd_pairwise_u16x8(v128_t a) {3261 return wasm_u32x4_extadd_pairwise_u16x8(a);3262}3263 3264// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_extmul_low_i8x16(3265// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3266// CHECK-NEXT: [[ENTRY:.*:]]3267// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3268// 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>3269// CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <8 x i8> [[VECINIT14_I2_I]] to <8 x i16>3270// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>3271// 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>3272// CHECK-NEXT: [[CONV_I_I:%.*]] = sext <8 x i8> [[VECINIT14_I_I]] to <8 x i16>3273// CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <8 x i16> [[CONV_I_I]], [[CONV_I3_I]]3274// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32>3275// CHECK-NEXT: ret <4 x i32> [[TMP2]]3276//3277v128_t test_i16x8_extmul_low_i8x16(v128_t a, v128_t b) {3278 return wasm_i16x8_extmul_low_i8x16(a, b);3279}3280 3281// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_extmul_high_i8x16(3282// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3283// CHECK-NEXT: [[ENTRY:.*:]]3284// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3285// 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>3286// CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <8 x i8> [[VECINIT14_I2_I]] to <8 x i16>3287// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>3288// 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>3289// CHECK-NEXT: [[CONV_I_I:%.*]] = sext <8 x i8> [[VECINIT14_I_I]] to <8 x i16>3290// CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <8 x i16> [[CONV_I_I]], [[CONV_I3_I]]3291// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32>3292// CHECK-NEXT: ret <4 x i32> [[TMP2]]3293//3294v128_t test_i16x8_extmul_high_i8x16(v128_t a, v128_t b) {3295 return wasm_i16x8_extmul_high_i8x16(a, b);3296}3297 3298// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_extmul_low_u8x16(3299// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3300// CHECK-NEXT: [[ENTRY:.*:]]3301// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3302// 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>3303// CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <8 x i8> [[VECINIT14_I2_I]] to <8 x i16>3304// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>3305// 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>3306// CHECK-NEXT: [[CONV_I_I:%.*]] = zext <8 x i8> [[VECINIT14_I_I]] to <8 x i16>3307// CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <8 x i16> [[CONV_I_I]], [[CONV_I3_I]]3308// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32>3309// CHECK-NEXT: ret <4 x i32> [[TMP2]]3310//3311v128_t test_u16x8_extmul_low_u8x16(v128_t a, v128_t b) {3312 return wasm_u16x8_extmul_low_u8x16(a, b);3313}3314 3315// CHECK-LABEL: define hidden <4 x i32> @test_u16x8_extmul_high_u8x16(3316// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3317// CHECK-NEXT: [[ENTRY:.*:]]3318// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <16 x i8>3319// 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>3320// CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <8 x i8> [[VECINIT14_I2_I]] to <8 x i16>3321// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <16 x i8>3322// 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>3323// CHECK-NEXT: [[CONV_I_I:%.*]] = zext <8 x i8> [[VECINIT14_I_I]] to <8 x i16>3324// CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <8 x i16> [[CONV_I_I]], [[CONV_I3_I]]3325// CHECK-NEXT: [[TMP2:%.*]] = bitcast <8 x i16> [[MUL_I]] to <4 x i32>3326// CHECK-NEXT: ret <4 x i32> [[TMP2]]3327//3328v128_t test_u16x8_extmul_high_u8x16(v128_t a, v128_t b) {3329 return wasm_u16x8_extmul_high_u8x16(a, b);3330}3331 3332// CHECK-LABEL: define hidden range(i32 -1073709056, 1073741825) <4 x i32> @test_i32x4_extmul_low_i16x8(3333// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3334// CHECK-NEXT: [[ENTRY:.*:]]3335// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3336// 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>3337// CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <4 x i16> [[VECINIT6_I2_I]] to <4 x i32>3338// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>3339// 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>3340// CHECK-NEXT: [[CONV_I_I:%.*]] = sext <4 x i16> [[VECINIT6_I_I]] to <4 x i32>3341// CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <4 x i32> [[CONV_I_I]], [[CONV_I3_I]]3342// CHECK-NEXT: ret <4 x i32> [[MUL_I]]3343//3344v128_t test_i32x4_extmul_low_i16x8(v128_t a, v128_t b) {3345 return wasm_i32x4_extmul_low_i16x8(a, b);3346}3347 3348// CHECK-LABEL: define hidden range(i32 -1073709056, 1073741825) <4 x i32> @test_i32x4_extmul_high_i16x8(3349// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3350// CHECK-NEXT: [[ENTRY:.*:]]3351// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3352// 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>3353// CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <4 x i16> [[VECINIT6_I2_I]] to <4 x i32>3354// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>3355// 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>3356// CHECK-NEXT: [[CONV_I_I:%.*]] = sext <4 x i16> [[VECINIT6_I_I]] to <4 x i32>3357// CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <4 x i32> [[CONV_I_I]], [[CONV_I3_I]]3358// CHECK-NEXT: ret <4 x i32> [[MUL_I]]3359//3360v128_t test_i32x4_extmul_high_i16x8(v128_t a, v128_t b) {3361 return wasm_i32x4_extmul_high_i16x8(a, b);3362}3363 3364// CHECK-LABEL: define hidden range(i32 0, -131070) <4 x i32> @test_u32x4_extmul_low_u16x8(3365// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3366// CHECK-NEXT: [[ENTRY:.*:]]3367// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3368// 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>3369// CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <4 x i16> [[VECINIT6_I2_I]] to <4 x i32>3370// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>3371// 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>3372// CHECK-NEXT: [[CONV_I_I:%.*]] = zext <4 x i16> [[VECINIT6_I_I]] to <4 x i32>3373// CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <4 x i32> [[CONV_I_I]], [[CONV_I3_I]]3374// CHECK-NEXT: ret <4 x i32> [[MUL_I]]3375//3376v128_t test_u32x4_extmul_low_u16x8(v128_t a, v128_t b) {3377 return wasm_u32x4_extmul_low_u16x8(a, b);3378}3379 3380// CHECK-LABEL: define hidden range(i32 0, -131070) <4 x i32> @test_u32x4_extmul_high_u16x8(3381// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3382// CHECK-NEXT: [[ENTRY:.*:]]3383// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3384// 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>3385// CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <4 x i16> [[VECINIT6_I2_I]] to <4 x i32>3386// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>3387// 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>3388// CHECK-NEXT: [[CONV_I_I:%.*]] = zext <4 x i16> [[VECINIT6_I_I]] to <4 x i32>3389// CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <4 x i32> [[CONV_I_I]], [[CONV_I3_I]]3390// CHECK-NEXT: ret <4 x i32> [[MUL_I]]3391//3392v128_t test_u32x4_extmul_high_u16x8(v128_t a, v128_t b) {3393 return wasm_u32x4_extmul_high_u16x8(a, b);3394}3395 3396// CHECK-LABEL: define hidden <4 x i32> @test_i64x2_extmul_low_i32x4(3397// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3398// CHECK-NEXT: [[ENTRY:.*:]]3399// CHECK-NEXT: [[VECINIT2_I2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 0, i32 1>3400// CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <2 x i32> [[VECINIT2_I2_I]] to <2 x i64>3401// CHECK-NEXT: [[VECINIT2_I_I:%.*]] = shufflevector <4 x i32> [[B]], <4 x i32> poison, <2 x i32> <i32 0, i32 1>3402// CHECK-NEXT: [[CONV_I_I:%.*]] = sext <2 x i32> [[VECINIT2_I_I]] to <2 x i64>3403// CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <2 x i64> [[CONV_I_I]], [[CONV_I3_I]]3404// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32>3405// CHECK-NEXT: ret <4 x i32> [[TMP0]]3406//3407v128_t test_i64x2_extmul_low_i32x4(v128_t a, v128_t b) {3408 return wasm_i64x2_extmul_low_i32x4(a, b);3409}3410 3411// CHECK-LABEL: define hidden <4 x i32> @test_i64x2_extmul_high_i32x4(3412// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3413// CHECK-NEXT: [[ENTRY:.*:]]3414// CHECK-NEXT: [[VECINIT2_I2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 2, i32 3>3415// CHECK-NEXT: [[CONV_I3_I:%.*]] = sext <2 x i32> [[VECINIT2_I2_I]] to <2 x i64>3416// CHECK-NEXT: [[VECINIT2_I_I:%.*]] = shufflevector <4 x i32> [[B]], <4 x i32> poison, <2 x i32> <i32 2, i32 3>3417// CHECK-NEXT: [[CONV_I_I:%.*]] = sext <2 x i32> [[VECINIT2_I_I]] to <2 x i64>3418// CHECK-NEXT: [[MUL_I:%.*]] = mul nsw <2 x i64> [[CONV_I_I]], [[CONV_I3_I]]3419// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32>3420// CHECK-NEXT: ret <4 x i32> [[TMP0]]3421//3422v128_t test_i64x2_extmul_high_i32x4(v128_t a, v128_t b) {3423 return wasm_i64x2_extmul_high_i32x4(a, b);3424}3425 3426// CHECK-LABEL: define hidden <4 x i32> @test_u64x2_extmul_low_u32x4(3427// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3428// CHECK-NEXT: [[ENTRY:.*:]]3429// CHECK-NEXT: [[VECINIT2_I2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 0, i32 1>3430// CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <2 x i32> [[VECINIT2_I2_I]] to <2 x i64>3431// CHECK-NEXT: [[VECINIT2_I_I:%.*]] = shufflevector <4 x i32> [[B]], <4 x i32> poison, <2 x i32> <i32 0, i32 1>3432// CHECK-NEXT: [[CONV_I_I:%.*]] = zext <2 x i32> [[VECINIT2_I_I]] to <2 x i64>3433// CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <2 x i64> [[CONV_I_I]], [[CONV_I3_I]]3434// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32>3435// CHECK-NEXT: ret <4 x i32> [[TMP0]]3436//3437v128_t test_u64x2_extmul_low_u32x4(v128_t a, v128_t b) {3438 return wasm_u64x2_extmul_low_u32x4(a, b);3439}3440 3441// CHECK-LABEL: define hidden <4 x i32> @test_u64x2_extmul_high_u32x4(3442// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3443// CHECK-NEXT: [[ENTRY:.*:]]3444// CHECK-NEXT: [[VECINIT2_I2_I:%.*]] = shufflevector <4 x i32> [[A]], <4 x i32> poison, <2 x i32> <i32 2, i32 3>3445// CHECK-NEXT: [[CONV_I3_I:%.*]] = zext <2 x i32> [[VECINIT2_I2_I]] to <2 x i64>3446// CHECK-NEXT: [[VECINIT2_I_I:%.*]] = shufflevector <4 x i32> [[B]], <4 x i32> poison, <2 x i32> <i32 2, i32 3>3447// CHECK-NEXT: [[CONV_I_I:%.*]] = zext <2 x i32> [[VECINIT2_I_I]] to <2 x i64>3448// CHECK-NEXT: [[MUL_I:%.*]] = mul nuw <2 x i64> [[CONV_I_I]], [[CONV_I3_I]]3449// CHECK-NEXT: [[TMP0:%.*]] = bitcast <2 x i64> [[MUL_I]] to <4 x i32>3450// CHECK-NEXT: ret <4 x i32> [[TMP0]]3451//3452v128_t test_u64x2_extmul_high_u32x4(v128_t a, v128_t b) {3453 return wasm_u64x2_extmul_high_u32x4(a, b);3454}3455 3456// CHECK-LABEL: define hidden <4 x i32> @test_i16x8_q15mulr_sat(3457// CHECK-SAME: <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]]) local_unnamed_addr #[[ATTR2]] {3458// CHECK-NEXT: [[ENTRY:.*:]]3459// CHECK-NEXT: [[TMP0:%.*]] = bitcast <4 x i32> [[A]] to <8 x i16>3460// CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i32> [[B]] to <8 x i16>3461// CHECK-NEXT: [[TMP2:%.*]] = tail call <8 x i16> @llvm.wasm.q15mulr.sat.signed(<8 x i16> [[TMP0]], <8 x i16> [[TMP1]])3462// CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i16> [[TMP2]] to <4 x i32>3463// CHECK-NEXT: ret <4 x i32> [[TMP3]]3464//3465v128_t test_i16x8_q15mulr_sat(v128_t a, v128_t b) {3466 return wasm_i16x8_q15mulr_sat(a, b);3467}3468//.3469// CHECK: [[META4:![0-9]+]] = !{!"omnipotent char", [[META5:![0-9]+]], i64 0}3470// CHECK: [[META5]] = !{!"Simple C/C++ TBAA"}3471// CHECK: [[CHAR_TBAA6]] = !{[[META4]], [[META4]], i64 0}3472//.3473