1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/CodeGen/Mips/mips64muldiv.ll
Akira Hatanaka 2e4f1786b1 Add function MipsDAGToDAGISel::SelectMULT and factor out code that generates
nodes needed for multiplication. Add code for selecting 64-bit MULHS and MULHU
nodes.

llvm-svn: 147008
2011-12-20 23:10:57 +00:00

50 lines
848 B
LLVM

; RUN: llc -march=mips64el -mcpu=mips64 < %s | FileCheck %s
define i64 @m0(i64 %a0, i64 %a1) nounwind readnone {
entry:
; CHECK: dmult
; CHECK: mflo
%mul = mul i64 %a1, %a0
ret i64 %mul
}
define i64 @m1(i64 %a) nounwind readnone {
entry:
; CHECK: dmult
; CHECK: mfhi
%div = sdiv i64 %a, 3
ret i64 %div
}
define i64 @d0(i64 %a0, i64 %a1) nounwind readnone {
entry:
; CHECK: ddivu
; CHECK: mflo
%div = udiv i64 %a0, %a1
ret i64 %div
}
define i64 @d1(i64 %a0, i64 %a1) nounwind readnone {
entry:
; CHECK: ddiv
; CHECK: mflo
%div = sdiv i64 %a0, %a1
ret i64 %div
}
define i64 @d2(i64 %a0, i64 %a1) nounwind readnone {
entry:
; CHECK: ddivu
; CHECK: mfhi
%rem = urem i64 %a0, %a1
ret i64 %rem
}
define i64 @d3(i64 %a0, i64 %a1) nounwind readnone {
entry:
; CHECK: ddiv
; CHECK: mfhi
%rem = srem i64 %a0, %a1
ret i64 %rem
}