From: Keith Walker Date: Tue, 5 Aug 2014 15:11:59 +0000 (+0000) Subject: Specify that the thumb setend and blx instructions are not valid on an m... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2115a0b0dc449684261323b047a25dae529f7b7;p=llvm Specify that the thumb setend and blx instructions are not valid on an m-class target git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214871 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/ARMInstrThumb.td b/lib/Target/ARM/ARMInstrThumb.td index e17f73af03e..775b3fb7006 100644 --- a/lib/Target/ARM/ARMInstrThumb.td +++ b/lib/Target/ARM/ARMInstrThumb.td @@ -311,7 +311,7 @@ def tHLT : T1I<(outs), (ins imm0_63:$val), NoItinerary, "hlt\t$val", } def tSETEND : T1I<(outs), (ins setend_op:$end), NoItinerary, "setend\t$end", - []>, T1Encoding<0b101101>, Deprecated { + []>, T1Encoding<0b101101>, Requires<[IsNotMClass]>, Deprecated { bits<1> end; // A8.6.156 let Inst{9-5} = 0b10010; @@ -466,7 +466,7 @@ let isCall = 1, (outs), (ins pred:$p, t_blxtarget:$func), IIC_Br, "blx${p}\t$func", [(ARMcall tglobaladdr:$func)]>, - Requires<[IsThumb, HasV5T]>, Sched<[WriteBrL]> { + Requires<[IsThumb, HasV5T, IsNotMClass]>, Sched<[WriteBrL]> { bits<24> func; let Inst{26} = func{23}; let Inst{25-16} = func{20-11}; diff --git a/test/MC/ARM/thumb-not-mclass.s b/test/MC/ARM/thumb-not-mclass.s new file mode 100644 index 00000000000..fec545e64b0 --- /dev/null +++ b/test/MC/ARM/thumb-not-mclass.s @@ -0,0 +1,26 @@ +@ RUN: not llvm-mc -triple=thumbv7m-apple-darwin -show-encoding < %s 2> %t +@ RUN: FileCheck < %t %s +@ RUN: not llvm-mc -triple=thumbv6m -show-encoding < %s 2> %t +@ RUN: FileCheck < %t %s + .syntax unified + .globl _func + +@ Check that the assembler rejects thumb instructions that are not valid +@ on mclass. + +@------------------------------------------------------------------------------ +@ BLX (immediate) +@------------------------------------------------------------------------------ + blx _baz + +@ CHECK: error: instruction requires: !armv*m + +@------------------------------------------------------------------------------ +@ SETEND +@------------------------------------------------------------------------------ + + setend be + setend le + +@ CHECK: error: invalid operand for instruction +@ CHECK: error: invalid operand for instruction