Adding support for the ARM64 FEAT_RPRFM instruction to Go's Assembler

45 views
Skip to first unread message

Oleg Aleksandrov

unread,
Feb 12, 2026, 12:16:43 PM (3 days ago) Feb 12
to golang-dev

I'm working on adding support for the ARM64 FEAT_RPRFM (Range Prefetch Memory) instruction to Go's assembler. Currently, it's not supported.  Instruction documentation.

I have a question about the order of arguments in the Go assembler syntax.

According to the ARM specification, the instruction format is:

RPRFM (<rprfop>|#<imm6>), <Xm>, [<Xn|SP>]

Where:  

  • (<rprfop>|#<imm6>) - prefetch operation (or immediate).  
  • <Xm> - general-purpose register holding metadata.  
  • [<Xn|SP>] - base address register (or stack pointer).


I'm considering two possible orders for Go's assembler:

Option 1: 
RPRFM Rm, Rn, <rprfop|imm6>  

  • Rm - metadata register  
  • Rn - address register  

Option 2: 
RPRFM Rn, Rm, <rprfop|imm6>  

  •  Rn - address register
  •  Rm - metadata register


Question:  
Which of these two options better fits the existing design patterns of Go's assembler for ARM64?  
Or is there a more idiomatic way to support this instruction?

Jorropo

unread,
Feb 12, 2026, 12:26:04 PM (3 days ago) Feb 12
to Oleg Aleksandrov, golang-dev
I am not aware of an existing convention for prefetches.

Copy range instructions (like AMD64's REP MOVS) use DST, SRC, length order.

Dropping the destination since prefetch doesn't write anywhere does it ?
I would use address, length order.

FWIW it is how slices and strings are represented in the compiler so the order isn't completely made up.

--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-dev/2cdd93fc-d826-4a72-83a9-41bf6da08332n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages