1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s
4 define i64 @test1(i64 %X, i64 %Y) {
6 ; CHECK: .cfi_startproc
8 ; CHECK-NEXT: sdivx %o0, %o1, %o2
9 ; CHECK-NEXT: mulx %o2, %o1, %o1
11 ; CHECK-NEXT: sub %o0, %o1, %o0
12 %tmp1 = srem i64 %X, %Y
16 define i64 @test2(i64 %X, i64 %Y) {
18 ; CHECK: .cfi_startproc
19 ; CHECK-NEXT: ! %bb.0:
20 ; CHECK-NEXT: udivx %o0, %o1, %o2
21 ; CHECK-NEXT: mulx %o2, %o1, %o1
23 ; CHECK-NEXT: sub %o0, %o1, %o0
24 %tmp1 = urem i64 %X, %Y
29 define i64 @test3(i64 %b) {
31 ; CHECK: .cfi_startproc
32 ; CHECK-NEXT: ! %bb.0: ! %entry
33 ; CHECK-NEXT: sethi 2545, %o1
34 ; CHECK-NEXT: or %o1, 379, %o1
35 ; CHECK-NEXT: mulx %o0, %o1, %o0
36 ; CHECK-NEXT: udivx %o0, 1021, %o1
37 ; CHECK-NEXT: mulx %o1, 1021, %o1
39 ; CHECK-NEXT: sub %o0, %o1, %o0
41 %mul = mul i64 %b, 2606459
42 %rem = urem i64 %mul, 1021