[llvm-commits] [llvm] r139610 - in /llvm/trunk: lib/Target/ARM/AsmParser/ARMAsmParser.cpp test/MC/ARM/basic-thumb2-instructions.s

Evan Cheng evan.cheng at apple.com
Tue Sep 13 11:28:03 PDT 2011


Perhaps the disassembler should warn about this? 

Evan

On Sep 13, 2011, at 10:59 AM, Owen Anderson wrote:

> Author: resistor
> Date: Tue Sep 13 12:59:19 2011
> New Revision: 139610
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=139610&view=rev
> Log:
> Teach the Thumb ASM parser that BKPT is allowed in IT blocks, even though it is always executed unconditionally.
> 
> Modified:
>    llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
>    llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s
> 
> Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=139610&r1=139609&r2=139610&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Tue Sep 13 12:59:19 2011
> @@ -3532,7 +3532,10 @@
>   MCInstrDesc &MCID = getInstDesc(Inst.getOpcode());
>   SMLoc Loc = Operands[0]->getStartLoc();
>   // Check the IT block state first.
> -  if (inITBlock()) {
> +  // NOTE: In Thumb mode, the BKPT instruction has the interesting property of
> +  // being allowed in IT blocks, but not being predicable.  It just always
> +  // executes.
> +  if (inITBlock() && Inst.getOpcode() != ARM::tBKPT) {
>     unsigned bit = 1;
>     if (ITState.FirstCond)
>       ITState.FirstCond = false;
> 
> Modified: llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s?rev=139610&r1=139609&r2=139610&view=diff
> ==============================================================================
> --- llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s (original)
> +++ llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s Tue Sep 13 12:59:19 2011
> @@ -259,6 +259,14 @@
> @ CHECK: bic.w	r8, r8, r5, asr #15     @ encoding: [0x28,0xea,0xe5,0x38]
> @ CHECK: bic.w	r12, r12, r6, ror #29   @ encoding: [0x2c,0xea,0x76,0x7c]
> 
> + at ------------------------------------------------------------------------------
> +@ BKPT
> + at ------------------------------------------------------------------------------
> +        it pl
> +        bkpt #234
> +
> +@ CHECK: it pl                      @ encoding: [0x58,0xbf]
> +@ CHECK: bkpt #234                    @ encoding: [0xea,0xbe]
> 
> @------------------------------------------------------------------------------
> @ BXJ
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list