Skip to content

Commit

Permalink
Recognize that ARM1176JZ[F]-S support TrustZone
Browse files Browse the repository at this point in the history
Summary:
ARMv6KZ cores were set up incorrectly in ARM.td; also, the SMI mnemonic
(the old name for SMC, as defined in ARMv6KZ) wasn't supported.

Reviewers: jmolloy, rengolin

Subscribers: aemerson, rengolin, llvm-commits

Differential Revision: http://reviews.llvm.org/D14154

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251627 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Artyom Skrobov authored and Artyom Skrobov committed Oct 29, 2015
1 parent 741f26c commit 775c498
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/Target/ARM/ARM.td
Original file line number Diff line number Diff line change
@@ -360,8 +360,10 @@ def : Processor<"sc000", ARMV6Itineraries, [HasV6MOps, FeatureNoARM,
FeatureDB, FeatureMClass]>;

// V6K Processors.
def : Processor<"arm1176jz-s", ARMV6Itineraries, [HasV6KOps]>;
def : Processor<"arm1176jz-s", ARMV6Itineraries, [HasV6KOps,
FeatureTrustZone]>;
def : Processor<"arm1176jzf-s", ARMV6Itineraries, [HasV6KOps, FeatureVFP2,
FeatureTrustZone,
FeatureHasSlowFPVMLx]>;
def : Processor<"mpcorenovfp", ARMV6Itineraries, [HasV6KOps]>;
def : Processor<"mpcore", ARMV6Itineraries, [HasV6KOps, FeatureVFP2,
1 change: 1 addition & 0 deletions lib/Target/ARM/ARMInstrInfo.td
Original file line number Diff line number Diff line change
@@ -2329,6 +2329,7 @@ def SMC : ABI<0b0001, (outs), (ins imm0_15:$opt), NoItinerary, "smc", "\t$opt",
let Inst{23-4} = 0b01100000000000000111;
let Inst{3-0} = opt;
}
def : MnemonicAlias<"smi", "smc">;

// Supervisor Call (Software Interrupt)
let isCall = 1, Uses = [SP] in {
1 change: 1 addition & 0 deletions test/MC/ARM/arm-thumb-trustzone.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@ RUN: not llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -show-encoding -mattr=-trustzone < %s | FileCheck %s -check-prefix=NOTZ
@ RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -show-encoding -mattr=trustzone < %s | FileCheck %s -check-prefix=TZ
@ RUN: not llvm-mc -triple=thumbv6kz -mcpu=arm1176jzf-s -show-encoding < %s | FileCheck %s -check-prefix=NOTZ

.syntax unified
.globl _func
3 changes: 2 additions & 1 deletion test/MC/ARM/arm-trustzone.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@ RUN: not llvm-mc -triple=armv7-apple-darwin -mcpu=cortex-a8 -show-encoding -mattr=-trustzone < %s | FileCheck %s -check-prefix=NOTZ
@ RUN: llvm-mc -triple=armv7-apple-darwin -mcpu=cortex-a8 -show-encoding -mattr=trustzone < %s | FileCheck %s -check-prefix=TZ
@ RUN: llvm-mc -triple=armv6kz -mcpu=arm1176jz-s -show-encoding < %s | FileCheck %s -check-prefix=TZ

.syntax unified
.globl _func
@@ -14,7 +15,7 @@ _func:
@------------------------------------------------------------------------------
@ SMC
@------------------------------------------------------------------------------
smc #0xf
smi #0xf @ SMI is old (ARMv6KZ) name for SMC
smceq #0

@ NOTZ-NOT: smc #15

0 comments on commit 775c498

Please sign in to comment.