Skip to contentSkip to conversation

[4902] Implement nucleus quad ldda

Qemu-devel Blue Swirl 1 participant 1 message Jul 19, 2008

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Revision: 4902

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4902
Author:   blueswir1
Date:     2008-07-19 13:25:28 +0000 (Sat, 19 Jul 2008)

Log Message:
-----------
Implement nucleus quad ldda

Modified Paths:
--------------
trunk/target-sparc/helper.h
trunk/target-sparc/op_helper.c
trunk/target-sparc/translate.c

Modified: trunk/target-sparc/helper.h
===================================================================

target-sparc/helper.h +1 -0
@@ -22,6 +22,7 @@
 DEF_HELPER(target_ulong, helper_alignaddr, (target_ulong addr, \
                                             target_ulong offset))
 DEF_HELPER(target_ulong, helper_popc, (target_ulong val))
+DEF_HELPER(void, helper_ldda_asi, (target_ulong addr, int asi, int rd))
 DEF_HELPER(void, helper_ldf_asi, (target_ulong addr, int asi, int size, int rd))
 DEF_HELPER(void, helper_stf_asi, (target_ulong addr, int asi, int size, int rd))
 DEF_HELPER(target_ulong, helper_cas_asi, (target_ulong addr, \

Modified: trunk/target-sparc/op_helper.c
===================================================================

target-sparc/op_helper.c +57 -4

87 lines not on this page · raw message

Modified: trunk/target-sparc/translate.c
===================================================================

target-sparc/translate.c +12 -16
@@ -1722,20 +1722,15 @@
     tcg_gen_trunc_i64_tl(dst, cpu_tmp64);
 }
 
-static inline void gen_ldda_asi(TCGv lo, TCGv hi, TCGv addr, int insn)
+static inline void gen_ldda_asi(TCGv hi, TCGv addr, int insn, int rd)
 {
-    TCGv r_asi, r_size, r_sign;
+    TCGv r_asi, r_rd;
 
     r_asi = gen_get_asi(insn, addr);
-    r_size = tcg_const_i32(8);
-    r_sign = tcg_const_i32(0);
-    tcg_gen_helper_1_4(helper_ld_asi, cpu_tmp64, addr, r_asi, r_size, r_sign);
-    tcg_temp_free(r_sign);
-    tcg_temp_free(r_size);
+    r_rd = tcg_const_i32(rd);
+    tcg_gen_helper_0_3(helper_ldda_asi, addr, r_asi, r_rd);
+    tcg_temp_free(r_rd);
     tcg_temp_free(r_asi);
-    tcg_gen_andi_i64(lo, cpu_tmp64, 0xffffffffULL);
-    tcg_gen_shri_i64(cpu_tmp64, cpu_tmp64, 32);
-    tcg_gen_andi_i64(hi, cpu_tmp64, 0xffffffffULL);
 }
 
 static inline void gen_stda_asi(TCGv hi, TCGv addr, int insn, int rd)
@@ -1822,7 +1817,7 @@
     tcg_gen_trunc_i64_tl(dst, cpu_tmp64);
 }
 
-static inline void gen_ldda_asi(TCGv lo, TCGv hi, TCGv addr, int insn)
+static inline void gen_ldda_asi(TCGv hi, TCGv addr, int insn, int rd)
 {
     TCGv r_asi, r_size, r_sign;
 
@@ -1833,9 +1828,11 @@
     tcg_temp_free(r_sign);
     tcg_temp_free(r_size);
     tcg_temp_free(r_asi);
-    tcg_gen_trunc_i64_tl(lo, cpu_tmp64);
+    tcg_gen_trunc_i64_tl(cpu_tmp0, cpu_tmp64);
+    gen_movl_TN_reg(rd + 1, cpu_tmp0);
     tcg_gen_shri_i64(cpu_tmp64, cpu_tmp64, 32);
     tcg_gen_trunc_i64_tl(hi, cpu_tmp64);
+    gen_movl_TN_reg(rd, hi);
 }
 
 static inline void gen_stda_asi(TCGv hi, TCGv addr, int insn, int rd)
@@ -4310,9 +4307,8 @@
                     if (rd & 1)
                         goto illegal_insn;
                     save_state(dc, cpu_cond);
-                    gen_ldda_asi(cpu_tmp0, cpu_val, cpu_addr, insn);
-                    gen_movl_TN_reg(rd + 1, cpu_tmp0);
-                    break;
+                    gen_ldda_asi(cpu_val, cpu_addr, insn, rd);
+                    goto skip_move;
                 case 0x19:      /* load signed byte alternate */
 #ifndef TARGET_SPARC64
                     if (IS_IMM)
@@ -4403,7 +4399,7 @@
                     goto illegal_insn;
                 }
                 gen_movl_TN_reg(rd, cpu_val);
-#ifdef TARGET_SPARC64
+#if !defined(CONFIG_USER_ONLY) || defined(TARGET_SPARC64)
             skip_move: ;
 #endif
             } else if (xop >= 0x20 && xop < 0x24) {