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

Add comment and fix range check in condition.

llvm-svn: 148455
This commit is contained in:
Jim Grosbach 2012-01-19 01:50:30 +00:00
parent 48afa48c3e
commit ad42e2fc2a

View File

@ -180,8 +180,10 @@ bool ARMAsmBackend::fixupNeedsRelaxation(const MCFixup &Fixup,
return Offset > 254 || Offset < -256;
}
case ARM::fixup_arm_thumb_cp: {
// If the immediate is negative, greater than 1020, or not a multiple
// of four, the wide version of the instruction must be used.
int64_t Offset = int64_t(Value) - 4;
return Offset > 4095 || Offset < 0;
return Offset > 1020 || Offset < 0 || Offset & 3;
}
}
llvm_unreachable("Invalid switch/cash!?");