Skip to content
  • Evan Cheng's avatar
    - Fix codegen for pc relative constant (e.g. JT) in thumb mode: · 83f35170
    Evan Cheng authored
            .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
    LPCRELL0:
            add r1, pc, #PCRELV0
    This is not legal since add r1, pc, #c requires the constant be a multiple of 4.
    Do the following instead:
            .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
    LPCRELL0:
            mov r1, #PCRELV0
            add r1, pc
    
    - In thumb mode, it's not possible to use .set generate a pc relative stub
      address. The stub is ARM code which is in a different section from the thumb
      code. Load the value from a constpool instead.
    - Some asm printing clean up.
    
    llvm-svn: 33664
    83f35170
Loading