brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.1 KiB · 948449c Raw
312 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-macosx -mattr=+sse4.1 | FileCheck -check-prefix=CHECK-SSE %s3; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-macosx -mattr=+avx | FileCheck -check-prefix=CHECK-AVX %s4; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-macosx -mattr=+avx512f | FileCheck -check-prefix=CHECK-AVX512 %s5 6define float @test1(float %x) nounwind  {7; CHECK-SSE-LABEL: test1:8; CHECK-SSE:       ## %bb.0:9; CHECK-SSE-NEXT:    roundss $9, %xmm0, %xmm010; CHECK-SSE-NEXT:    retq11;12; CHECK-AVX-LABEL: test1:13; CHECK-AVX:       ## %bb.0:14; CHECK-AVX-NEXT:    vroundss $9, %xmm0, %xmm0, %xmm015; CHECK-AVX-NEXT:    retq16;17; CHECK-AVX512-LABEL: test1:18; CHECK-AVX512:       ## %bb.0:19; CHECK-AVX512-NEXT:    vroundss $9, %xmm0, %xmm0, %xmm020; CHECK-AVX512-NEXT:    retq21  %call = tail call float @floorf(float %x) nounwind readnone22  ret float %call23}24 25declare float @floorf(float) nounwind readnone26 27define double @test2(double %x) nounwind  {28; CHECK-SSE-LABEL: test2:29; CHECK-SSE:       ## %bb.0:30; CHECK-SSE-NEXT:    roundsd $9, %xmm0, %xmm031; CHECK-SSE-NEXT:    retq32;33; CHECK-AVX-LABEL: test2:34; CHECK-AVX:       ## %bb.0:35; CHECK-AVX-NEXT:    vroundsd $9, %xmm0, %xmm0, %xmm036; CHECK-AVX-NEXT:    retq37;38; CHECK-AVX512-LABEL: test2:39; CHECK-AVX512:       ## %bb.0:40; CHECK-AVX512-NEXT:    vroundsd $9, %xmm0, %xmm0, %xmm041; CHECK-AVX512-NEXT:    retq42  %call = tail call double @floor(double %x) nounwind readnone43  ret double %call44}45 46declare double @floor(double) nounwind readnone47 48define float @test3(float %x) nounwind  {49; CHECK-SSE-LABEL: test3:50; CHECK-SSE:       ## %bb.0:51; CHECK-SSE-NEXT:    roundss $12, %xmm0, %xmm052; CHECK-SSE-NEXT:    retq53;54; CHECK-AVX-LABEL: test3:55; CHECK-AVX:       ## %bb.0:56; CHECK-AVX-NEXT:    vroundss $12, %xmm0, %xmm0, %xmm057; CHECK-AVX-NEXT:    retq58;59; CHECK-AVX512-LABEL: test3:60; CHECK-AVX512:       ## %bb.0:61; CHECK-AVX512-NEXT:    vroundss $12, %xmm0, %xmm0, %xmm062; CHECK-AVX512-NEXT:    retq63  %call = tail call float @nearbyintf(float %x) nounwind readnone64  ret float %call65}66 67declare float @nearbyintf(float) nounwind readnone68 69define double @test4(double %x) nounwind  {70; CHECK-SSE-LABEL: test4:71; CHECK-SSE:       ## %bb.0:72; CHECK-SSE-NEXT:    roundsd $12, %xmm0, %xmm073; CHECK-SSE-NEXT:    retq74;75; CHECK-AVX-LABEL: test4:76; CHECK-AVX:       ## %bb.0:77; CHECK-AVX-NEXT:    vroundsd $12, %xmm0, %xmm0, %xmm078; CHECK-AVX-NEXT:    retq79;80; CHECK-AVX512-LABEL: test4:81; CHECK-AVX512:       ## %bb.0:82; CHECK-AVX512-NEXT:    vroundsd $12, %xmm0, %xmm0, %xmm083; CHECK-AVX512-NEXT:    retq84  %call = tail call double @nearbyint(double %x) nounwind readnone85  ret double %call86}87 88declare double @nearbyint(double) nounwind readnone89 90define float @test5(float %x) nounwind  {91; CHECK-SSE-LABEL: test5:92; CHECK-SSE:       ## %bb.0:93; CHECK-SSE-NEXT:    roundss $10, %xmm0, %xmm094; CHECK-SSE-NEXT:    retq95;96; CHECK-AVX-LABEL: test5:97; CHECK-AVX:       ## %bb.0:98; CHECK-AVX-NEXT:    vroundss $10, %xmm0, %xmm0, %xmm099; CHECK-AVX-NEXT:    retq100;101; CHECK-AVX512-LABEL: test5:102; CHECK-AVX512:       ## %bb.0:103; CHECK-AVX512-NEXT:    vroundss $10, %xmm0, %xmm0, %xmm0104; CHECK-AVX512-NEXT:    retq105  %call = tail call float @ceilf(float %x) nounwind readnone106  ret float %call107}108 109declare float @ceilf(float) nounwind readnone110 111define double @test6(double %x) nounwind  {112; CHECK-SSE-LABEL: test6:113; CHECK-SSE:       ## %bb.0:114; CHECK-SSE-NEXT:    roundsd $10, %xmm0, %xmm0115; CHECK-SSE-NEXT:    retq116;117; CHECK-AVX-LABEL: test6:118; CHECK-AVX:       ## %bb.0:119; CHECK-AVX-NEXT:    vroundsd $10, %xmm0, %xmm0, %xmm0120; CHECK-AVX-NEXT:    retq121;122; CHECK-AVX512-LABEL: test6:123; CHECK-AVX512:       ## %bb.0:124; CHECK-AVX512-NEXT:    vroundsd $10, %xmm0, %xmm0, %xmm0125; CHECK-AVX512-NEXT:    retq126  %call = tail call double @ceil(double %x) nounwind readnone127  ret double %call128}129 130declare double @ceil(double) nounwind readnone131 132define float @test7(float %x) nounwind  {133; CHECK-SSE-LABEL: test7:134; CHECK-SSE:       ## %bb.0:135; CHECK-SSE-NEXT:    roundss $4, %xmm0, %xmm0136; CHECK-SSE-NEXT:    retq137;138; CHECK-AVX-LABEL: test7:139; CHECK-AVX:       ## %bb.0:140; CHECK-AVX-NEXT:    vroundss $4, %xmm0, %xmm0, %xmm0141; CHECK-AVX-NEXT:    retq142;143; CHECK-AVX512-LABEL: test7:144; CHECK-AVX512:       ## %bb.0:145; CHECK-AVX512-NEXT:    vroundss $4, %xmm0, %xmm0, %xmm0146; CHECK-AVX512-NEXT:    retq147  %call = tail call float @rintf(float %x) nounwind readnone148  ret float %call149}150 151declare float @rintf(float) nounwind readnone152 153define double @test8(double %x) nounwind  {154; CHECK-SSE-LABEL: test8:155; CHECK-SSE:       ## %bb.0:156; CHECK-SSE-NEXT:    roundsd $4, %xmm0, %xmm0157; CHECK-SSE-NEXT:    retq158;159; CHECK-AVX-LABEL: test8:160; CHECK-AVX:       ## %bb.0:161; CHECK-AVX-NEXT:    vroundsd $4, %xmm0, %xmm0, %xmm0162; CHECK-AVX-NEXT:    retq163;164; CHECK-AVX512-LABEL: test8:165; CHECK-AVX512:       ## %bb.0:166; CHECK-AVX512-NEXT:    vroundsd $4, %xmm0, %xmm0, %xmm0167; CHECK-AVX512-NEXT:    retq168  %call = tail call double @rint(double %x) nounwind readnone169  ret double %call170}171 172declare double @rint(double) nounwind readnone173 174define float @test9(float %x) nounwind  {175; CHECK-SSE-LABEL: test9:176; CHECK-SSE:       ## %bb.0:177; CHECK-SSE-NEXT:    roundss $11, %xmm0, %xmm0178; CHECK-SSE-NEXT:    retq179;180; CHECK-AVX-LABEL: test9:181; CHECK-AVX:       ## %bb.0:182; CHECK-AVX-NEXT:    vroundss $11, %xmm0, %xmm0, %xmm0183; CHECK-AVX-NEXT:    retq184;185; CHECK-AVX512-LABEL: test9:186; CHECK-AVX512:       ## %bb.0:187; CHECK-AVX512-NEXT:    vroundss $11, %xmm0, %xmm0, %xmm0188; CHECK-AVX512-NEXT:    retq189  %call = tail call float @truncf(float %x) nounwind readnone190  ret float %call191}192 193declare float @truncf(float) nounwind readnone194 195define double @test10(double %x) nounwind  {196; CHECK-SSE-LABEL: test10:197; CHECK-SSE:       ## %bb.0:198; CHECK-SSE-NEXT:    roundsd $11, %xmm0, %xmm0199; CHECK-SSE-NEXT:    retq200;201; CHECK-AVX-LABEL: test10:202; CHECK-AVX:       ## %bb.0:203; CHECK-AVX-NEXT:    vroundsd $11, %xmm0, %xmm0, %xmm0204; CHECK-AVX-NEXT:    retq205;206; CHECK-AVX512-LABEL: test10:207; CHECK-AVX512:       ## %bb.0:208; CHECK-AVX512-NEXT:    vroundsd $11, %xmm0, %xmm0, %xmm0209; CHECK-AVX512-NEXT:    retq210  %call = tail call double @trunc(double %x) nounwind readnone211  ret double %call212}213 214declare double @trunc(double) nounwind readnone215 216define float @test11(ptr %xptr) nounwind optsize {217; CHECK-SSE-LABEL: test11:218; CHECK-SSE:       ## %bb.0:219; CHECK-SSE-NEXT:    roundss $11, (%rdi), %xmm0220; CHECK-SSE-NEXT:    retq221;222; CHECK-AVX-LABEL: test11:223; CHECK-AVX:       ## %bb.0:224; CHECK-AVX-NEXT:    vroundss $11, (%rdi), %xmm15, %xmm0225; CHECK-AVX-NEXT:    retq226;227; CHECK-AVX512-LABEL: test11:228; CHECK-AVX512:       ## %bb.0:229; CHECK-AVX512-NEXT:    vroundss $11, (%rdi), %xmm15, %xmm0230; CHECK-AVX512-NEXT:    retq231  %x = load float, ptr %xptr232  %call = tail call float @truncf(float %x) nounwind readnone233  ret float %call234}235 236define double @test12(ptr %xptr) nounwind optsize {237; CHECK-SSE-LABEL: test12:238; CHECK-SSE:       ## %bb.0:239; CHECK-SSE-NEXT:    roundsd $11, (%rdi), %xmm0240; CHECK-SSE-NEXT:    retq241;242; CHECK-AVX-LABEL: test12:243; CHECK-AVX:       ## %bb.0:244; CHECK-AVX-NEXT:    vroundsd $11, (%rdi), %xmm15, %xmm0245; CHECK-AVX-NEXT:    retq246;247; CHECK-AVX512-LABEL: test12:248; CHECK-AVX512:       ## %bb.0:249; CHECK-AVX512-NEXT:    vroundsd $11, (%rdi), %xmm15, %xmm0250; CHECK-AVX512-NEXT:    retq251  %x = load double, ptr %xptr252  %call = tail call double @trunc(double %x) nounwind readnone253  ret double %call254}255 256define float @test11_pgso(ptr %xptr) nounwind !prof !14 {257; CHECK-SSE-LABEL: test11_pgso:258; CHECK-SSE:       ## %bb.0:259; CHECK-SSE-NEXT:    roundss $11, (%rdi), %xmm0260; CHECK-SSE-NEXT:    retq261;262; CHECK-AVX-LABEL: test11_pgso:263; CHECK-AVX:       ## %bb.0:264; CHECK-AVX-NEXT:    vroundss $11, (%rdi), %xmm15, %xmm0265; CHECK-AVX-NEXT:    retq266;267; CHECK-AVX512-LABEL: test11_pgso:268; CHECK-AVX512:       ## %bb.0:269; CHECK-AVX512-NEXT:    vroundss $11, (%rdi), %xmm15, %xmm0270; CHECK-AVX512-NEXT:    retq271  %x = load float, ptr %xptr272  %call = tail call float @truncf(float %x) nounwind readnone273  ret float %call274}275 276define double @test12_pgso(ptr %xptr) nounwind !prof !14 {277; CHECK-SSE-LABEL: test12_pgso:278; CHECK-SSE:       ## %bb.0:279; CHECK-SSE-NEXT:    roundsd $11, (%rdi), %xmm0280; CHECK-SSE-NEXT:    retq281;282; CHECK-AVX-LABEL: test12_pgso:283; CHECK-AVX:       ## %bb.0:284; CHECK-AVX-NEXT:    vroundsd $11, (%rdi), %xmm15, %xmm0285; CHECK-AVX-NEXT:    retq286;287; CHECK-AVX512-LABEL: test12_pgso:288; CHECK-AVX512:       ## %bb.0:289; CHECK-AVX512-NEXT:    vroundsd $11, (%rdi), %xmm15, %xmm0290; CHECK-AVX512-NEXT:    retq291  %x = load double, ptr %xptr292  %call = tail call double @trunc(double %x) nounwind readnone293  ret double %call294}295 296!llvm.module.flags = !{!0}297!0 = !{i32 1, !"ProfileSummary", !1}298!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}299!2 = !{!"ProfileFormat", !"InstrProf"}300!3 = !{!"TotalCount", i64 10000}301!4 = !{!"MaxCount", i64 10}302!5 = !{!"MaxInternalCount", i64 1}303!6 = !{!"MaxFunctionCount", i64 1000}304!7 = !{!"NumCounts", i64 3}305!8 = !{!"NumFunctions", i64 3}306!9 = !{!"DetailedSummary", !10}307!10 = !{!11, !12, !13}308!11 = !{i32 10000, i64 100, i32 1}309!12 = !{i32 999000, i64 100, i32 1}310!13 = !{i32 999999, i64 1, i32 2}311!14 = !{!"function_entry_count", i64 0}312