mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
AMDGPU: Error if branch distance exceeds limit
llvm-svn: 269951
This commit is contained in:
parent
41311e20a0
commit
326d5c727c
@ -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