From ea7079074c57d41f25784b2f53314bc08f85fed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 7 Apr 2026 12:08:22 +0300 Subject: [PATCH] tools/indent_arm_assembly: Don't indent "foo .req bar" lines like an instruction These are used a bit in our arm assembly, while they're used much less in our aarch64 assembly. --- tools/indent_arm_assembly.pl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/indent_arm_assembly.pl b/tools/indent_arm_assembly.pl index 0c85ff3ac4..8bca145976 100755 --- a/tools/indent_arm_assembly.pl +++ b/tools/indent_arm_assembly.pl @@ -172,6 +172,7 @@ while (<$in>) { my $orig_operand_indent = length($label) + length($indent) + length($instr) + length($origspace); + my $orig_indent = $indent; if ($indent_operands) { $rest = columns($rest); @@ -215,8 +216,16 @@ while (<$in>) { $size -= $instr_end; } my $operand_space = " "; - if ($size > 0) { - $operand_space = spaces($size); + if ($rest =~ /^\.req/i) { + # A line like "alias .req reg" shouldn't necessarily be + # reindented like " alias .req reg"; keep the original + # indentation instead. + $indent = $orig_indent; + $operand_space = $origspace; + } else { + if ($size > 0) { + $operand_space = spaces($size); + } } # Lowercase register names. Only apply this on lines up to