From 20cd1dfe3108854a94a12f1367cedbbd71622791 Mon Sep 17 00:00:00 2001 From: 4vtomat Date: Sat, 9 Apr 2022 02:27:40 -0700 Subject: [PATCH] Adding new macro to replace repetitive code --- riscv/decode.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/riscv/decode.h b/riscv/decode.h index a8cac940..7dd86e35 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -880,6 +880,21 @@ static inline bool is_aligned(const unsigned val, const unsigned pos) // vector: integer and masking operation loop // +#define INSNS_BASE(PARAMS, BODY) \ + if (sew == e8){ \ + PARAMS(e8); \ + BODY; \ + }else if(sew == e16){ \ + PARAMS(e16); \ + BODY; \ + }else if(sew == e32){ \ + PARAMS(e32); \ + BODY; \ + }else if(sew == e64){ \ + PARAMS(e64); \ + BODY; \ + } + // comparision result to masking register #define VI_VV_LOOP_CMP(BODY) \ VI_CHECK_MSS(true); \