#define FUNC(name) \
.globl F(name); \
TYPE_FUNC(name); \
- .macro ENDFUNC; _ENDFUNC(name); .endm; \
+ .macro ENDFUNC; _ENDFUNC(name); .endm; \
FUNC_PREHOOK(name); \
F(name): \
FUNC_POSTHOOK(name)
.intel_syntax noprefix
// Call external subroutine at ADDR, possibly via PLT.
- .macro callext addr
+.macro callext addr
#if WANT_PIC
call \addr@PLT
#else
call \addr
#endif
- .endm
+.endm
// Do I need to arrange a spare GOT register?
#if WANT_PIC && CPUFAM_X86
#define GOTREG ebx // Not needed in AMD64 so don't care.
// Maybe load GOT address into GOT.
- .macro ldgot got=GOTREG
+.macro ldgot got=GOTREG
#if WANT_PIC && CPUFAM_X86
call _where_am_i.\got
add \got, offset _GLOBAL_OFFSET_TABLE_
#endif
- .endm
+.endm
// Maybe build a helper subroutine for `ldgot GOT'.
- .macro gotaux got=GOTREG
+.macro gotaux got=GOTREG
#if WANT_PIC && CPUFAM_X86
.align 16
_where_am_i.\got :
mov \got, [esp]
ret
#endif
- .endm
+.endm
// Load address of external symbol ADDR into REG, maybe using GOT.
- .macro leaext reg, addr, got=GOTREG
+.macro leaext reg, addr, got=GOTREG
#if WANT_PIC
# if CPUFAM_X86
mov \reg, [\got + \addr@GOT]
lea \reg, \addr[rip]
# endif
#endif
- .endm
+.endm
// Address expression (possibly using a base register, and a displacement)
// referring to ADDR, which is within our module, maybe using GOT.
#define ENDFUNC_HOOK(name) .ltorg
// Call external subroutine at ADDR, possibly via PLT.
- .macro callext addr, cond=
+.macro callext addr, cond=
#if WANT_PIC
bl\cond \addr(PLT)
#else
bl\cond \addr
#endif
- .endm
+.endm
// Do I need to arrange a spare GOT register?
#if WANT_PIC
#define GOTREG r9
// Maybe load GOT address into GOT.
- .macro ldgot cond=, got=GOTREG
+.macro ldgot cond=, got=GOTREG
#if WANT_PIC
ldr\cond \got, .L$_ldgot$\@
.L$_ldgot_pc$\@:
add\cond \got, pc, \got
- _LIT
+ _LIT
.balign 4
.L$_ldgot$\@:
.word _GLOBAL_OFFSET_TABLE_ - .L$_ldgot_pc$\@ - .L$_pcoff
- _ENDLIT
+ _ENDLIT
#endif
- .endm
+.endm
// Load address of external symbol ADDR into REG, maybe using GOT.
- .macro leaext reg, addr, cond=, got=GOTREG
+.macro leaext reg, addr, cond=, got=GOTREG
#if WANT_PIC
ldr\cond \reg, .L$_leaext$\@
ldr\cond \reg, [\got, \reg]
- _LIT
+ _LIT
.balign 4
.L$_leaext$\@:
.word \addr(GOT)
- _ENDLIT
+ _ENDLIT
#else
ldr\cond \reg, =\addr
#endif
- .endm
+.endm
// Load address of external symbol ADDR into REG directly.
- .macro leaextq reg, addr, cond=
+.macro leaextq reg, addr, cond=
#if WANT_PIC
ldr\cond \reg, .L$_leaextq$\@
.L$_leaextq_pc$\@:
add\cond \reg, pc
ldr\cond \reg, [\reg]
.endif
- _LIT
+ _LIT
.balign 4
.L$_leaextq$\@:
.word \addr(GOT_PREL) + (. - .L$_leaextq_pc$\@ - .L$_pcoff)
- _ENDLIT
+ _ENDLIT
#else
ldr\cond \reg, =\addr
#endif
- .endm
+.endm
#endif
* the feedforward step.
*/
-CPU_DISPATCH(static, (void),
- void, core, (unsigned r, const chacha_matrix src,
- chacha_matrix dest),
- (r, src, dest),
- pick_core, simple_core);
+CPU_DISPATCH(static, (void), void, core,
+ (unsigned r, const chacha_matrix src, chacha_matrix dest),
+ (r, src, dest), pick_core, simple_core);
static void simple_core(unsigned r, const chacha_matrix src,
chacha_matrix dest)
k->wi[i] = k->w[j + jj++];
}
-CPU_DISPATCH(static, EMPTY, void, setup, (rijndael_ctx *k, unsigned nb,
- const void *buf, unsigned nk),
+CPU_DISPATCH(static, EMPTY, void, setup,
+ (rijndael_ctx *k, unsigned nb, const void *buf, unsigned nk),
(k, nb, buf, nk), pick_setup, simple_setup)
#if CPUFAM_X86 || CPUFAM_AMD64
#include "config.h"
#include "asm-common.h"
-///--------------------------------------------------------------------------
-/// External definitions.
-
.globl F(abort)
.globl F(rijndael_rcon)
///--------------------------------------------------------------------------
/// Encrypting and decrypting blocks.
- .macro encdec op, aes, koff
-FUNC(rijndael_\op\()_x86ish_aesni)
+.macro encdec op, aes, koff
+ FUNC(rijndael_\op\()_x86ish_aesni)
// Find the magic endianness-swapping table.
ldgot ecx
#undef DST
#undef NR
-ENDFUNC
- .endm
+ ENDFUNC
+.endm
encdec eblk, aesenc, w
encdec dblk, aesdec, wi
* Use: Low-level block encryption and decryption.
*/
-CPU_DISPATCH(EMPTY, EMPTY, void, rijndael_eblk, (const rijndael_ctx *k,
- const uint32 s[4],
- uint32 d[4]),
+CPU_DISPATCH(EMPTY, EMPTY, void, rijndael_eblk,
+ (const rijndael_ctx *k, const uint32 s[4], uint32 d[4]),
(k, s, d), pick_eblk, simple_eblk)
-CPU_DISPATCH(EMPTY, EMPTY, void, rijndael_dblk, (const rijndael_ctx *k,
- const uint32 s[4],
- uint32 d[4]),
+CPU_DISPATCH(EMPTY, EMPTY, void, rijndael_dblk,
+ (const rijndael_ctx *k, const uint32 s[4], uint32 d[4]),
(k, s, d), pick_dblk, simple_dblk)
#if CPUFAM_X86 || CPUFAM_AMD64
* the feedforward step.
*/
-CPU_DISPATCH(static, (void),
- void, core, (unsigned r, const salsa20_matrix src,
- salsa20_matrix dest),
- (r, src, dest),
- pick_core, simple_core);
+CPU_DISPATCH(static, (void), void, core,
+ (unsigned r, const salsa20_matrix src, salsa20_matrix dest),
+ (r, src, dest), pick_core, simple_core);
static void simple_core(unsigned r, const salsa20_matrix src,
salsa20_matrix dest)