1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/CodeGen/Mips/Fast-ISel/bricmpi1.ll
Matthias Braun aee5f0fc5d Relax fast register allocator related test cases; NFC
- Relex hard coded registers and stack frame sizes
- Some test cleanups
- Change phi-dbg.ll to match on mir output after phi elimination instead
  of going through the whole codegen pipeline.

This is in preparation for https://reviews.llvm.org/D52010
I'm committing all the test changes upfront that work before and after
independently.

llvm-svn: 345532
2018-10-29 20:10:42 +00:00

190 lines
4.4 KiB
LLVM

; RUN: llc -march=mipsel -relocation-model=pic -O0 -fast-isel=true -mcpu=mips32r2 \
; RUN: < %s -verify-machineinstrs | FileCheck %s
define void @testeq(i32, i32) {
; CHECK-LABEL: testeq:
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: beq $[[REG0]], $[[REG1]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp eq i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
define void @testne(i32, i32) {
; CHECK-LABEL: testne:
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: bne $[[REG0]], $[[REG1]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp ne i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
define void @testugt(i32, i32) {
; CHECK-LABEL: testugt:
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: sltu $[[REG2:[0-9]+]], $[[REG1]], $[[REG0]]
; CHECK: bnez $[[REG2]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp ugt i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
define void @testuge(i32, i32) {
; CHECK-LABEL: testuge:
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: sltu $[[REG2:[0-9]+]], $[[REG0]], $[[REG1]]
; CHECK: beqz $[[REG2]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp uge i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
define void @testult(i32, i32) {
; CHECK-LABEL: testult:
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: sltu $[[REG2:[0-9]+]], $[[REG0]], $[[REG1]]
; CHECK: bnez $[[REG2]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp ult i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
define void @testule(i32, i32) {
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: sltu $[[REG2:[0-9]+]], $[[REG1]], $[[REG0]]
; CHECK: beqz $[[REG2]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp ule i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
define void @testsgt(i32, i32) {
; CHECK-LABEL: testsgt:
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: negu $[[REG2:[0-9]+]], $[[REG0]]
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: negu $[[REG3:[0-9]+]], $[[REG1]]
; CHECK: slt $[[REG4:[0-9]+]], $[[REG3]], $[[REG2]]
; CHECK: bnez $[[REG4]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp sgt i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
define void @testsge(i32, i32) {
; CHECK-LABEL: testsge:
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: negu $[[REG0]], $[[REG0]]
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: negu $[[REG1]], $[[REG1]]
; CHECK: slt $[[REG2:[0-9]+]], $[[REG0]], $[[REG1]]
; CHECK: beqz $[[REG2]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp sge i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
define void @testslt(i32, i32) {
; CHECK-LABEL: testslt:
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: negu $[[REG0]], $[[REG0]]
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: negu $[[REG1]], $[[REG1]]
; CHECK: slt $[[REG2:[0-9]+]], $[[REG0]], $[[REG1]]
; CHECK: bnez $[[REG2]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp slt i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
define void @testsle(i32, i32) {
; CHECK-LABEL: testsle:
; CHECK: andi $[[REG0:[0-9]+]], $4, 1
; CHECK: negu $[[REG2:[0-9]+]], $[[REG0]]
; CHECK: andi $[[REG1:[0-9]+]], $5, 1
; CHECK: negu $[[REG3:[0-9]+]], $[[REG1]]
; CHECK: slt $[[REG4:[0-9]+]], $[[REG3]], $[[REG2]]
; CHECK: beqz $[[REG4]],
%3 = trunc i32 %0 to i1
%4 = trunc i32 %1 to i1
%5 = icmp sle i1 %3, %4
br i1 %5, label %end, label %trap
trap:
call void @llvm.trap()
br label %end
end:
ret void
}
declare void @llvm.trap()