[PATCH] Fix encoding of constant in ARM "adr rN, #Const" instruction

Keith Walker keith.walker at arm.com
Wed Feb 27 06:44:57 PST 2013


I have attached a revised patch that includes the initialisation of the
variable.

 

I did try to come up with some one-line comments to describe the values
matched but none which I was happy actually made the code any clearer so I
have not added any additional one-line comments.

 

Keith

 

From: Renato Golin [mailto:renato.golin at linaro.org] 
Sent: 21 February 2013 10:11
To: Keith Walker
Cc: LLVM Commits
Subject: Re: [PATCH] Fix encoding of constant in ARM "adr rN, #Const"
instruction

 

On 21 February 2013 09:20, Keith Walker <keith.walker at arm.com> wrote:

This patch fixes the encoding of the constant value in ARM "adr rN, #Const"
instruction which currently asserts on some "Const" values that can be
validly encoded in the instruction.

 

Hi Keith,

 

Patch looks good. I'd just initialize the variable to zero so that future
code movements only introduce bugs, not segfaults. ;)

 

+  int SoImmVal = 0;

   if (offset == INT32_MIN) {

     Val = 0x1000;

-    offset = 0;

 

Also, maybe add one-line comments on what types of values will match in each
case.

 

cheers,

--renato 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130227/0c6ad298/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adr_immed12.diff2
Type: application/octet-stream
Size: 1837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130227/0c6ad298/attachment.obj>


More information about the llvm-commits mailing list