Skip to content

Commit

Permalink
lavu/riscv: fallback macros for SH{1, 2, 3}ADD
Browse files Browse the repository at this point in the history
Those mnemonics require the very latest binutils release at the time of
writing. These macros provide seamless backward compatibility.
  • Loading branch information
Rémi Denis-Courmont authored and cyanreg committed Sep 27, 2022
1 parent 1b6aee5 commit 39357ca
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions libavutil/riscv/asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 39357ca

Please sign in to comment.