summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2016-05-18 19:07:58 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2016-05-18 19:07:58 +0000
commitae265c03f7821001f2e86ccaf960c0509ac95fef (patch)
tree7b192dfb7c7d15c60e9935eb6b9d65a2b45a9f6d /llvm/lib/Target
parentef2e3a7f0b1462000135797b198b733a1752667f (diff)
downloadbcm5719-llvm-ae265c03f7821001f2e86ccaf960c0509ac95fef.tar.gz
bcm5719-llvm-ae265c03f7821001f2e86ccaf960c0509ac95fef.zip
AMDGPU: Fix incorrect simm check
Use signed division otherwise all back jumps fail the check Fixes regression introduced in r269951 Differential Revision: http://reviews.llvm.org/D20380 llvm-svn: 269972
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
index 933c167f013..8fec80307a6 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
@@ -96,7 +96,7 @@ void AMDGPUAsmBackend::applyFixup(const MCFixup &Fixup, char *Data,
switch ((unsigned)Fixup.getKind()) {
case AMDGPU::fixup_si_sopp_br: {
- int64_t BrImm = (Value - 4) / 4;
+ int64_t BrImm = ((int64_t)Value - 4) / 4;
if (!isInt<16>(BrImm))
report_fatal_error("branch size exceeds simm16");
OpenPOWER on IntegriCloud