qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

tcg: Add tcg_gen_gvec_5_ptr

Extend the vector generator infrastructure to handle
5 vector arguments.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Taylor Simpson <tsimpson@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

+39
+7
include/tcg/tcg-op-gvec.h
··· 83 83 uint32_t maxsz, int32_t data, 84 84 gen_helper_gvec_4_ptr *fn); 85 85 86 + typedef void gen_helper_gvec_5_ptr(TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_ptr, 87 + TCGv_ptr, TCGv_ptr, TCGv_i32); 88 + void tcg_gen_gvec_5_ptr(uint32_t dofs, uint32_t aofs, uint32_t bofs, 89 + uint32_t cofs, uint32_t eofs, TCGv_ptr ptr, 90 + uint32_t oprsz, uint32_t maxsz, int32_t data, 91 + gen_helper_gvec_5_ptr *fn); 92 + 86 93 /* Expand a gvec operation. Either inline or out-of-line depending on 87 94 the actual vector size and the operations supported by the host. */ 88 95 typedef struct {
+32
tcg/tcg-op-gvec.c
··· 290 290 tcg_temp_free_i32(desc); 291 291 } 292 292 293 + /* Generate a call to a gvec-style helper with five vector operands 294 + and an extra pointer operand. */ 295 + void tcg_gen_gvec_5_ptr(uint32_t dofs, uint32_t aofs, uint32_t bofs, 296 + uint32_t cofs, uint32_t eofs, TCGv_ptr ptr, 297 + uint32_t oprsz, uint32_t maxsz, int32_t data, 298 + gen_helper_gvec_5_ptr *fn) 299 + { 300 + TCGv_ptr a0, a1, a2, a3, a4; 301 + TCGv_i32 desc = tcg_const_i32(simd_desc(oprsz, maxsz, data)); 302 + 303 + a0 = tcg_temp_new_ptr(); 304 + a1 = tcg_temp_new_ptr(); 305 + a2 = tcg_temp_new_ptr(); 306 + a3 = tcg_temp_new_ptr(); 307 + a4 = tcg_temp_new_ptr(); 308 + 309 + tcg_gen_addi_ptr(a0, cpu_env, dofs); 310 + tcg_gen_addi_ptr(a1, cpu_env, aofs); 311 + tcg_gen_addi_ptr(a2, cpu_env, bofs); 312 + tcg_gen_addi_ptr(a3, cpu_env, cofs); 313 + tcg_gen_addi_ptr(a4, cpu_env, eofs); 314 + 315 + fn(a0, a1, a2, a3, a4, ptr, desc); 316 + 317 + tcg_temp_free_ptr(a0); 318 + tcg_temp_free_ptr(a1); 319 + tcg_temp_free_ptr(a2); 320 + tcg_temp_free_ptr(a3); 321 + tcg_temp_free_ptr(a4); 322 + tcg_temp_free_i32(desc); 323 + } 324 + 293 325 /* Return true if we want to implement something of OPRSZ bytes 294 326 in units of LNSZ. This limits the expansion of inline code. */ 295 327 static inline bool check_size_impl(uint32_t oprsz, uint32_t lnsz)