tcg/ppc: Use tcg_out_mem_long to reset TCG_REG_TB
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 5 Nov 2020 19:34:51 +0000 (19:34 +0000)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 7 Jan 2021 15:09:42 +0000 (05:09 -1000)
The maximum TB code gen size is UINT16_MAX, which the current
code does not support.  Use our utility function to optimally
add an arbitrary constant.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tcg/ppc/tcg-target.c.inc

index ed7a2015782ed22d4bcbc3a101ea5b275c77cf3e..1f8a446b90f2d73ce1a81da389309d1cc91c2ae7 100644 (file)
@@ -2392,9 +2392,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
         set_jmp_reset_offset(s, args[0]);
         if (USE_REG_TB) {
             /* For the unlinked case, need to reset TCG_REG_TB.  */
-            c = -tcg_current_code_size(s);
-            assert(c == (int16_t)c);
-            tcg_out32(s, ADDI | TAI(TCG_REG_TB, TCG_REG_TB, c));
+            tcg_out_mem_long(s, ADDI, ADD, TCG_REG_TB, TCG_REG_TB,
+                             -tcg_current_code_size(s));
         }
         break;
     case INDEX_op_goto_ptr: