On Mon, 24 Mar 2014 12:10:52 -0000, Martin Storsjö <[email protected]> wrote:
+.macro loadd_ group, index0, index1, base, offset
+A .if offset >= 256
+A ldr \group\index0, [\base, #\offset]
+A ldr \group\index1, [\base, #(\offset) + 4]
+A .else
+ ldrd \group\index0, \group\index1, [\base, #\offset]
+A .endif
+.endm
Any particular reason the .if uses 'offset' and not '\offset'? gas-
preprocessor can't handle this correctly at the moment.
That was a typo. However, it's one that gas seems to be quite happy to
accept - in particular, it seems to match symbols lacking the leading \
against a macro's parameter names iff .altmacro mode was engaged at the
point when that line was encountered (the .altmacro state when the
macro's parameters are evaluated seems to be inconsequential for this
purpose). In this specific case, .altmacro needs to be active when the
loadd_ macro is invoked, in order for the parameter expressions to be
stringised, and the body of the macro happens to leave the .altmacro
state unchanged, hence the fact that it accepts parameter names without
the \.
Of course, the above is determined experimentally, but the GAS
documentation is very unclear on exactly what .altmacro does and the way
macro expansions are performed (note to the maintainers, in case they
ever read this: a handful of examples do not constitute a specification).
Presumably having gas-preprocessor handle .altmacro state to match gas
would be desirable long-term anyway, in case you ever encounter more
substantial blocks of code written to .altmacro conventions? Perhaps I
should really have consistently omitted the \ for code that was intended
to be assembled in .altmacro state, to make it more obvious whether it
was active or not?
Ben
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel