SoC
  • Home
  • Arm
  • Arm Cortex M0/M0+
  • Arm Cortex M4
  • Arm Cortex M3
  • Contact
Reading: What are DSP instructions in Arm Cortex-M series?
SUBSCRIBE
SoCSoC
Font ResizerAa
  • Home
  • Arm
  • Arm Cortex M0/M0+
  • Arm Cortex M4
Search
  • Home
  • Arm
  • Arm Cortex M0/M0+
  • Arm Cortex M4
Have an existing account? Sign In
Follow US
  • Looking for Something?
  • Privacy Policy
  • About Us
  • Sitemap
  • Contact Us
© S-O-C.ORG, All Rights Reserved.
Arm

What are DSP instructions in Arm Cortex-M series?

Scott Allen
Last updated: October 5, 2023 9:56 am
Scott Allen
6 Min Read
Share
SHARE

Digital signal processing (DSP) instructions in Arm Cortex-M series microcontrollers provide optimized processing capabilities for digital signal processing algorithms. They allow Cortex-M cores to execute common DSP operations more efficiently.

Contents
  • Background on DSP in Microcontrollers
  • Types of DSP Instructions
    • 1. Saturating Arithmetic
    • 2. Multiplying
    • 3. SIMD
    • 4. Complex Math
  • DSP Instruction Set in Cortex-M Processor Cores
    • Cortex-M4/M7 DSP Instruction Set
    • Cortex-M33 DSP ISA
    • Cortex-M55 DSP and Vector Extensions
  • Benefits of DSP Instructions
  • Use Cases and Applications
  • Conclusion

Background on DSP in Microcontrollers

Digital signal processing involves manipulating real-world analog signals in the digital domain. DSP algorithms are used for applications like audio processing, image processing, speech recognition, and communications. Microcontrollers are often used to implement these DSP algorithms, especially in embedded and IoT applications.

However, microcontroller CPUs are typically designed for general purpose workloads. DSP algorithms have very specific computational requirements like high parallelism, repetitive operations on streaming data, and intensive math. Normal microcontroller CPU designs are not optimized for these DSP workloads.

To improve DSP performance on microcontrollers, ARM introduced DSP instructions in the Cortex-M4 and newer Cortex-M processor cores. DSP instructions provide hardware acceleration for common DSP operations.

Types of DSP Instructions

The main categories of DSP instructions in Cortex-M processors are:

  • Saturating Arithmetic – Saturating add, subtract, shift
  • Multiplying – Unsigned multiply, multiply-accumulate (MAC)
  • SIMD – Single instruction multiple data
  • Complex Math – Floating point, divide

Let’s look at some key examples of DSP instructions for each category:

1. Saturating Arithmetic

  • Saturating Add and Subtract – QADD, QSUB
  • Saturating Shift – SSAT

These instructions saturate results that overflow to the maximum positive or minimum negative value. This avoids unanticipated wrap-around effects in DSP algorithms.

2. Multiplying

  • Unsigned Multiply – UMULL
  • Multiply with Rounding – SMMLA, SMMLS
  • Multiply and Accumulate – MLA, MLS

Efficient multiplication is fundamental for DSP processing. Multiply-accumulate (MAC) operations are heavily used in filters and transforms.

3. SIMD

  • Pack and Unpack – PKHBT, SXTB16
  • Dual 16-bit Instructions – SADD16, SHADD16
  • Parallel Add/Subtract – SADDSUBX, SSBB16

SIMD performs the same operation on multiple data points simultaneously. This significantly speeds up processing of vector arrays.

4. Complex Math

  • Divide – SDIV
  • Floating Point – VDIV, VFNMS

Some DSP algorithms require division and floating point math. Cortex-M4 and newer cores add single precision hardware floating point.

DSP Instruction Set in Cortex-M Processor Cores

Different ARM Cortex-M cores have implemented DSP instructions to varying degrees:

  • Cortex-M4/M7 – Baseline DSP extension with saturated arithmetic, MAC, SIMD
  • Cortex-M33 – Enhanced DSP extension. Adds more complex SIMD and floating point math.
  • Cortex-M55 – Latest DSP ISA. Includes full floating point unit and vector instructions.

