[llvm] r269972 - AMDGPU: Fix incorrect simm check
Jan Vesely via llvm-commits
llvm-commits at lists.llvm.org
Wed May 18 12:07:59 PDT 2016
Author: jvesely
Date: Wed May 18 14:07:58 2016
New Revision: 269972
URL: http://llvm.org/viewvc/llvm-project?rev=269972&view=rev
Log:
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
Modified:
llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp?rev=269972&r1=269971&r2=269972&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp Wed May 18 14:07:58 2016
@@ -96,7 +96,7 @@ void AMDGPUAsmBackend::applyFixup(const
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");
More information about the llvm-commits
mailing list