summaryrefslogtreecommitdiff
path: root/asm.m4
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2013-04-16 15:38:15 +0200
committerNiels Möller <nisse@lysator.liu.se>2013-04-16 15:38:15 +0200
commit081483815557570dee6009ae46d66ed43a42c407 (patch)
treea89311be413620bff1645ac4ded75c2e29bfafa5 /asm.m4
parente1646357a32fc37f98c9c54e6cdabee12dd50119 (diff)
downloadnettle-081483815557570dee6009ae46d66ed43a42c407.tar.gz
Switch to non-logarithmic ALIGN macro.
Diffstat (limited to 'asm.m4')
-rw-r--r--asm.m417
1 files changed, 9 insertions, 8 deletions
diff --git a/asm.m4 b/asm.m4
index f24442da..200b1361 100644
--- a/asm.m4
+++ b/asm.m4
@@ -26,16 +26,17 @@ define(<EPILOGUE>,
<ifelse(ELF_STYLE,yes,
<.size C_NAME($1), . - C_NAME($1)>,<>)>)
-dnl Argument to ALIGN is always logarithmic
-dnl FIXME: the << operator is not supported by Solaris m4,
-dnl and ** is not supported by OpenBSD m4.
-dnl We should switch to non-logarithmic ALIGN instead.
+define(<m4_log2>, <m4_log2_internal($1,1,0)>)
+define(<m4_log2_internal>,
+<ifelse($3, 10, <not-a-power-of-two>,
+$1, $2, $3,
+<m4_log2_internal($1, eval(2*$2), eval(1 + $3))>)>)
+
+dnl Argument to ALIGN is always in bytes, and converted to a
+dnl logarithmic .align if necessary.
-dnl Need changequote to be able to use the << operator.
define(<ALIGN>,
-<changequote([,])dnl
-.align ifelse(ALIGN_LOG,yes,$1,eval(1 << $1))dnl >> balance
-changequote(<,>)dnl
+<.align ifelse(ALIGN_LOG,yes,<m4_log2($1)>,$1)
>)
dnl Struct defining macros