1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s 3 4define i64 @test1(i64 %X, i64 %Y) { 5; CHECK-LABEL: test1: 6; CHECK: .cfi_startproc 7; CHECK-NEXT: ! %bb.0: 8; CHECK-NEXT: sdivx %o0, %o1, %o2 9; CHECK-NEXT: mulx %o2, %o1, %o1 10; CHECK-NEXT: retl 11; CHECK-NEXT: sub %o0, %o1, %o0 12 %tmp1 = srem i64 %X, %Y 13 ret i64 %tmp1 14} 15 16define i64 @test2(i64 %X, i64 %Y) { 17; CHECK-LABEL: test2: 18; CHECK: .cfi_startproc 19; CHECK-NEXT: ! %bb.0: 20; CHECK-NEXT: udivx %o0, %o1, %o2 21; CHECK-NEXT: mulx %o2, %o1, %o1 22; CHECK-NEXT: retl 23; CHECK-NEXT: sub %o0, %o1, %o0 24 %tmp1 = urem i64 %X, %Y 25 ret i64 %tmp1 26} 27 28; PR18150 29define i64 @test3(i64 %b) { 30; CHECK-LABEL: test3: 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 38; CHECK-NEXT: retl 39; CHECK-NEXT: sub %o0, %o1, %o0 40entry: 41 %mul = mul i64 %b, 2606459 42 %rem = urem i64 %mul, 1021 43 ret i64 %rem 44} 45