mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-10 14:10:58 +00:00
AMDGPU: Error if branch distance exceeds limit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269951 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3cd52aec7c
commit
76e32dfbc0
@ -96,8 +96,12 @@ void AMDGPUAsmBackend::applyFixup(const MCFixup &Fixup, char *Data,
|
||||
|
||||
switch ((unsigned)Fixup.getKind()) {
|
||||
case AMDGPU::fixup_si_sopp_br: {
|
||||
int64_t BrImm = (Value - 4) / 4;
|
||||
if (!isInt<16>(BrImm))
|
||||
report_fatal_error("branch size exceeds simm16");
|
||||
|
||||
uint16_t *Dst = (uint16_t*)(Data + Fixup.getOffset());
|
||||
*Dst = (Value - 4) / 4;
|
||||
*Dst = BrImm;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user