brintos

brintos / llvm-project-archived public Read only

0
0
Text · 12.4 KiB · a5d9e8f Raw
289 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 22; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib %s | FileCheck %s3 4declare float @_Z5ldexpfi(float, i32)5declare <2 x float> @_Z5ldexpDv2_fDv2_i(<2 x float>, <2 x i32>)6declare <3 x float> @_Z5ldexpDv3_fDv3_i(<3 x float>, <3 x i32>)7declare <4 x float> @_Z5ldexpDv4_fDv4_i(<4 x float>, <4 x i32>)8declare <8 x float> @_Z5ldexpDv8_fDv8_i(<8 x float>, <8 x i32>)9declare <16 x float> @_Z5ldexpDv16_fDv16_i(<16 x float>, <16 x i32>)10declare double @_Z5ldexpdi(double, i32)11declare <2 x double> @_Z5ldexpDv2_dDv2_i(<2 x double>, <2 x i32>)12declare <3 x double> @_Z5ldexpDv3_dDv3_i(<3 x double>, <3 x i32>)13declare <4 x double> @_Z5ldexpDv4_dDv4_i(<4 x double>, <4 x i32>)14declare <8 x double> @_Z5ldexpDv8_dDv8_i(<8 x double>, <8 x i32>)15declare <16 x double> @_Z5ldexpDv16_dDv16_i(<16 x double>, <16 x i32>)16declare half @_Z5ldexpDhi(half, i32)17declare <2 x half> @_Z5ldexpDv2_DhDv2_i(<2 x half>, <2 x i32>)18declare <3 x half> @_Z5ldexpDv3_DhDv3_i(<3 x half>, <3 x i32>)19declare <4 x half> @_Z5ldexpDv4_DhDv4_i(<4 x half>, <4 x i32>)20declare <8 x half> @_Z5ldexpDv8_DhDv8_i(<8 x half>, <8 x i32>)21declare <16 x half> @_Z5ldexpDv16_DhDv16_i(<16 x half>, <16 x i32>)22 23define float @test_ldexp_f32(float %x, i32 %y) {24; CHECK-LABEL: define float @test_ldexp_f3225; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {26; CHECK-NEXT:    [[LDEXP:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])27; CHECK-NEXT:    ret float [[LDEXP]]28;29  %ldexp = tail call float @_Z5ldexpfi(float %x, i32 %y)30  ret float %ldexp31}32 33define float @test_ldexp_f32_fast(float %x, i32 %y) {34; CHECK-LABEL: define float @test_ldexp_f32_fast35; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {36; CHECK-NEXT:    [[LDEXP:%.*]] = tail call fast float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])37; CHECK-NEXT:    ret float [[LDEXP]]38;39  %ldexp = tail call fast float @_Z5ldexpfi(float %x, i32 %y)40  ret float %ldexp41}42 43define <2 x float> @test_ldexp_v2f32(<2 x float> %x, <2 x i32> %y) {44; CHECK-LABEL: define <2 x float> @test_ldexp_v2f3245; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {46; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> [[X]], <2 x i32> [[Y]])47; CHECK-NEXT:    ret <2 x float> [[LDEXP]]48;49  %ldexp = tail call <2 x float> @_Z5ldexpDv2_fDv2_i(<2 x float> %x, <2 x i32> %y)50  ret <2 x float> %ldexp51}52 53define <3 x float> @test_ldexp_v3f32(<3 x float> %x, <3 x i32> %y) {54; CHECK-LABEL: define <3 x float> @test_ldexp_v3f3255; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x i32> [[Y:%.*]]) {56; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <3 x float> @llvm.ldexp.v3f32.v3i32(<3 x float> [[X]], <3 x i32> [[Y]])57; CHECK-NEXT:    ret <3 x float> [[LDEXP]]58;59  %ldexp = tail call <3 x float> @_Z5ldexpDv3_fDv3_i(<3 x float> %x, <3 x i32> %y)60  ret <3 x float> %ldexp61}62 63define <4 x float> @test_ldexp_v4f32(<4 x float> %x, <4 x i32> %y) {64; CHECK-LABEL: define <4 x float> @test_ldexp_v4f3265; CHECK-SAME: (<4 x float> [[X:%.*]], <4 x i32> [[Y:%.*]]) {66; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> [[X]], <4 x i32> [[Y]])67; CHECK-NEXT:    ret <4 x float> [[LDEXP]]68;69  %ldexp = tail call <4 x float> @_Z5ldexpDv4_fDv4_i(<4 x float> %x, <4 x i32> %y)70  ret <4 x float> %ldexp71}72 73define <8 x float> @test_ldexp_v8f32(<8 x float> %x, <8 x i32> %y) {74; CHECK-LABEL: define <8 x float> @test_ldexp_v8f3275; CHECK-SAME: (<8 x float> [[X:%.*]], <8 x i32> [[Y:%.*]]) {76; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <8 x float> @llvm.ldexp.v8f32.v8i32(<8 x float> [[X]], <8 x i32> [[Y]])77; CHECK-NEXT:    ret <8 x float> [[LDEXP]]78;79  %ldexp = tail call <8 x float> @_Z5ldexpDv8_fDv8_i(<8 x float> %x, <8 x i32> %y)80  ret <8 x float> %ldexp81}82 83define <16 x float> @test_ldexp_v16f32(<16 x float> %x, <16 x i32> %y) {84; CHECK-LABEL: define <16 x float> @test_ldexp_v16f3285; CHECK-SAME: (<16 x float> [[X:%.*]], <16 x i32> [[Y:%.*]]) {86; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <16 x float> @llvm.ldexp.v16f32.v16i32(<16 x float> [[X]], <16 x i32> [[Y]])87; CHECK-NEXT:    ret <16 x float> [[LDEXP]]88;89  %ldexp = tail call <16 x float> @_Z5ldexpDv16_fDv16_i(<16 x float> %x, <16 x i32> %y)90  ret <16 x float> %ldexp91}92 93define double @test_ldexp_f64(double %x, i32 %y) {94; CHECK-LABEL: define double @test_ldexp_f6495; CHECK-SAME: (double [[X:%.*]], i32 [[Y:%.*]]) {96; CHECK-NEXT:    [[LDEXP:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[X]], i32 [[Y]])97; CHECK-NEXT:    ret double [[LDEXP]]98;99  %ldexp = tail call double @_Z5ldexpdi(double %x, i32 %y)100  ret double %ldexp101}102 103define <2 x double> @test_ldexp_v2f64(<2 x double> %x, <2 x i32> %y) {104; CHECK-LABEL: define <2 x double> @test_ldexp_v2f64105; CHECK-SAME: (<2 x double> [[X:%.*]], <2 x i32> [[Y:%.*]]) {106; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <2 x double> @llvm.ldexp.v2f64.v2i32(<2 x double> [[X]], <2 x i32> [[Y]])107; CHECK-NEXT:    ret <2 x double> [[LDEXP]]108;109  %ldexp = tail call <2 x double> @_Z5ldexpDv2_dDv2_i(<2 x double> %x, <2 x i32> %y)110  ret <2 x double> %ldexp111}112 113define <3 x double> @test_ldexp_v3f64(<3 x double> %x, <3 x i32> %y) {114; CHECK-LABEL: define <3 x double> @test_ldexp_v3f64115; CHECK-SAME: (<3 x double> [[X:%.*]], <3 x i32> [[Y:%.*]]) {116; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <3 x double> @llvm.ldexp.v3f64.v3i32(<3 x double> [[X]], <3 x i32> [[Y]])117; CHECK-NEXT:    ret <3 x double> [[LDEXP]]118;119  %ldexp = tail call <3 x double> @_Z5ldexpDv3_dDv3_i(<3 x double> %x, <3 x i32> %y)120  ret <3 x double> %ldexp121}122 123define <4 x double> @test_ldexp_v4f64(<4 x double> %x, <4 x i32> %y) {124; CHECK-LABEL: define <4 x double> @test_ldexp_v4f64125; CHECK-SAME: (<4 x double> [[X:%.*]], <4 x i32> [[Y:%.*]]) {126; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <4 x double> @llvm.ldexp.v4f64.v4i32(<4 x double> [[X]], <4 x i32> [[Y]])127; CHECK-NEXT:    ret <4 x double> [[LDEXP]]128;129  %ldexp = tail call <4 x double> @_Z5ldexpDv4_dDv4_i(<4 x double> %x, <4 x i32> %y)130  ret <4 x double> %ldexp131}132 133define <8 x double> @test_ldexp_v8f64(<8 x double> %x, <8 x i32> %y) {134; CHECK-LABEL: define <8 x double> @test_ldexp_v8f64135; CHECK-SAME: (<8 x double> [[X:%.*]], <8 x i32> [[Y:%.*]]) {136; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <8 x double> @llvm.ldexp.v8f64.v8i32(<8 x double> [[X]], <8 x i32> [[Y]])137; CHECK-NEXT:    ret <8 x double> [[LDEXP]]138;139  %ldexp = tail call <8 x double> @_Z5ldexpDv8_dDv8_i(<8 x double> %x, <8 x i32> %y)140  ret <8 x double> %ldexp141}142 143define <16 x double> @test_ldexp_v16f64(<16 x double> %x, <16 x i32> %y) {144; CHECK-LABEL: define <16 x double> @test_ldexp_v16f64145; CHECK-SAME: (<16 x double> [[X:%.*]], <16 x i32> [[Y:%.*]]) {146; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <16 x double> @llvm.ldexp.v16f64.v16i32(<16 x double> [[X]], <16 x i32> [[Y]])147; CHECK-NEXT:    ret <16 x double> [[LDEXP]]148;149  %ldexp = tail call <16 x double> @_Z5ldexpDv16_dDv16_i(<16 x double> %x, <16 x i32> %y)150  ret <16 x double> %ldexp151}152 153define half @test_ldexp_f16(half %x, i32 %y) {154; CHECK-LABEL: define half @test_ldexp_f16155; CHECK-SAME: (half [[X:%.*]], i32 [[Y:%.*]]) {156; CHECK-NEXT:    [[LDEXP:%.*]] = tail call half @llvm.ldexp.f16.i32(half [[X]], i32 [[Y]])157; CHECK-NEXT:    ret half [[LDEXP]]158;159  %ldexp = tail call half @_Z5ldexpDhi(half %x, i32 %y)160  ret half %ldexp161}162 163define <2 x half> @test_ldexp_v2f16(<2 x half> %x, <2 x i32> %y) {164; CHECK-LABEL: define <2 x half> @test_ldexp_v2f16165; CHECK-SAME: (<2 x half> [[X:%.*]], <2 x i32> [[Y:%.*]]) {166; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> [[X]], <2 x i32> [[Y]])167; CHECK-NEXT:    ret <2 x half> [[LDEXP]]168;169  %ldexp = tail call <2 x half> @_Z5ldexpDv2_DhDv2_i(<2 x half> %x, <2 x i32> %y)170  ret <2 x half> %ldexp171}172 173define <3 x half> @test_ldexp_v3f16(<3 x half> %x, <3 x i32> %y) {174; CHECK-LABEL: define <3 x half> @test_ldexp_v3f16175; CHECK-SAME: (<3 x half> [[X:%.*]], <3 x i32> [[Y:%.*]]) {176; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <3 x half> @llvm.ldexp.v3f16.v3i32(<3 x half> [[X]], <3 x i32> [[Y]])177; CHECK-NEXT:    ret <3 x half> [[LDEXP]]178;179  %ldexp = tail call <3 x half> @_Z5ldexpDv3_DhDv3_i(<3 x half> %x, <3 x i32> %y)180  ret <3 x half> %ldexp181}182 183define <4 x half> @test_ldexp_v4f16(<4 x half> %x, <4 x i32> %y) {184; CHECK-LABEL: define <4 x half> @test_ldexp_v4f16185; CHECK-SAME: (<4 x half> [[X:%.*]], <4 x i32> [[Y:%.*]]) {186; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> [[X]], <4 x i32> [[Y]])187; CHECK-NEXT:    ret <4 x half> [[LDEXP]]188;189  %ldexp = tail call <4 x half> @_Z5ldexpDv4_DhDv4_i(<4 x half> %x, <4 x i32> %y)190  ret <4 x half> %ldexp191}192 193define <8 x half> @test_ldexp_v8f16(<8 x half> %x, <8 x i32> %y) {194; CHECK-LABEL: define <8 x half> @test_ldexp_v8f16195; CHECK-SAME: (<8 x half> [[X:%.*]], <8 x i32> [[Y:%.*]]) {196; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> [[X]], <8 x i32> [[Y]])197; CHECK-NEXT:    ret <8 x half> [[LDEXP]]198;199  %ldexp = tail call <8 x half> @_Z5ldexpDv8_DhDv8_i(<8 x half> %x, <8 x i32> %y)200  ret <8 x half> %ldexp201}202 203define <16 x half> @test_ldexp_v16f16(<16 x half> %x, <16 x i32> %y) {204; CHECK-LABEL: define <16 x half> @test_ldexp_v16f16205; CHECK-SAME: (<16 x half> [[X:%.*]], <16 x i32> [[Y:%.*]]) {206; CHECK-NEXT:    [[LDEXP:%.*]] = tail call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> [[X]], <16 x i32> [[Y]])207; CHECK-NEXT:    ret <16 x half> [[LDEXP]]208;209  %ldexp = tail call <16 x half> @_Z5ldexpDv16_DhDv16_i(<16 x half> %x, <16 x i32> %y)210  ret <16 x half> %ldexp211}212 213define float @test_ldexp_f32_minsize(float %x, i32 %y) #3 {214; CHECK-LABEL: define float @test_ldexp_f32_minsize215; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) #[[ATTR0:[0-9]+]] {216; CHECK-NEXT:    [[LDEXP:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[X]], i32 [[Y]])217; CHECK-NEXT:    ret float [[LDEXP]]218;219  %ldexp = tail call float @_Z5ldexpfi(float %x, i32 %y)220  ret float %ldexp221}222 223define float @test_ldexp_f32_nobuiltin(float %x, i32 %y) {224; CHECK-LABEL: define float @test_ldexp_f32_nobuiltin225; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {226; CHECK-NEXT:    [[LDEXP:%.*]] = tail call float @_Z5ldexpfi(float [[X]], i32 [[Y]]) #[[ATTR3:[0-9]+]]227; CHECK-NEXT:    ret float [[LDEXP]]228;229  %ldexp = tail call float @_Z5ldexpfi(float %x, i32 %y) #0230  ret float %ldexp231}232 233define float @test_ldexp_f32_strictfp(float %x, i32 %y) #4 {234; CHECK-LABEL: define float @test_ldexp_f32_strictfp235; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) #[[ATTR1:[0-9]+]] {236; CHECK-NEXT:    [[LDEXP:%.*]] = tail call nnan float @_Z5ldexpfi(float [[X]], i32 [[Y]]) #[[ATTR1]]237; CHECK-NEXT:    ret float [[LDEXP]]238;239  %ldexp = tail call nnan float @_Z5ldexpfi(float %x, i32 %y) #4240  ret float %ldexp241}242 243;---------------------------------------------------------------------244; Invalid signatures245;---------------------------------------------------------------------246 247; Declared with wrong type, second argument is float248declare float @_Z5ldexpff(float noundef, float noundef)249 250define float @call_wrong_typed_ldexp_f32_second_arg(float %x, float %wrongtype) {251; CHECK-LABEL: define float @call_wrong_typed_ldexp_f32_second_arg252; CHECK-SAME: (float [[X:%.*]], float [[WRONGTYPE:%.*]]) {253; CHECK-NEXT:    [[CALL:%.*]] = call float @_Z5ldexpff(float [[X]], float [[WRONGTYPE]])254; CHECK-NEXT:    ret float [[CALL]]255;256  %call = call float @_Z5ldexpff(float %x, float %wrongtype)257  ret float %call258}259 260declare <2 x float> @_Z5ldexpDv2_fS_(<2 x float>, <2 x float>)261 262define <2 x float> @call_wrong_typed_ldexp_v2f32_second_arg(<2 x float> %x, <2 x float> %wrongtype) {263; CHECK-LABEL: define <2 x float> @call_wrong_typed_ldexp_v2f32_second_arg264; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[WRONGTYPE:%.*]]) {265; CHECK-NEXT:    [[CALL:%.*]] = call <2 x float> @_Z5ldexpDv2_fS_(<2 x float> [[X]], <2 x float> [[WRONGTYPE]])266; CHECK-NEXT:    ret <2 x float> [[CALL]]267;268  %call = call <2 x float> @_Z5ldexpDv2_fS_(<2 x float> %x, <2 x float> %wrongtype)269  ret <2 x float> %call270}271 272declare <2 x float> @_Z5ldexpDv2_ff(<2 x float>, float)273 274define <2 x float> @call_wrong_typed_ldexp_v2f32_f32(<2 x float> %x, float %wrongtype) {275; CHECK-LABEL: define <2 x float> @call_wrong_typed_ldexp_v2f32_f32276; CHECK-SAME: (<2 x float> [[X:%.*]], float [[WRONGTYPE:%.*]]) {277; CHECK-NEXT:    [[CALL:%.*]] = call <2 x float> @_Z5ldexpDv2_ff(<2 x float> [[X]], float [[WRONGTYPE]])278; CHECK-NEXT:    ret <2 x float> [[CALL]]279;280  %call = call <2 x float> @_Z5ldexpDv2_ff(<2 x float> %x, float %wrongtype)281  ret <2 x float> %call282}283 284attributes #0 = { nobuiltin }285attributes #1 = { "no-builtins" }286attributes #2 = { nounwind memory(none) }287attributes #3 = { minsize }288attributes #4 = { strictfp }289