lavu/riscv: fallback macros for SH{1, 2, 3}ADD

Those mnemonics require the very latest binutils release at the time of
writing. These macros provide seamless backward compatibility.
This commit is contained in:
Rémi Denis-Courmont 2022-09-26 17:52:27 +03:00 committed by Lynne
parent 1b6aee52a5
commit 39357cad37
1 changed files with 19 additions and 0 deletions

View File

@ -75,3 +75,22 @@
.purgem endconst
.endm
.endm
#if !defined (__riscv_zba)
/* SH{1,2,3}ADD definitions for pre-Zba assemblers */
.macro shnadd n, rd, rs1, rs2
.insn r OP, 2 * \n, 16, \rd, \rs1, \rs2
.endm
.macro sh1add rd, rs1, rs2
shnadd 1, \rd, \rs1, \rs2
.endm
.macro sh2add rd, rs1, rs2
shnadd 2, \rd, \rs1, \rs2
.endm
.macro sh3add rd, rs1, rs2
shnadd 3, \rd, \rs1, \rs2
.endm
#endif