5

In 2016, ARM introduced the ARMv8-M architecture as an upgrade to the popular ARMv6-M (Cortex M0/M0+/M1) and ARMv7-M (Cortex M3/M4/M7) architectures. The ARMv8-M architecture is again split into a Baseline profile seen as a continuation of the ARMv6-M architecture and a Mainline profile seen as a continuation of the ARMv7-M architecture.

Cursory examination of the ARMv8-M Architecture Reference Manual unfortunately yields no insights into what exactly was added and there doesn't seem to be a useful summary of what changed in comparison to the previous version of the architecture. And as usual for new versions of CPU architectures, it appears that almost all details are unchanged with only small additions here and there.

What additional instructions and instruction variants does ARMv8-M Baseline provide over ARMv6-M?

TylerH
  • 20,799
  • 66
  • 75
  • 101
fuz
  • 88,405
  • 25
  • 200
  • 352
  • it is not about instructions....yet – old_timer Apr 11 '21 at 23:29
  • https://en.wikipedia.org/wiki/ARM_Cortex-M#Cortex-M23 – old_timer Apr 11 '21 at 23:33
  • the m23 m33 m55 and such are using the armv8-m, and have new security part of the IoT is the root of all security issues fear. – old_timer Apr 11 '21 at 23:34
  • TrustZone security instructions. (available only in M23/M33/M35P) – old_timer Apr 11 '21 at 23:34
  • Armv6-M compatibility is provided by all Armv8-M implementations. – old_timer Apr 11 '21 at 23:38
  • Armv7-M compatibility requires the Main Extension. – old_timer Apr 11 '21 at 23:38
  • 1
    This post is currently being discussed on [meta](https://meta.stackoverflow.com/questions/406763/are-changelog-type-questions-acceptable) – code11 Apr 12 '21 at 16:43
  • Per the title question. Just like armv7-m which some versions of the docs were helpful-ish, you walk the two documents side by side and see what instructions have changed, likewise armv6-m vs armv4t/armv5... – old_timer Apr 12 '21 at 17:10
  • 1
    @old_timer I've been doing that on and off for the last few days. The manual is quite long and you can't just check the TOC as many useful changes are just that some instructions from ARMv7-M have made it into the baseline profile (e.g. `MOVW`/`MOVT`/`CBZ`/`CBNZ`). My hope is that perhaps someone has already done this work and is willing to share his results. – fuz Apr 12 '21 at 17:17
  • I went through the armv6m and armv7m vs armv4t in an evening way back when. Used the alphabetical list...Early armv8-m documents did put me in a panic, but for some reason didnt do the exercise, the current docs with statements above reassured me I could actually build code that would work... – old_timer Apr 12 '21 at 18:02
  • I couldnt find it just now, but I have seen somewhere on wikipedia or similar that someone has done this for prior architectures although at the same time I think I quickly saw questionable claims... – old_timer Apr 12 '21 at 18:04
  • @old_timer Yes, Wikipedia has a list on the Cortex-M site, but it's incorrect. For example, `MOVW` and `MOVT` are not listed. – fuz Apr 12 '21 at 18:13
  • 1
    @fuz Regarding the new instructions, did you look at pages 6-7 of document [Cortex-M for Beginners](https://community.arm.com/cfs-file/__key/communityserver-discussions-components-files/18/Cortex_2D00_M-for-Beginners-_2D00_-2017_5F00_EN_5F00_v2.pdf) ? This will not answer your question regarding the instruction variants though. – Frant Apr 23 '21 at 13:53
  • @Frant Super cool! This is kinda what I was looking for. Thanks for the reference. I'll go ahead and see if I can write up an answer based on that. – fuz Apr 23 '21 at 14:54
  • @fuz: would you accept this as a (partial) answer ? – Frant Apr 23 '21 at 14:56
  • @Frant It does have all the information I was looking for, but link-only answers are discouraged on this site. At least a full list of the added instructions is needed to make an acceptable answer. This is basically everything for Cortex-M23 in Fig. 3 that is not in the dark green box. If you want to write an answer, feel free to do so! – fuz Apr 23 '21 at 15:00
  • @fuz, thanks for the review, I was definitively too zealous! – Frant Apr 23 '21 at 15:22
  • 1
    @Frant You can always edit the answer and undelete it. Best would be however to get rid of the pictures and just do it in text (vision-impaired users will thank you for that). I can help you with grouping the instructions; §2.6 says what classes they fall into. – fuz Apr 23 '21 at 15:37

1 Answers1

5

The ARM document titled Cortex-M for Beginners may provide the information you are looking for, more specifically at pages 6 and 7.

ARMv6-M provides the 16 bit instructions ADC, ADD, ADR, AND, ASR, B, BIC, BKPT, BL, BLX, BX, CMN, CMP, CPS, EOR, LDMIA, LDR, LDRB, LDRH, LDRSB, LDRSH, LSL, LSR, MOV, MUL, MVN, NOP, ORR, PUSH, REV, REV16, REVSH, ROR, RSB, SBC, SEV, STMIA, STR, STRB, STRH, SUB, SVC, SXTB, SXTH, TST, UDF, UXTB, UXTH, WFE, WFI, and YIELD.

Additionally, 32 bit instructions BL, DMB, DSB, ISB, MRS, and MSR are available.

To these, ARMv8-M baselines adds...

  • hardware divide instructions SDIV and UDIV
  • the 32 bit unconditional branch instruction B (for extended range)
  • 16 bit compare and branch instructions CBZ and CBNZ
  • 32 bit instructions MOVW and MOVT for loading constants (as an alternative to LDR Rd, =...)
  • load-acquire/store-release instructions LDA, LDAB, LDAH, STL, STLB, and STLH
  • load-acquire/store-release instructions with exclusive access LDAEX, LDAEXB, LDAEXH, STLEX, STLEXB, and STLEXH
  • exclusive access instructions CLREX, LDREX, LDREXB, LDREXH, STREX, STREXB, and STREXH

If additionally the security extension is implemented, the instructions BLXNS, BXNS, SG, TT, TTT, TTA, and TTAT are available.

fuz
  • 88,405
  • 25
  • 200
  • 352
Frant
  • 5,382
  • 1
  • 16
  • 22