draperlaboratory / VIBES

Verified, Incremental, Binary Editing with Synthesis
MIT License
51 stars 1 forks source link

ARM `mul` bug #137

Closed ccasin closed 2 years ago

ccasin commented 2 years ago

For patch code like:

 "patch-code" : "int input, output; output = input * 5;"

We're generating ARM instructions like:

 mul R1, R0, #5

But I think the ARM spec says all arguments to mul must be registers (constants are not allowed) - and we get an error from the assembler. See:

https://www.keil.com/support/man/docs/armasm/armasm_dom1361289882394.htm

ccasin commented 2 years ago

(Note this can be worked around in the short term with patch code like:

"patch-code" : "int input, output, x;
                x = 5;
                output = input * x;"

This gets the compiler to put x into a register.)

bmourad01 commented 2 years ago

This issue is fixed with the merging of the cp6 branch.