1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/CodeGen/Mips/mips64muldiv.ll
Daniel Sanders ff992a6f20 [mips][mips64r6] Improve tests affected by the changes to multiplies and divides
Summary:
MIPS32r6/MIPS64r6 support has not been added yet.

inlineasm-cnstrnt-reg.ll:
  Explicitly specify the CPU since it will not work on MIPS32r6/MIPS64r6
  when -integrated-as is the default. We can't change the mnemonic since the
  LO register is an implicit def of mtlo and MIPS32r6/MIPS64r6 has no
  instructions that use LO.

2008-08-01-AsmInline.ll:
  Explicitly specify the CPU since MIPS32r6/MIPS64r6 will correctly emit
  different code and this is a regression test.

mips64instrs.ll and mips64muldiv.ll
  Check registers and the way the multiply is used in m1

divrem.ll
  Check registers and use multiple filecheck prefixes to limit redundancy

Reviewers: vmedic, jkolek, zoran.jovanovic, matheusalmeida

Reviewed By: matheusalmeida

Subscribers: matheusalmeida

Differential Revision: http://reviews.llvm.org/D3894

llvm-svn: 210656
2014-06-11 15:48:00 +00:00

65 lines
1.6 KiB
LLVM

; RUN: llc -march=mips64el -mcpu=mips4 < %s | FileCheck %s -check-prefix=ALL
; RUN: llc -march=mips64el -mcpu=mips64 < %s | FileCheck %s -check-prefix=ALL
define i64 @m0(i64 %a0, i64 %a1) nounwind readnone {
entry:
; ALL-LABEL: m0:
; ALL: dmult ${{[45]}}, ${{[45]}}
; ALL: mflo $2
%mul = mul i64 %a1, %a0
ret i64 %mul
}
define i64 @m1(i64 %a) nounwind readnone {
entry:
; ALL-LABEL: m1:
; ALL: lui $[[T0:[0-9]+]], 21845
; ALL: addiu $[[T0]], $[[T0]], 21845
; ALL: dsll $[[T0]], $[[T0]], 16
; ALL: addiu $[[T0]], $[[T0]], 21845
; ALL: dsll $[[T0]], $[[T0]], 16
; ALL: addiu $[[T0]], $[[T0]], 21846
; ALL: dmult ${{[45]}}, $[[T0]]
; ALL: mfhi $[[T1:[0-9]+]]
; ALL: dsrl $2, $[[T1]], 63
; ALL: daddu $2, $[[T1]], $2
%div = sdiv i64 %a, 3
ret i64 %div
}
define i64 @d0(i64 %a0, i64 %a1) nounwind readnone {
entry:
; ALL-LABEL: d0:
; ALL: ddivu $zero, $4, $5
; ALL: mflo $2
%div = udiv i64 %a0, %a1
ret i64 %div
}
define i64 @d1(i64 %a0, i64 %a1) nounwind readnone {
entry:
; ALL-LABEL: d1:
; ALL: ddiv $zero, $4, $5
; ALL: mflo $2
%div = sdiv i64 %a0, %a1
ret i64 %div
}
define i64 @d2(i64 %a0, i64 %a1) nounwind readnone {
entry:
; ALL-LABEL: d2:
; ALL: ddivu $zero, $4, $5
; ALL: mfhi $2
%rem = urem i64 %a0, %a1
ret i64 %rem
}
define i64 @d3(i64 %a0, i64 %a1) nounwind readnone {
entry:
; ALL-LABEL: d3:
; ALL: ddiv $zero, $4, $5
; ALL: mfhi $2
%rem = srem i64 %a0, %a1
ret i64 %rem
}