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?