On Wed, 26 Mar 2014, Janne Grunau wrote:
On 2014-03-24 19:38:03 +0200, Martin Storsjö wrote:
---
gas-preprocessor.pl | 5 +++++
test.S | 11 +++++++++++
2 files changed, 16 insertions(+)
diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index d875d76..6dd9cc6 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -600,6 +600,11 @@ sub expand_macros {
foreach (reverse sort {length $a <=> length $b} keys
%replacements) {
$macro_line =~ s/\\$_/$replacements{$_}/g;
}
+ if ($altmacro) {
+ foreach (reverse sort {length $a <=> length $b} keys
%replacements) {
+ $macro_line =~ s/\b$_\b/$replacements{$_}/g;
+ }
+ }
$macro_line =~ s/\\\@/$count/g;
$macro_line =~ s/\\\(\)//g; # remove \()
parse_line($macro_line);
diff --git a/test.S b/test.S
index ec0b861..47d39c2 100644
--- a/test.S
+++ b/test.S
@@ -72,3 +72,14 @@ argtest2 1 2 < 1 3
mov r\i, #\j
.endr
.endr
+
+.macro alttest param
+ .if param < 10
+ mov r0, #param
+ .endif
+.endm
+
+.altmacro
+alttest 5
+alttest 15
+.noaltmacro
unrelated, it's fucking insane that altmacro state at macro instantiation
time counts and not during macro definition. Sure it's easier to
implement but it makes no sense.
Yes, luckily we don't have many instances that requires altmacro.
The pushed version of the truehd patches were changed not to require this
feature in gas-pp, but we might as well implement it now that we know
about it.
// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel