SparcV9 doesnt have rem instruction either.
[oota-llvm.git] / test / CodeGen / SPARC / rem.ll
1 ; RUN: llc < %s -march=sparcv9 | FileCheck %s
2
3 ; CHECK-LABEL: test1:
4 ; CHECK:        sdivx %o0, %o1, %o2
5 ; CHECK-NEXT:   mulx %o2, %o1, %o1
6 ; CHECK-NEXT:   jmp %o7+8
7 ; CHECK-NEXT:   sub %o0, %o1, %o0
8
9 define i64 @test1(i64 %X, i64 %Y) {
10         %tmp1 = srem i64 %X, %Y
11         ret i64 %tmp1
12 }
13
14 ; CHECK-LABEL: test2:
15 ; CHECK:        udivx %o0, %o1, %o2
16 ; CHECK-NEXT:   mulx %o2, %o1, %o1
17 ; CHECK-NEXT:   jmp %o7+8
18 ; CHECK-NEXT:   sub %o0, %o1, %o0
19
20 define i64 @test2(i64 %X, i64 %Y) {
21         %tmp1 = urem i64 %X, %Y
22         ret i64 %tmp1
23 }