]> Git Repo - qemu.git/blobdiff - tcg/sparc/tcg-target.c
Fix some warnings that would be generated by gcc -Wredundant-decls
[qemu.git] / tcg / sparc / tcg-target.c
index e9a2b91de281d2bf800fe29cf342ea76b3431bcf..861ed8e3d31c07f0d0e9253a6291b64d5f1f29cc 100644 (file)
@@ -268,8 +268,8 @@ static inline void tcg_out_arith(TCGContext *s, int rd, int rs1, int rs2,
               INSN_RS2(rs2));
 }
 
-static inline void tcg_out_arithi(TCGContext *s, int rd, int rs1, int offset,
-                                  int op)
+static inline void tcg_out_arithi(TCGContext *s, int rd, int rs1,
+                                  uint32_t offset, int op)
 {
     tcg_out32(s, op | INSN_RD(rd) | INSN_RS1(rs1) |
               INSN_IMM13(offset));
@@ -292,7 +292,7 @@ static inline void tcg_out_movi_imm13(TCGContext *s, int ret, uint32_t arg)
 
 static inline void tcg_out_movi_imm32(TCGContext *s, int ret, uint32_t arg)
 {
-    if (check_fit_i32(arg, 12))
+    if (check_fit_tl(arg, 12))
         tcg_out_movi_imm13(s, ret, arg);
     else {
         tcg_out_sethi(s, ret, arg);
@@ -310,9 +310,16 @@ static inline void tcg_out_movi(TCGContext *s, TCGType type,
         tcg_out_arithi(s, TCG_REG_I4, TCG_REG_I4, 32, SHIFT_SLLX);
         tcg_out_movi_imm32(s, ret, arg);
         tcg_out_arith(s, ret, ret, TCG_REG_I4, ARITH_OR);
-    } else
+    } else if (check_fit_tl(arg, 12))
+        tcg_out_movi_imm13(s, ret, arg);
+    else {
+        tcg_out_sethi(s, ret, arg);
+        if (arg & 0x3ff)
+            tcg_out_arithi(s, ret, ret, arg & 0x3ff, ARITH_OR);
+    }
+#else
+    tcg_out_movi_imm32(s, ret, arg);
 #endif
-        tcg_out_movi_imm32(s, ret, arg);
 }
 
 static inline void tcg_out_ld_raw(TCGContext *s, int ret,
@@ -465,16 +472,8 @@ void tcg_target_qemu_prologue(TCGContext *s)
 }
 
 #if defined(CONFIG_SOFTMMU)
-extern void __ldb_mmu(void);
-extern void __ldw_mmu(void);
-extern void __ldl_mmu(void);
-extern void __ldq_mmu(void);
-
-extern void __stb_mmu(void);
-extern void __stw_mmu(void);
-extern void __stl_mmu(void);
-extern void __stq_mmu(void);
 
+#include "../../softmmu_defs.h"
 
 static const void * const qemu_ld_helpers[4] = {
     __ldb_mmu,
@@ -625,8 +624,18 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,
     /* ld [arg1 + x], arg1 */
     tcg_out_ldst(s, arg1, arg1, offsetof(CPUTLBEntry, addend) -
                  offsetof(CPUTLBEntry, addr_read), HOST_LD_OP);
+
+#if TARGET_LONG_BITS == 32
+    /* and addr_reg, x, arg0 */
+    tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_I5, 0xffffffff);
+    tcg_out_arith(s, arg0, addr_reg, TCG_REG_I5, ARITH_AND);
+    /* add arg0, arg1, arg0 */
+    tcg_out_arith(s, arg0, arg0, arg1, ARITH_ADD);
+#else
     /* add addr_reg, arg1, arg0 */
     tcg_out_arith(s, arg0, addr_reg, arg1, ARITH_ADD);
+#endif
+
 #else
     arg0 = addr_reg;
 #endif
@@ -785,8 +794,17 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,
     tcg_out_ldst(s, arg1, arg1, offsetof(CPUTLBEntry, addend) -
                  offsetof(CPUTLBEntry, addr_write), HOST_LD_OP);
 
+#if TARGET_LONG_BITS == 32
+    /* and addr_reg, x, arg0 */
+    tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_I5, 0xffffffff);
+    tcg_out_arith(s, arg0, addr_reg, TCG_REG_I5, ARITH_AND);
+    /* add arg0, arg1, arg0 */
+    tcg_out_arith(s, arg0, arg0, arg1, ARITH_ADD);
+#else
     /* add addr_reg, arg1, arg0 */
     tcg_out_arith(s, arg0, addr_reg, arg1, ARITH_ADD);
+#endif
+
 #else
     arg0 = addr_reg;
 #endif
This page took 0.022577 seconds and 4 git commands to generate.