1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Cast MO.getImm() to unsigned before comparing with an unsigned limit.

llvm-svn: 81318
This commit is contained in:
Evan Cheng 2009-09-09 06:05:16 +00:00
parent a78433a090
commit 91e719a6a1
2 changed files with 3 additions and 3 deletions

View File

@ -504,7 +504,7 @@ Thumb2SizeReduce::ReduceToNarrow(MachineBasicBlock &MBB, MachineInstr *MI,
return false;
} else if (MO.isImm() &&
!TID.OpInfo[i].isPredicate()) {
if (MO.getImm() > Limit || (MO.getImm() & (Scale-1)) != 0)
if (((unsigned)MO.getImm()) > Limit || (MO.getImm() & (Scale-1)) != 0)
return false;
}
}

View File

@ -19,7 +19,7 @@ define i1 @f2(i32 %a) {
; 0xcc00cc00 = 3422604288
define i1 @f3(i32 %a) {
; CHECK: f3:
; CHECK: cmp r0, #-872363008
; CHECK: cmp.w r0, #-872363008
%tmp = icmp ne i32 %a, 3422604288
ret i1 %tmp
}
@ -27,7 +27,7 @@ define i1 @f3(i32 %a) {
; 0xdddddddd = 3722304989
define i1 @f4(i32 %a) {
; CHECK: f4:
; CHECK: cmp r0, #-572662307
; CHECK: cmp.w r0, #-572662307
%tmp = icmp ne i32 %a, 3722304989
ret i1 %tmp
}