[PATCH] Fix treatment of ARM unallocated hint instructions

Quentin Colombet qcolombet at apple.com
Tue Apr 16 10:56:45 PDT 2013


Hi Mihail,

Maybe I’m missing something but you’ve defined a new isImm0_4 method but you’re never using it.
Regarding the test you’ve added (invalid-hint-arm.txt), it would be good if it uses FileCheck instead of grep.

Thanks.

-Quentin

On Apr 16, 2013, at 6:17 AM, Mihail Popa <Mihail.Popa at arm.com> wrote:

> Hello.
> 
> In the current implementation, the ARM "hint space" is modelled as a "hint" instruction taking an 8 bit immediate operand. This is not entirely conforming with the ARM specification.
> 
> Firstly "hint" is not and never was a proper ARM mnemonic on v7 or previous. Any code using "hint #imm" will not assemble using the ARM proprietary assembler.
> 
> Secondly, within the hint space, the reference manual defines only 5 permitted values for the immediate field:
> 1. nop (imm == 0)
> 2. yield (imm == 1)
> 3. wfe (imm == 2)
> 4. wfi (imm == 3)
> 5. sev (imm == 4)
> 
> Thirdly, for the remaining values (i.e. 5 through 255) the manual states that: "These unallocated hint encodings are reserved and software must not use them."
> 
> The attached patch restricts the permitted values for the "hint" instruction to 0 through 4.
> This has the following effects:
> 
> 1. "hint #imm" with #imm in [0..4] will assemble to one of {nop, yield, wfe, wfi, sev}
> 2. "hint #imm" with #imm > 4 will be rejected for ARM instruction set
> 3. a bitpattern from the hint space with #imm in [0..4] will be decoded to one of {nop, yield, wfe, wfi, sev}
> 4. a bitpattern from the hint space with #imm > 5 will not be decoded (invalid instruction encoding)
> 
> Patch also trims some trailing white space.
> 
> Regards,
> Mihai
> 
> -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.<LLVM-713.hints.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130416/7ef2edb2/attachment.html>


More information about the llvm-commits mailing list