Commit d795eb86d73c61351c70f7a9714b40e8a5c49e3d

Authored by blueswir1
1 parent 6a1ef830

Fix 64 bit constant generation

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4854 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 4 deletions
tcg/sparc/tcg-target.c
@@ -304,11 +304,10 @@ static inline void tcg_out_movi(TCGContext *s, TCGType type, @@ -304,11 +304,10 @@ static inline void tcg_out_movi(TCGContext *s, TCGType type,
304 { 304 {
305 #if defined(__sparc_v9__) && !defined(__sparc_v8plus__) 305 #if defined(__sparc_v9__) && !defined(__sparc_v8plus__)
306 if (!check_fit_tl(arg, 32) && (arg & ~0xffffffffULL) != 0) { 306 if (!check_fit_tl(arg, 32) && (arg & ~0xffffffffULL) != 0) {
307 - // XXX ret may be I5, need another temp  
308 - tcg_out_movi_imm32(s, TCG_REG_I5, arg >> 32);  
309 - tcg_out_arithi(s, TCG_REG_I5, TCG_REG_I5, 32, SHIFT_SLLX); 307 + tcg_out_movi_imm32(s, TCG_REG_I4, arg >> 32);
  308 + tcg_out_arithi(s, TCG_REG_I4, TCG_REG_I4, 32, SHIFT_SLLX);
310 tcg_out_movi_imm32(s, ret, arg); 309 tcg_out_movi_imm32(s, ret, arg);
311 - tcg_out_arith(s, ret, ret, TCG_REG_I5, ARITH_OR); 310 + tcg_out_arith(s, ret, ret, TCG_REG_I4, ARITH_OR);
312 } else 311 } else
313 #endif 312 #endif
314 tcg_out_movi_imm32(s, ret, arg); 313 tcg_out_movi_imm32(s, ret, arg);
@@ -1137,6 +1136,9 @@ void tcg_target_init(TCGContext *s) @@ -1137,6 +1136,9 @@ void tcg_target_init(TCGContext *s)
1137 1136
1138 tcg_regset_clear(s->reserved_regs); 1137 tcg_regset_clear(s->reserved_regs);
1139 tcg_regset_set_reg(s->reserved_regs, TCG_REG_G0); 1138 tcg_regset_set_reg(s->reserved_regs, TCG_REG_G0);
  1139 +#if defined(__sparc_v9__) && !defined(__sparc_v8plus__)
  1140 + tcg_regset_set_reg(s->reserved_regs, TCG_REG_I4); // for internal use
  1141 +#endif
1140 tcg_regset_set_reg(s->reserved_regs, TCG_REG_I5); // for internal use 1142 tcg_regset_set_reg(s->reserved_regs, TCG_REG_I5); // for internal use
1141 tcg_regset_set_reg(s->reserved_regs, TCG_REG_I6); 1143 tcg_regset_set_reg(s->reserved_regs, TCG_REG_I6);
1142 tcg_regset_set_reg(s->reserved_regs, TCG_REG_I7); 1144 tcg_regset_set_reg(s->reserved_regs, TCG_REG_I7);