Quantcast
Channel: Why might one use the xzr register instead of the literal 0 on ARMv8? - Stack Overflow
Browsing all 6 articles
Browse latest View live

Answer by Jeremy for Why might one use the xzr register instead of the...

I think the mov x8, xzr vs mov x8, #0 comparison is something of a red herring.As @old_timer's answer shows, there is no encoding gain to be made, and quite likely (although admittedly I haven't...

View Article



Answer by InfinitelyManic for Why might one use the xzr register instead of...

This answer is not "on all fours" to the OP. XZR could be used to discard results; e.g., "ldr xzr, [sp], 16". See GDB below0x7fffffef40: 0x00000000 0x00000000 0x00400498 0x000000000x7fffffef50:...

View Article

Answer by Will Lovett for Why might one use the xzr register instead of the...

These two instructions should be identical - both in terms of effect and expected performance.They're actually both aliases of more general purpose instructions.mov x8, 0 is encoded as orr x8, xzr,...

View Article

Answer by old_timer for Why might one use the xzr register instead of the...

mov x8,xzrmov x8,#0mov x8,0produces0000000000000000 <.text>: 0: aa1f03e8 mov x8, xzr 4: d2800008 mov x8, #0x0 // #0 8: d2800008 mov x8, #0x0 // #0No real surprise there other than it allowed an...

View Article

Answer by silverscania for Why might one use the xzr register instead of the...

TL;DRIt takes multiple instructions to load a 64 bit literal into a register, but only a single instruction to set to 0 using zxr. Therefore the code is shorter and faster.To move a literal to a...

View Article


Why might one use the xzr register instead of the literal 0 on ARMv8?

I was reading the SVE whitepaper from ARM and came across something that struck me as odd (in a non-SVE example):mov x8, xzrI didn't know what this xzr register was, so I looked it up and found some...

View Article
Browsing all 6 articles
Browse latest View live




Latest Images