2018-01-02 17:30:47 +01:00
|
|
|
; RUN: llc -O0 -fast-isel -fast-isel-abort=1 -verify-machineinstrs -mtriple=arm64-apple-darwin < %s | FileCheck %s
|
|
|
|
; RUN: llc %s -O0 -fast-isel -fast-isel-abort=1 -mtriple=arm64-apple-darwin -print-machineinstrs=expand-isel-pseudos -o /dev/null 2> %t
|
2014-05-08 12:30:56 +02:00
|
|
|
; RUN: FileCheck %s < %t --check-prefix=CHECK-SSA
|
|
|
|
|
|
|
|
; CHECK-SSA-LABEL: Machine code for function t1
|
|
|
|
|
2017-12-07 11:40:31 +01:00
|
|
|
; CHECK-SSA: [[QUOTREG:%[0-9]+]]:gpr32 = SDIVWr
|
|
|
|
; CHECK-SSA-NOT: [[QUOTREG]] =
|
|
|
|
; CHECK-SSA: {{%[0-9]+}}:gpr32 = MSUBWrrr killed [[QUOTREG]]
|
2014-05-08 12:30:56 +02:00
|
|
|
|
|
|
|
; CHECK-SSA-LABEL: Machine code for function t2
|
2014-03-29 11:18:08 +01:00
|
|
|
|
|
|
|
define i32 @t1(i32 %a, i32 %b) {
|
|
|
|
; CHECK: @t1
|
2014-05-08 12:30:56 +02:00
|
|
|
; CHECK: sdiv [[TMP:w[0-9]+]], w0, w1
|
|
|
|
; CHECK: msub w0, [[TMP]], w1, w0
|
2014-03-29 11:18:08 +01:00
|
|
|
%1 = srem i32 %a, %b
|
|
|
|
ret i32 %1
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @t2(i64 %a, i64 %b) {
|
|
|
|
; CHECK: @t2
|
2014-05-08 12:30:56 +02:00
|
|
|
; CHECK: sdiv [[TMP:x[0-9]+]], x0, x1
|
|
|
|
; CHECK: msub x0, [[TMP]], x1, x0
|
2014-03-29 11:18:08 +01:00
|
|
|
%1 = srem i64 %a, %b
|
|
|
|
ret i64 %1
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @t3(i32 %a, i32 %b) {
|
|
|
|
; CHECK: @t3
|
2014-05-08 12:30:56 +02:00
|
|
|
; CHECK: udiv [[TMP:w[0-9]+]], w0, w1
|
|
|
|
; CHECK: msub w0, [[TMP]], w1, w0
|
2014-03-29 11:18:08 +01:00
|
|
|
%1 = urem i32 %a, %b
|
|
|
|
ret i32 %1
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @t4(i64 %a, i64 %b) {
|
|
|
|
; CHECK: @t4
|
2014-05-08 12:30:56 +02:00
|
|
|
; CHECK: udiv [[TMP:x[0-9]+]], x0, x1
|
|
|
|
; CHECK: msub x0, [[TMP]], x1, x0
|
2014-03-29 11:18:08 +01:00
|
|
|
%1 = urem i64 %a, %b
|
|
|
|
ret i64 %1
|
|
|
|
}
|