aboutsummaryrefslogtreecommitdiff
path: root/target/ppc/internal.h
diff options
context:
space:
mode:
authorLucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>2022-05-24 11:05:31 -0300
committerDaniel Henrique Barboza <danielhb413@gmail.com>2022-05-26 17:11:33 -0300
commit345531533f26df49e74f16dafc88408408173ece (patch)
tree8586d5eeba5982cb2ab0b283b360d671c0740669 /target/ppc/internal.h
parenta702c5339eda791b969ed531ce99456df7ca8451 (diff)
target/ppc: Implemented xvi*ger* instructions
Implement the following PowerISA v3.1 instructions: xvi4ger8: VSX Vector 8-bit Signed/Unsigned Integer GER (rank-4 update) xvi4ger8pp: VSX Vector 8-bit Signed/Unsigned Integer GER (rank-4 update) Positive multiply, Positive accumulate xvi8ger4: VSX Vector 4-bit Signed Integer GER (rank-8 update) xvi8ger4pp: VSX Vector 4-bit Signed Integer GER (rank-8 update) Positive multiply, Positive accumulate xvi8ger4spp: VSX Vector 8-bit Signed/Unsigned Integer GER (rank-4 update) with Saturate Positive multiply, Positive accumulate xvi16ger2: VSX Vector 16-bit Signed Integer GER (rank-2 update) xvi16ger2pp: VSX Vector 16-bit Signed Integer GER (rank-2 update) Positive multiply, Positive accumulate xvi16ger2s: VSX Vector 16-bit Signed Integer GER (rank-2 update) with Saturation xvi16ger2spp: VSX Vector 16-bit Signed Integer GER (rank-2 update) with Saturation Positive multiply, Positive accumulate Signed-off-by: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220524140537.27451-3-lucas.araujo@eldorado.org.br> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Diffstat (limited to 'target/ppc/internal.h')
-rw-r--r--target/ppc/internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/target/ppc/internal.h b/target/ppc/internal.h
index 8094e0b033..2add128cd1 100644
--- a/target/ppc/internal.h
+++ b/target/ppc/internal.h
@@ -18,6 +18,8 @@
#ifndef PPC_INTERNAL_H
#define PPC_INTERNAL_H
+#include "hw/registerfields.h"
+
#define FUNC_MASK(name, ret_type, size, max_val) \
static inline ret_type name(uint##size##_t start, \
uint##size##_t end) \
@@ -291,4 +293,17 @@ G_NORETURN void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
uintptr_t retaddr);
#endif
+FIELD(GER_MSK, XMSK, 0, 4)
+FIELD(GER_MSK, YMSK, 4, 4)
+FIELD(GER_MSK, PMSK, 8, 8)
+
+static inline int ger_pack_masks(int pmsk, int ymsk, int xmsk)
+{
+ int msk = 0;
+ msk = FIELD_DP32(msk, GER_MSK, XMSK, xmsk);
+ msk = FIELD_DP32(msk, GER_MSK, YMSK, ymsk);
+ msk = FIELD_DP32(msk, GER_MSK, PMSK, pmsk);
+ return msk;
+}
+
#endif /* PPC_INTERNAL_H */