Skip to content

Commit

Permalink
AMDGPU: Fix incorrect simm check
Browse files Browse the repository at this point in the history
Use signed division otherwise all back jumps fail the check
Fixes regression introduced in r269951

Differential Revision: http://reviews.llvm.org/D20380

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269972 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
jvesely committed May 18, 2016
1 parent fa30381 commit c8ee6f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit c8ee6f3

Please sign in to comment.