chiark / gitweb /
base/asm-common.h: Accept condition codes in ARM PIC macros.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 24 Jun 2016 00:17:20 +0000 (01:17 +0100)
Confusingly, the `leaext' macro already accepted a condition argument,
but did nothing with it.  Add the same argument to both (as the first
optional argument), and actually make the instructions be conditional.

base/asm-common.h

index 4d0d9a60d280aa1e07d235e8358acdc70c96fef9..28ddd0d1893119d62aee65bca6fd1f211029a427 100644 (file)
@@ -173,20 +173,20 @@ _where_am_i.\got :
 #define GOTREG r9
 
 // Maybe load GOT address into GOT.
-       .macro  ldgot   got=GOTREG
+       .macro  ldgot   cond=, got=GOTREG
 #if WANT_PIC
-       ldr     \got, =_GLOBAL_OFFSET_TABLE_ - . - 12
-       add     \got, pc, \got
+       ldr\cond \got, =_GLOBAL_OFFSET_TABLE_ - . - 12
+       add\cond \got, pc, \got
 #endif
        .endm
 
 // Load address of external symbol ADDR into REG, maybe using GOT.
        .macro  leaext  reg, addr, cond=, got=GOTREG
 #if WANT_PIC
-       ldr     \reg, =\addr(GOT)
-       ldr     \reg, [\got, \reg]
+       ldr\cond \reg, =\addr(GOT)
+       ldr\cond \reg, [\got, \reg]
 #else
-       ldr     \reg, =\addr
+       ldr\cond \reg, =\addr
 #endif
        .endm