summaryrefslogtreecommitdiff
path: root/asm.m4
diff options
context:
space:
mode:
authorMichael Weiser <michael.weiser@gmx.de>2018-02-13 22:13:12 +0100
committerNiels Möller <nisse@lysator.liu.se>2018-03-25 11:27:28 +0200
commitd5738a574daee265ebfcf28dd51dfdca56c1798b (patch)
treed2bf5be49288022e341f25a10fafa6ea46f20a39 /asm.m4
parent8c210b4e53b8566faea7ff0a175ad323236dd5d2 (diff)
downloadnettle-d5738a574daee265ebfcf28dd51dfdca56c1798b.tar.gz
Add arm endianness-aware assembly infrastructure
Introduce m4 macros to conditionally handle differences of little- and big-endian arm in assembler code.
Diffstat (limited to 'asm.m4')
-rw-r--r--asm.m48
1 files changed, 8 insertions, 0 deletions
diff --git a/asm.m4 b/asm.m4
index 4018c235..8da47201 100644
--- a/asm.m4
+++ b/asm.m4
@@ -51,6 +51,14 @@ define(<ALIGN>,
<.align ifelse(ALIGN_LOG,yes,<m4_log2($1)>,$1)
>)
+define(<IF_BE>, <ifelse(
+WORDS_BIGENDIAN,yes,<$1>,
+WORDS_BIGENDIAN,no,<$2>,
+<errprint(<Unsupported endianness value>,WORDS_BIGENDIAN,<
+>)
+ m4exit(1)>)>)
+define(<IF_LE>, <IF_BE(<$2>, <$1>)>)
+
dnl Struct defining macros
dnl STRUCTURE(prefix)