Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Adding 32 bit register to 64 bit register in ARM

I have code something like this:

mov x24, 5
mov w25, 5
add x24, x24, w25

I am getting a "Missing extend operator at operand 3". I know I could just switch both to 64bit operators but I’m wondering if its still possible to add 32bit numbers and 64bit numbers together like the above

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You have to put the optional extend operator
unsigned:

add x24, x24, w25, uxtw

signed:

add x24, x24, w25, sxtw

The extension can be:

uxtb: unsigned 8bit
sxtb: signed 8bit
uxth: unsigned 16bit
sxth: signed 16bit
uxtw: unsigned 32bit
sxtw: signed 32bit
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading