112 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK3; RUN: llc -mtriple=aarch64-linux-gnu -fast-isel -fast-isel-abort=1 -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK-FAST-ISEL4 5define i32 @sdiv_i32_exact(i32 %a) {6; CHECK-LABEL: sdiv_i32_exact:7; CHECK: // %bb.0:8; CHECK-NEXT: asr w0, w0, #39; CHECK-NEXT: ret10;11; CHECK-FAST-ISEL-LABEL: sdiv_i32_exact:12; CHECK-FAST-ISEL: // %bb.0:13; CHECK-FAST-ISEL-NEXT: asr w0, w0, #314; CHECK-FAST-ISEL-NEXT: ret15 %1 = sdiv exact i32 %a, 816 ret i32 %117}18 19define i32 @sdiv_i32_pos(i32 %a) {20; CHECK-LABEL: sdiv_i32_pos:21; CHECK: // %bb.0:22; CHECK-NEXT: add w8, w0, #723; CHECK-NEXT: cmp w0, #024; CHECK-NEXT: csel w8, w8, w0, mi25; CHECK-NEXT: asr w0, w8, #326; CHECK-NEXT: ret27;28; CHECK-FAST-ISEL-LABEL: sdiv_i32_pos:29; CHECK-FAST-ISEL: // %bb.0:30; CHECK-FAST-ISEL-NEXT: add w8, w0, #731; CHECK-FAST-ISEL-NEXT: cmp w0, #032; CHECK-FAST-ISEL-NEXT: csel w8, w8, w0, lt33; CHECK-FAST-ISEL-NEXT: asr w0, w8, #334; CHECK-FAST-ISEL-NEXT: ret35 %1 = sdiv i32 %a, 836 ret i32 %137}38 39define i32 @sdiv_i32_neg(i32 %a) {40; CHECK-LABEL: sdiv_i32_neg:41; CHECK: // %bb.0:42; CHECK-NEXT: add w8, w0, #743; CHECK-NEXT: cmp w0, #044; CHECK-NEXT: csel w8, w8, w0, mi45; CHECK-NEXT: neg w0, w8, asr #346; CHECK-NEXT: ret47;48; CHECK-FAST-ISEL-LABEL: sdiv_i32_neg:49; CHECK-FAST-ISEL: // %bb.0:50; CHECK-FAST-ISEL-NEXT: add w8, w0, #751; CHECK-FAST-ISEL-NEXT: cmp w0, #052; CHECK-FAST-ISEL-NEXT: csel w8, w8, w0, lt53; CHECK-FAST-ISEL-NEXT: neg w0, w8, asr #354; CHECK-FAST-ISEL-NEXT: ret55 %1 = sdiv i32 %a, -856 ret i32 %157}58 59define i64 @sdiv_i64_exact(i64 %a) {60; CHECK-LABEL: sdiv_i64_exact:61; CHECK: // %bb.0:62; CHECK-NEXT: asr x0, x0, #463; CHECK-NEXT: ret64;65; CHECK-FAST-ISEL-LABEL: sdiv_i64_exact:66; CHECK-FAST-ISEL: // %bb.0:67; CHECK-FAST-ISEL-NEXT: asr x0, x0, #468; CHECK-FAST-ISEL-NEXT: ret69 %1 = sdiv exact i64 %a, 1670 ret i64 %171}72 73define i64 @sdiv_i64_pos(i64 %a) {74; CHECK-LABEL: sdiv_i64_pos:75; CHECK: // %bb.0:76; CHECK-NEXT: add x8, x0, #1577; CHECK-NEXT: cmp x0, #078; CHECK-NEXT: csel x8, x8, x0, mi79; CHECK-NEXT: asr x0, x8, #480; CHECK-NEXT: ret81;82; CHECK-FAST-ISEL-LABEL: sdiv_i64_pos:83; CHECK-FAST-ISEL: // %bb.0:84; CHECK-FAST-ISEL-NEXT: add x8, x0, #1585; CHECK-FAST-ISEL-NEXT: cmp x0, #086; CHECK-FAST-ISEL-NEXT: csel x8, x8, x0, lt87; CHECK-FAST-ISEL-NEXT: asr x0, x8, #488; CHECK-FAST-ISEL-NEXT: ret89 %1 = sdiv i64 %a, 1690 ret i64 %191}92 93define i64 @sdiv_i64_neg(i64 %a) {94; CHECK-LABEL: sdiv_i64_neg:95; CHECK: // %bb.0:96; CHECK-NEXT: add x8, x0, #1597; CHECK-NEXT: cmp x0, #098; CHECK-NEXT: csel x8, x8, x0, mi99; CHECK-NEXT: neg x0, x8, asr #4100; CHECK-NEXT: ret101;102; CHECK-FAST-ISEL-LABEL: sdiv_i64_neg:103; CHECK-FAST-ISEL: // %bb.0:104; CHECK-FAST-ISEL-NEXT: add x8, x0, #15105; CHECK-FAST-ISEL-NEXT: cmp x0, #0106; CHECK-FAST-ISEL-NEXT: csel x8, x8, x0, lt107; CHECK-FAST-ISEL-NEXT: neg x0, x8, asr #4108; CHECK-FAST-ISEL-NEXT: ret109 %1 = sdiv i64 %a, -16110 ret i64 %1111}112