On 10/24/2013 1:51 PM, Richard Henderson wrote:
On 10/24/2013 09:19 AM, Tom Musta wrote:
+#define GEN_VSX_HELPER_2(name, op1, op2, inval, type) \
+static void gen_##name(DisasContext * ctx) \
+{ \
+ TCGv_i32 opc; \
+ if (unlikely(!ctx->vsx_enabled)) { \
+ gen_exception(ctx, POWERPC_EXCP_VSXU); \
+ return; \
+ } \
+ /* NIP cannot be restored if the memory exception comes from an helper */ \
+ gen_update_nip(ctx, ctx->nip - 4); \
+ opc = tcg_const_i32(ctx->opcode); \
+ gen_helper_##name(cpu_env, opc); \
+ tcg_temp_free_i32(opc); \
+}
I'm not a fan of delaying decode to the helpers...
You're mostly doing this to avoid passing 3-4 arguments
for the register numbers?
Because the VSRs are 128 bits wide and because there is an interesting
relationship
with the FPRs and AVRs, passing 6 or more arguments would typically be required
(2 per VSR). And, they would need to be stitched back together into a single
structure in order to use the loops in the vector routines. I did prototype
something
like this and didn't like it.
Unless you are suggesting that the decoded VSR index (0..63) be passed to the
helper?