brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.7 KiB · 0e6e289 Raw
305 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \3; RUN:     -ppc-asm-full-reg-names -mcpu=pwr10 < %s | FileCheck %s4; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \5; RUN:     -ppc-asm-full-reg-names -mcpu=pwr10 < %s | FileCheck %s6 7define dso_local <4 x i32> @testZero() local_unnamed_addr {8; CHECK-LABEL: testZero:9; CHECK:       # %bb.0: # %entry10; CHECK-NEXT:    xxlxor vs34, vs34, vs3411; CHECK-NEXT:    blr12 13entry:14  ret <4 x i32> zeroinitializer15}16 17define dso_local <4 x float> @testZeroF() local_unnamed_addr {18; CHECK-LABEL: testZeroF:19; CHECK:       # %bb.0: # %entry20; CHECK-NEXT:    xxlxor vs34, vs34, vs3421; CHECK-NEXT:    blr22 23entry:24  ret <4 x float> zeroinitializer25}26 27define dso_local <4 x i32> @testAllOneS() local_unnamed_addr {28; CHECK-LABEL: testAllOneS:29; CHECK:       # %bb.0: # %entry30; CHECK-NEXT:    xxleqv vs34, vs34, vs3431; CHECK-NEXT:    blr32 33entry:34  ret <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>35}36 37define dso_local <4 x i32> @test5Bit() local_unnamed_addr {38; CHECK-LABEL: test5Bit:39; CHECK:       # %bb.0: # %entry40; CHECK-NEXT:    vspltisw v2, 741; CHECK-NEXT:    blr42 43entry:44  ret <4 x i32> <i32 7, i32 7, i32 7, i32 7>45}46 47define dso_local <16 x i8> @test1ByteChar() local_unnamed_addr {48; CHECK-LABEL: test1ByteChar:49; CHECK:       # %bb.0: # %entry50; CHECK-NEXT:    xxspltib vs34, 751; CHECK-NEXT:    blr52 53entry:54  ret <16 x i8> <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>55}56 57define dso_local <4 x i32> @test1ByteSplatInt() local_unnamed_addr {58; Here the splat of 171 or 0xABABABAB can be done using a byte splat59; of 0xAB using xxspltib while avoiding the use of xxspltiw.60; CHECK-LABEL: test1ByteSplatInt:61; CHECK:       # %bb.0: # %entry62; CHECK-NEXT:    xxspltib vs34, 17163; CHECK-NEXT:    blr64 65entry:66  ret <4 x i32> <i32 -1414812757, i32 -1414812757, i32 -1414812757, i32 -1414812757>67}68 69define dso_local <4 x i32> @test5Bit2Ins() local_unnamed_addr {70; Splats within the range [-32,31] can be done using two vsplti[bhw]71; instructions, but we prefer the xxspltiw instruction to them.72; CHECK-LABEL: test5Bit2Ins:73; CHECK:       # %bb.0: # %entry74; CHECK-NEXT:    xxspltiw vs34, 1675; CHECK-NEXT:    blr76 77entry:78  ret <4 x i32> <i32 16, i32 16, i32 16, i32 16>79}80 81define dso_local <4 x float> @testFloatNegZero() local_unnamed_addr {82; 0.0f is not the same as -0.0f. We try to splat -0.0f83; CHECK-LABEL: testFloatNegZero:84; CHECK:       # %bb.0: # %entry85; CHECK-NEXT:    xxspltiw vs34, -214748364886; CHECK-NEXT:    blr87 88entry:89  ret <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>90}91 92define dso_local <4 x float> @testFloat() local_unnamed_addr {93; CHECK-LABEL: testFloat:94; CHECK:       # %bb.0: # %entry95; CHECK-NEXT:    xxspltiw vs34, 113532370996; CHECK-NEXT:    blr97 98entry:99  ret <4 x float> <float 0x40757547A0000000, float 0x40757547A0000000, float 0x40757547A0000000, float 0x40757547A0000000>100}101 102define dso_local <4 x float> @testIntToFloat() local_unnamed_addr {103; CHECK-LABEL: testIntToFloat:104; CHECK:       # %bb.0: # %entry105; CHECK-NEXT:    xxspltiw vs34, 1135312896106; CHECK-NEXT:    blr107 108entry:109  ret <4 x float> <float 3.430000e+02, float 3.430000e+02, float 3.430000e+02, float 3.430000e+02>110}111 112define dso_local <4 x i32> @testUndefInt() local_unnamed_addr {113; CHECK-LABEL: testUndefInt:114; CHECK:       # %bb.0: # %entry115; CHECK-NEXT:    xxspltiw vs34, 18116; CHECK-NEXT:    blr117 118entry:119  ret <4 x i32> <i32 18, i32 undef, i32 undef, i32 18>120}121 122define dso_local <4 x float> @testUndefIntToFloat() local_unnamed_addr {123; CHECK-LABEL: testUndefIntToFloat:124; CHECK:       # %bb.0: # %entry125; CHECK-NEXT:    xxspltiw vs34, 1135312896126; CHECK-NEXT:    blr127 128entry:129  ret <4 x float> <float 3.430000e+02, float undef, float undef, float 3.430000e+02>130}131 132define dso_local <2 x i64> @testPseudo8Byte() local_unnamed_addr {133; CHECK-LABEL: testPseudo8Byte:134; CHECK:       # %bb.0: # %entry135; CHECK-NEXT:    xxspltiw vs34, -1430532899136; CHECK-NEXT:    blr137 138entry:139  ret <2 x i64> <i64 -6144092014192636707, i64 -6144092014192636707>140}141 142define dso_local <8 x i16> @test2Byte() local_unnamed_addr {143; CHECK-LABEL: test2Byte:144; CHECK:       # %bb.0: # %entry145; CHECK-NEXT:    xxspltiw vs34, 1179666146; CHECK-NEXT:    blr147 148entry:149  ret <8 x i16> <i16 18, i16 18, i16 18, i16 18, i16 18, i16 18, i16 18, i16 18>150}151 152define dso_local <8 x i16> @test2ByteUndef() local_unnamed_addr {153; CHECK-LABEL: test2ByteUndef:154; CHECK:       # %bb.0: # %entry155; CHECK-NEXT:    xxspltiw vs34, 1179666156; CHECK-NEXT:    blr157 158entry:159  ret <8 x i16> <i16 18, i16 undef, i16 18, i16 18, i16 18, i16 undef, i16 18, i16 18>160}161 162define dso_local <2 x double> @testFloatToDouble() local_unnamed_addr {163; CHECK-LABEL: testFloatToDouble:164; CHECK:       # %bb.0: # %entry165; CHECK-NEXT:    xxspltidp vs34, 1135290941166; CHECK-NEXT:    blr167 168entry:169  ret <2 x double> <double 0x40756547A0000000, double 0x40756547A0000000>170}171 172define dso_local <2 x double> @testDoubleLower4ByteZero() local_unnamed_addr {173; The expanded double will have 0 in the last 32 bits. Imprecise handling of174; return value of data structures like APInt, returned when calling getZextValue175; , like saving the return value into an unsigned instead of uint64_t may cause176; this test to fail.177; CHECK-LABEL: testDoubleLower4ByteZero:178; CHECK:       # %bb.0: # %entry179; CHECK-NEXT:    xxspltidp vs34, 1093664768180; CHECK-NEXT:    blr181 182entry:183  ret <2 x double> <double 1.100000e+01, double 1.100000e+01>184}185 186define dso_local <2 x double> @testDoubleToDoubleZero() local_unnamed_addr {187; Should be using canonicalized form to splat zero and use shorter instructions188; than xxspltidp.189; CHECK-LABEL: testDoubleToDoubleZero:190; CHECK:       # %bb.0: # %entry191; CHECK-NEXT:    xxlxor vs34, vs34, vs34192; CHECK-NEXT:    blr193 194entry:195  ret <2 x double> zeroinitializer196}197 198define dso_local <2 x double> @testDoubleToDoubleNegZero() local_unnamed_addr {199; CHECK-LABEL: testDoubleToDoubleNegZero:200; CHECK:       # %bb.0: # %entry201; CHECK-NEXT:    xxspltidp vs34, -2147483648202; CHECK-NEXT:    blr203 204entry:205  ret <2 x double> <double -0.000000e+00, double -0.000000e+00>206}207 208define dso_local <2 x double> @testDoubleToDoubleNaN() local_unnamed_addr {209; CHECK-LABEL: testDoubleToDoubleNaN:210; CHECK:       # %bb.0: # %entry211; CHECK-NEXT:    xxspltidp vs34, -16212; CHECK-NEXT:    blr213 214entry:215  ret <2 x double> <double 0xFFFFFFFE00000000, double 0xFFFFFFFE00000000>216}217 218define dso_local <2 x double> @testDoubleToDoubleInfinity() local_unnamed_addr {219; CHECK-LABEL: testDoubleToDoubleInfinity:220; CHECK:       # %bb.0: # %entry221; CHECK-NEXT:    xxspltidp vs34, 2139095040222; CHECK-NEXT:    blr223 224entry:225  ret <2 x double> <double 0x7FF0000000000000, double 0x7FF0000000000000>226}227 228define dso_local <2 x double> @testFloatToDoubleNaN() local_unnamed_addr {229; CHECK-LABEL: testFloatToDoubleNaN:230; CHECK:       # %bb.0: # %entry231; CHECK-NEXT:    xxspltidp vs34, -1232; CHECK-NEXT:    blr233 234entry:235  ret <2 x double> <double 0xFFFFFFFFE0000000, double 0xFFFFFFFFE0000000>236}237 238define dso_local <2 x double> @testFloatToDoubleInfinity() local_unnamed_addr {239; CHECK-LABEL: testFloatToDoubleInfinity:240; CHECK:       # %bb.0: # %entry241; CHECK-NEXT:    xxspltidp vs34, 2139095040242; CHECK-NEXT:    blr243 244entry:245  ret <2 x double> <double 0x7FF0000000000000, double 0x7FF0000000000000>246}247 248define dso_local float @testFloatScalar() local_unnamed_addr {249; CHECK-LABEL: testFloatScalar:250; CHECK:       # %bb.0: # %entry251; CHECK-NEXT:    xxspltidp vs1, 1135290941252; CHECK-NEXT:    blr253 254entry:255  ret float 0x40756547A0000000256}257 258define dso_local float @testFloatZeroScalar() local_unnamed_addr {259; CHECK-LABEL: testFloatZeroScalar:260; CHECK:       # %bb.0: # %entry261; CHECK-NEXT:    xxlxor f1, f1, f1262; CHECK-NEXT:    blr263 264entry:265  ret float 0.000000e+00266}267 268define dso_local double @testDoubleRepresentableScalar() local_unnamed_addr {269; CHECK-LABEL: testDoubleRepresentableScalar:270; CHECK:       # %bb.0: # %entry271; CHECK-NEXT:    xxspltidp vs1, 1135290941272; CHECK-NEXT:    blr273 274entry:275  ret double 0x40756547A0000000276}277 278define dso_local double @testDoubleZeroScalar() local_unnamed_addr {279; CHECK-LABEL: testDoubleZeroScalar:280; CHECK:       # %bb.0: # %entry281; CHECK-NEXT:    xxlxor f1, f1, f1282; CHECK-NEXT:    blr283 284entry:285  ret double 0.000000e+00286}287 288define dso_local <4 x i32> @vec_splati() local_unnamed_addr {289; CHECK-LABEL: vec_splati:290; CHECK:       # %bb.0: # %entry291; CHECK-NEXT:    xxspltiw vs34, -17292; CHECK-NEXT:    blr293entry:294  ret <4 x i32> <i32 -17, i32 -17, i32 -17, i32 -17>295}296 297define dso_local <2 x double> @vec_splatid() local_unnamed_addr {298; CHECK-LABEL: vec_splatid:299; CHECK:       # %bb.0: # %entry300; CHECK-NEXT:    xxspltidp vs34, 1065353216301; CHECK-NEXT:    blr302entry:303  ret <2 x double> <double 1.000000e+00, double 1.000000e+00>304}305