brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.1 KiB · cd0ace2 Raw
242 lines · plain
1; Test 32-bit signed comparison in which the second operand is constant.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s4 5; Check comparisons with 0.6define double @f1(double %a, double %b, i32 %i1) {7; CHECK-LABEL: f1:8; CHECK: cijl %r2, 09; CHECK: ldr %f0, %f210; CHECK: br %r1411  %cond = icmp slt i32 %i1, 012  %tmp = select i1 %cond, double %a, double %b13  %res = fadd double %tmp, 1.014  ret double %res15}16 17; Check comparisons with 2.18define double @f2(double %a, double %b, i32 %i1) {19; CHECK-LABEL: f2:20; CHECK: cijl %r2, 221; CHECK: ldr %f0, %f222; CHECK: br %r1423  %cond = icmp slt i32 %i1, 224  %tmp = select i1 %cond, double %a, double %b25  %res = fadd double %tmp, 1.026  ret double %res27}28 29; Check the high end of the CIJ range.30define double @f3(double %a, double %b, i32 %i1) {31; CHECK-LABEL: f3:32; CHECK: cijl %r2, 12733; CHECK: ldr %f0, %f234; CHECK: br %r1435  %cond = icmp slt i32 %i1, 12736  %tmp = select i1 %cond, double %a, double %b37  %res = fadd double %tmp, 1.038  ret double %res39}40 41; Check the next value up, which must use CHI instead.42define double @f4(double %a, double %b, i32 %i1) {43; CHECK-LABEL: f4:44; CHECK: chi %r2, 12845; CHECK-NEXT: jl46; CHECK: ldr %f0, %f247; CHECK: br %r1448  %cond = icmp slt i32 %i1, 12849  %tmp = select i1 %cond, double %a, double %b50  %res = fadd double %tmp, 1.051  ret double %res52}53 54; Check the high end of the CHI range.55define double @f5(double %a, double %b, i32 %i1) {56; CHECK-LABEL: f5:57; CHECK: chi %r2, 3276758; CHECK-NEXT: jl59; CHECK: ldr %f0, %f260; CHECK: br %r1461  %cond = icmp slt i32 %i1, 3276762  %tmp = select i1 %cond, double %a, double %b63  %res = fadd double %tmp, 1.064  ret double %res65}66 67; Check the next value up, which must use CFI.68define double @f6(double %a, double %b, i32 %i1) {69; CHECK-LABEL: f6:70; CHECK: cfi %r2, 3276871; CHECK-NEXT: jl72; CHECK: ldr %f0, %f273; CHECK: br %r1474  %cond = icmp slt i32 %i1, 3276875  %tmp = select i1 %cond, double %a, double %b76  %res = fadd double %tmp, 1.077  ret double %res78}79 80; Check the high end of the signed 32-bit range.81define double @f7(double %a, double %b, i32 %i1) {82; CHECK-LABEL: f7:83; CHECK: cfi %r2, 214748364784; CHECK-NEXT: je85; CHECK: ldr %f0, %f286; CHECK: br %r1487  %cond = icmp eq i32 %i1, 214748364788  %tmp = select i1 %cond, double %a, double %b89  %res = fadd double %tmp, 1.090  ret double %res91}92 93; Check the next value up, which should be treated as a negative value.94define double @f8(double %a, double %b, i32 %i1) {95; CHECK-LABEL: f8:96; CHECK: cfi %r2, -214748364897; CHECK-NEXT: je98; CHECK: ldr %f0, %f299; CHECK: br %r14100  %cond = icmp eq i32 %i1, 2147483648101  %tmp = select i1 %cond, double %a, double %b102  %res = fadd double %tmp, 1.0103  ret double %res104}105 106; Check the high end of the negative CIJ range.107define double @f9(double %a, double %b, i32 %i1) {108; CHECK-LABEL: f9:109; CHECK: cijl %r2, -1110; CHECK: ldr %f0, %f2111; CHECK: br %r14112  %cond = icmp slt i32 %i1, -1113  %tmp = select i1 %cond, double %a, double %b114  %res = fadd double %tmp, 1.0115  ret double %res116}117 118; Check the low end of the CIJ range.119define double @f10(double %a, double %b, i32 %i1) {120; CHECK-LABEL: f10:121; CHECK: cijl %r2, -128122; CHECK: ldr %f0, %f2123; CHECK: br %r14124  %cond = icmp slt i32 %i1, -128125  %tmp = select i1 %cond, double %a, double %b126  %res = fadd double %tmp, 1.0127  ret double %res128}129 130; Check the next value down, which must use CHI instead.131define double @f11(double %a, double %b, i32 %i1) {132; CHECK-LABEL: f11:133; CHECK: chi %r2, -129134; CHECK-NEXT: jl135; CHECK: ldr %f0, %f2136; CHECK: br %r14137  %cond = icmp slt i32 %i1, -129138  %tmp = select i1 %cond, double %a, double %b139  %res = fadd double %tmp, 1.0140  ret double %res141}142 143; Check the low end of the CHI range.144define double @f12(double %a, double %b, i32 %i1) {145; CHECK-LABEL: f12:146; CHECK: chi %r2, -32768147; CHECK-NEXT: jl148; CHECK: ldr %f0, %f2149; CHECK: br %r14150  %cond = icmp slt i32 %i1, -32768151  %tmp = select i1 %cond, double %a, double %b152  %res = fadd double %tmp, 1.0153  ret double %res154}155 156; Check the next value down, which must use CFI instead.157define double @f13(double %a, double %b, i32 %i1) {158; CHECK-LABEL: f13:159; CHECK: cfi %r2, -32769160; CHECK-NEXT: jl161; CHECK: ldr %f0, %f2162; CHECK: br %r14163  %cond = icmp slt i32 %i1, -32769164  %tmp = select i1 %cond, double %a, double %b165  %res = fadd double %tmp, 1.0166  ret double %res167}168 169; Check the low end of the signed 32-bit range.170define double @f14(double %a, double %b, i32 %i1) {171; CHECK-LABEL: f14:172; CHECK: cfi %r2, -2147483648173; CHECK-NEXT: je174; CHECK: ldr %f0, %f2175; CHECK: br %r14176  %cond = icmp eq i32 %i1, -2147483648177  %tmp = select i1 %cond, double %a, double %b178  %res = fadd double %tmp, 1.0179  ret double %res180}181 182; Check the next value down, which should be treated as a positive value.183define double @f15(double %a, double %b, i32 %i1) {184; CHECK-LABEL: f15:185; CHECK: cfi %r2, 2147483647186; CHECK-NEXT: je187; CHECK: ldr %f0, %f2188; CHECK: br %r14189  %cond = icmp eq i32 %i1, -2147483649190  %tmp = select i1 %cond, double %a, double %b191  %res = fadd double %tmp, 1.0192  ret double %res193}194 195; Check that < 1 becomes <= 0.196define double @f16(double %a, double %b, i32 %i1) {197; CHECK-LABEL: f16:198; CHECK: cijle %r2, 0199; CHECK: ldr %f0, %f2200; CHECK: br %r14201  %cond = icmp slt i32 %i1, 1202  %tmp = select i1 %cond, double %a, double %b203  %res = fadd double %tmp, 1.0204  ret double %res205}206 207; Check that >= 1 becomes > 0.208define double @f17(double %a, double %b, i32 %i1) {209; CHECK-LABEL: f17:210; CHECK: cijh %r2, 0211; CHECK: ldr %f0, %f2212; CHECK: br %r14213  %cond = icmp sge i32 %i1, 1214  %tmp = select i1 %cond, double %a, double %b215  %res = fadd double %tmp, 1.0216  ret double %res217}218 219; Check that > -1 becomes >= 0.220define double @f18(double %a, double %b, i32 %i1) {221; CHECK-LABEL: f18:222; CHECK: cijhe %r2, 0223; CHECK: ldr %f0, %f2224; CHECK: br %r14225  %cond = icmp sgt i32 %i1, -1226  %tmp = select i1 %cond, double %a, double %b227  %res = fadd double %tmp, 1.0228  ret double %res229}230 231; Check that <= -1 becomes < 0.232define double @f19(double %a, double %b, i32 %i1) {233; CHECK-LABEL: f19:234; CHECK: cijl %r2, 0235; CHECK: ldr %f0, %f2236; CHECK: br %r14237  %cond = icmp sle i32 %i1, -1238  %tmp = select i1 %cond, double %a, double %b239  %res = fadd double %tmp, 1.0240  ret double %res241}242