Higher Cortex-M cores build on DSP capabilities of previous cores for more advanced DSP workloads.

Cortex-M4/M7 DSP Instruction Set

The Cortex-M4 introduced the first DSP instruction set extension to Cortex-M cores. Cortex-M7 later added more SIMD instructions. Key features:

  • Saturating arithmetic
  • Multiply with rounding and accumulation (SMMLA/SMMLS)
  • Unsigned 32×32 multiply with 64-bit result (UMULL)
  • Parallel addition/subtraction (SADDSUBX)
  • Dual 16-bit instructions (SHADD16)
  • Saturating shifts (SSAT)

This covers saturated math, MAC operations, and basic SIMD capabilities commonly needed in DSP.

Cortex-M33 DSP ISA

Cortex-M33 enhances the DSP instruction set further with:

  • More advanced SIMD instructions
  • Single precision floating point unit
  • Additional multiply instructions
  • Dot product acceleration

The floating point unit is a major addition for complex DSP algorithms. SIMD enhancements help with vector array processing.

Cortex-M55 DSP and Vector Extensions

The latest Cortex-M55 core has the most advanced DSP ISA with:

  • Full floating point unit – Add, multiply, divide, square root
  • ARMv8.1-M vector instructions
  • Advanced SIMD capabilities
  • More saturating and rounding modes

The vector extension improves parallelism for math-intensive DSP workloads. Cortex-M55 achieves DSP performance approaching dedicated DSP chips.

Benefits of DSP Instructions

Adding DSP instructions provides significant benefits for Cortex-M microcontrollers:

  • Higher performance for DSP algorithms – 2x to 10x faster
  • Lower power consumption due to accelerated processing
  • Reduced code size from single DSP instructions vs. multiple general instructions
  • Frees up CPU cycles for other tasks
  • Allows more complex DSP in microcontrollers

DSP optimization improves the efficiency, capabilities, and real-time performance of microcontrollers for DSP applications.

Use Cases and Applications

Some common applications leveraging DSP acceleration in Cortex-M microcontrollers:

  • Audio processing – EQs, filters, vocals, noise cancellation
  • Motor control – Field oriented control, sensorless FOC
  • Power conversion – Digital power, AC/DC, solar inverters
  • Sensor processing – Filtering, predictive maintenance, anomaly detection
  • Communications – Software-defined radio, beamforming
  • Computer vision – Image processing, pattern recognition

DSP instructions enable Cortex-M microcontrollers to take on more immersive analytics at the edge. The enhanced signal processing capabilities open up new potential applications as well.

Conclusion

DSP instructions in Arm Cortex-M series microcontrollers provide hardware acceleration for digital signal processing workloads. Key capabilities include saturating arithmetic, MAC operations, SIMD processing, and floating point math.

Successive Cortex-M cores expand the DSP instruction set for greater performance. DSP optimization speeds up processing, reduces power, and enables more advanced real-time analytics in microcontroller applications.

Newsletter Form (#3)

More ARM insights right in your inbox

 


Share This Article
Facebook Email Copy Link Print
Previous Article What are Saturated Math Instructions in Arm Cortex-M Series?
Next Article What are Half-Precision (HP) floating-point instructions in Arm Cortex-M series?
Leave a Comment Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

2kFollowersLike
3kFollowersFollow
10.1kFollowersPin
- Sponsored-
Ad image

You Might Also Like

Cortex-M4 DSP Instructions

The Cortex-M4 processor from ARM includes a range of digital…

6 Min Read

SysTick interrupt doesn’t trigger (Arm Cortex M0)

The SysTick interrupt not triggering on an ARM Cortex M0…

7 Min Read

Cortex-M0+ Flash Download failed

The Cortex-M0+ is an ultra low power 32-bit ARM processor…

7 Min Read

ARM Cortex M0+ Integer Division

The ARM Cortex-M0+ processor is an ultra low power 32-bit…

6 Min Read
SoCSoC
  • Looking for Something?
  • Privacy Policy
  • About Us
  • Sitemap
  • Contact Us
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?