On 8/13/21 12:37 AM, Peter Maydell wrote:
These changes look OK as far as they go, but it's not clear to me why the other places that set P_REXW are all OK to use P_REXW and not P_VEXW. For instance tcg_out_mov() sets rexw = P_REXW and some of the codepaths there will then pass that into tcg_out_vex_modrm() which ends up in tcg_out_vex_opc().
This distinguishes between 32-bit and 64-bit transfer between vector and general register. Which of course doesn't make sense for i386.
More generally, is there somewhere we can assert that we didn't try to use a REXW prefix for i386 codegen rather than just silently ignoring it ?
I guess tcg_out_opc might be a place. But mostly we try to avoid generating those places in the first place. E.g.
#if TCG_TARGET_REG_BITS == 64 # define OP_32_64(x) \ case glue(glue(INDEX_op_, x), _i64): \ rexw = P_REXW; /* FALLTHRU */ \ case glue(glue(INDEX_op_, x), _i32) #else # define OP_32_64(x) \ case glue(glue(INDEX_op_, x), _i32) #endif r~