Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does VMOV.F64 not allow me to load zero?

Tags:

assembly

arm

The following ARM asm:

vmov.f64 d16, #0

Fails with the following error:

/tmp/ccZD4Iex.s:121: Error: immediate out of range -- `vmov.f64 d16,#0'

Compiled using arm-none-linux-gnueabi-g++ (Sourcery CodeBench Lite 2012.03-57) 4.6.3

How do I zero out the d16 register-double so I can use it for double precision VFP instructions?

like image 810
engie Avatar asked Jan 16 '23 07:01

engie


1 Answers

VMOV can only accept a limited set of floating-point immediates, and, surprisingly, 0 is not one of them:

Any number that can be expressed as +/-n * 2-r, where n and r are integers, 16 <= n <= 31, 0 <= r <= 7.

You can do what BitBank suggested, or use an integer move, which will also zero out the register.

vmov.i64 d16, #0
like image 188
Igor Skochinsky Avatar answered Jan 23 '23 16:01

Igor Skochinsky