126 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s3; RUN: llc < %s -mtriple=aarch64-- -global-isel -global-isel-abort=1 | FileCheck %s --check-prefix=GISEL4 5define <4 x i32> @sextbool_add_vector(<4 x i32> %c1, <4 x i32> %c2, <4 x i32> %x) {6; CHECK-LABEL: sextbool_add_vector:7; CHECK: // %bb.0:8; CHECK-NEXT: cmeq v0.4s, v0.4s, v1.4s9; CHECK-NEXT: add v0.4s, v2.4s, v0.4s10; CHECK-NEXT: ret11;12; GISEL-LABEL: sextbool_add_vector:13; GISEL: // %bb.0:14; GISEL-NEXT: cmeq v0.4s, v0.4s, v1.4s15; GISEL-NEXT: add v0.4s, v2.4s, v0.4s16; GISEL-NEXT: ret17 %c = icmp eq <4 x i32> %c1, %c218 %b = sext <4 x i1> %c to <4 x i32>19 %s = add <4 x i32> %x, %b20 ret <4 x i32> %s21}22 23define <4 x i32> @zextbool_sub_vector(<4 x i32> %c1, <4 x i32> %c2, <4 x i32> %x) {24; CHECK-LABEL: zextbool_sub_vector:25; CHECK: // %bb.0:26; CHECK-NEXT: cmeq v0.4s, v0.4s, v1.4s27; CHECK-NEXT: add v0.4s, v2.4s, v0.4s28; CHECK-NEXT: ret29;30; GISEL-LABEL: zextbool_sub_vector:31; GISEL: // %bb.0:32; GISEL-NEXT: movi v3.4s, #133; GISEL-NEXT: cmeq v0.4s, v0.4s, v1.4s34; GISEL-NEXT: and v0.16b, v0.16b, v3.16b35; GISEL-NEXT: sub v0.4s, v2.4s, v0.4s36; GISEL-NEXT: ret37 %c = icmp eq <4 x i32> %c1, %c238 %b = zext <4 x i1> %c to <4 x i32>39 %s = sub <4 x i32> %x, %b40 ret <4 x i32> %s41}42 43define i32 @assertsext_sub_1(i1 signext %cond, i32 %y) {44; CHECK-LABEL: assertsext_sub_1:45; CHECK: // %bb.0:46; CHECK-NEXT: add w0, w1, w047; CHECK-NEXT: ret48;49; GISEL-LABEL: assertsext_sub_1:50; GISEL: // %bb.0:51; GISEL-NEXT: and w8, w0, #0x152; GISEL-NEXT: sub w0, w1, w853; GISEL-NEXT: ret54 %e = zext i1 %cond to i3255 %r = sub i32 %y, %e56 ret i32 %r57}58 59define i32 @assertsext_add_1(i1 signext %cond, i32 %y) {60; CHECK-LABEL: assertsext_add_1:61; CHECK: // %bb.0:62; CHECK-NEXT: sub w0, w1, w063; CHECK-NEXT: ret64;65; GISEL-LABEL: assertsext_add_1:66; GISEL: // %bb.0:67; GISEL-NEXT: and w8, w0, #0x168; GISEL-NEXT: add w0, w8, w169; GISEL-NEXT: ret70 %e = zext i1 %cond to i3271 %r = add i32 %e, %y72 ret i32 %r73}74 75define i32 @assertsext_add_1_commute(i1 signext %cond, i32 %y) {76; CHECK-LABEL: assertsext_add_1_commute:77; CHECK: // %bb.0:78; CHECK-NEXT: sub w0, w1, w079; CHECK-NEXT: ret80;81; GISEL-LABEL: assertsext_add_1_commute:82; GISEL: // %bb.0:83; GISEL-NEXT: and w8, w0, #0x184; GISEL-NEXT: add w0, w1, w885; GISEL-NEXT: ret86 %e = zext i1 %cond to i3287 %r = add i32 %y, %e88 ret i32 %r89}90 91define i32 @callee_signext_i1(i1 signext %0) {92; CHECK-LABEL: callee_signext_i1:93; CHECK: // %bb.0:94; CHECK-NEXT: ret95;96; GISEL-LABEL: callee_signext_i1:97; GISEL: // %bb.0:98; GISEL-NEXT: ret99 %r = sext i1 %0 to i32100 ret i32 %r101}102 103define i32 @caller_signext_i1() {104; CHECK-LABEL: caller_signext_i1:105; CHECK: // %bb.0:106; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill107; CHECK-NEXT: .cfi_def_cfa_offset 16108; CHECK-NEXT: .cfi_offset w30, -16109; CHECK-NEXT: mov w0, #-1 // =0xffffffff110; CHECK-NEXT: bl callee_signext_i1111; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload112; CHECK-NEXT: ret113;114; GISEL-LABEL: caller_signext_i1:115; GISEL: // %bb.0:116; GISEL-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill117; GISEL-NEXT: .cfi_def_cfa_offset 16118; GISEL-NEXT: .cfi_offset w30, -16119; GISEL-NEXT: mov w0, #-1 // =0xffffffff120; GISEL-NEXT: bl callee_signext_i1121; GISEL-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload122; GISEL-NEXT: ret123 %r = call i32 @callee_signext_i1(i1 signext true)124 ret i32 %r125}126