bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/31752] New: gas: Support \+ in .rept/.irp/.irpc directives


From: i at maskray dot me
Subject: [Bug gas/31752] New: gas: Support \+ in .rept/.irp/.irpc directives
Date: Fri, 17 May 2024 17:50:59 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=31752

            Bug ID: 31752
           Summary: gas: Support \+ in .rept/.irp/.irpc directives
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: i at maskray dot me
  Target Milestone: ---

(https://sourceware.org/pipermail/binutils/2024-May/134009.html RFC:
Maintaining a per-macro invocation count)

gas recently introduced \+ for per-macro invocation counts within .macro/.endm
directives.

Building on discussions at
https://sourceware.org/pipermail/binutils/2024-May/134089.html , extending the
feature to loop directives would be beneficial.
This would allow us to replace .byte 0, 1, 2 with:

  .rept 3
    .byte \+
  .endr

(.irpc i,0123456789   \i   .endr) works for a loop when the count is <= 10 but
is cumbersome for larger loop counts.

For nested loops, \+ could indicate the outermost loop for implementation
convenience.
Such constructs are rare and we can rely on clear documentation.

  .rept 2
    .rept 2
      .byte \+
    .endr
  .endr

  # 0 0 1 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]