Thread (2 messages) flat view 2 messages, 2 authors, 2021-09-10

Re: [PATCH v1] powerpc: flexible GPR range save/restore macros

From: Segher Boessenkool <hidden>
Date: 2021-09-10 17:57:18

Hi!

On Sat, Sep 11, 2021 at 12:35:11AM +1000, Nicholas Piggin wrote:
+.macro OP_REGS op, width, start, end, base, offset
+	.Lreg=\start
+	.rept (\end - \start + 1)
+	\op	.Lreg,\offset+\width*.Lreg(\base)
+	.Lreg=.Lreg+1
+	.endr
+.endm
"offset" here is the offset of reg "0", not the offset of reg "start".
This isn't new, but documenting it would not hurt :-)

".Lreg" does not really give you much protection, you could use any name
that won't collide, it will be a local symbol anyway.  You could use a
name with a "$" in it, even as first letter, for example.  As written it
still conflicts with any other symbol ".Lreg".  Pretty unlikely of
course :-)

Looks fine in any case.

Reviewed-by: Segher Boessenkool <redacted>


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help