Skip to content

ARC GNU support for DSP instructions

Claudiu Zissulescu edited this page May 11, 2020 · 5 revisions

Intro

ARCHS and ARCEM processors are adding support for fixed-point operations via DSP instructions. These instructions are also used/supported by the ARC GNU compiler via <stdfix.h> which is implemented accordingly with C Extensions to support embedded processors standard and GNU GCC manual.

The native fixed-point arithmetic adds:

  • saturating arithmetic;
  • fixed-point arithmetic;
  • Rounding is not considered by the compiler, and it will always be done as specified in ARC's auxiliary register DSP_CTRL;
  • prefix and postfix increment and decrement operators (++, --);
  • unary arithmetic operators (+, -, !);
  • binary arithmetic operators (+, -, *, /);
  • binary shift operators (<<, >>);
  • relational operators (<, <=, >=, >);
  • equality operators (==, !=);
  • assignment operators (+=, -=, *=, /=, <<=, >>=);
  • conversions to and from integer, floating-point, or fixed-point types.

For more, see GNU GCC manual.

Directly mapped ARC' DSP instructions.

Mode plus minus mul div lshft rshft
q15 X X X X X X
sat q15 VADDS2H VSUBS2H VMPY2HF X VASLS2H VASRS2H
q31 X X X DIVF X X
sat q31 ADDS SUBS MPYF X ASLS ASRS
q63 X X X X X X
sat q63 SATF SATF X X X X
a32 X X X X X X
sat a31 X X X X X X

Smart builtins.

Name rtl instruction
abssh ss_abs ABSSH
abss ss_abs ABSS