On 01/17/2017 01:07 AM, Kirill Batuzov wrote:
+/***************************************/
+/* 64-bit and 128-bit vector arithmetic. */
+
+static inline void *tcg_v128_swap_slot(int n)
+{
+ return &tcg_ctx.v128_swap[n * 16];
+}
+
+/* Find a memory location for 128-bit TCG variable. */
+static inline void tcg_v128_to_ptr(TCGv_v128 tmp, TCGv_ptr base, int slot,
+ TCGv_ptr *real_base, intptr_t *real_offset,
+ int is_read)
None of this needs to be inline in tcg-op.h. All of it should be out-of-line
in tcg-op.c.
@@ -750,6 +778,7 @@ struct TCGContext {
void *code_gen_buffer;
size_t code_gen_buffer_size;
void *code_gen_ptr;
+ uint8_t v128_swap[16 * 3];
This is not thread-safe.
Shouldn't use space in TCGContext; should use space on stack.
Since there is no function call that is live, you can re-use the space for
on-stack arguments. There is TCG_STATIC_CALL_ARGS_SIZE (128) bytes allocated
for that. Which should be more than enough.
r~