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

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

$
0
0

I was reading the SVE whitepaper from ARM and came across something that struck me as odd (in a non-SVE example):

mov x8, xzr

I didn't know what this xzr register was, so I looked it up and found some content from ARM stating that it was, in many contexts, synonymous with zero.

So it looks like x8 is being initialised to zero, which makes sense because it's executed just before a loop where x8 is used as the loop counter.

What I don't understand is, why wasn't the literal 0 used instead of xzr? For example:

mov x8, 0

To summarise, my question is: why might one use the xzr register instead of the literal 0 here?


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images