Skip to contentSkip to conversation

sparc64: fix 128-bit atomic load from nucleus context

PATCH In review Igor V. Kovalenko 2 participants 3 messages May 28, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: fix 128-bit atomic load from nucleus context

From: Igor V. Kovalenko <[email protected]>

---
 sparc-dis.c              |    2 ++
 target-sparc/op_helper.c |   10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)
sparc-dis.c +2 -0
index c1b682d..dbd3b4f 100644
@@ -2155,6 +2155,8 @@ static const arg asi_table_v9[] =
   /* These are UltraSPARC extensions.  */
   { 0x14, "#ASI_PHYS_USE_EC"},
   { 0x15, "#ASI_PHYS_BYPASS_EC_WITH_EBIT"},
+  { 0x24, "#ASI_NUCLEUS_QUAD_LDD" },
+  { 0x2c, "#ASI_NUCLEUS_QUAD_LDD_LITTLE" },
   { 0x45, "#ASI_LSU_CONTROL_REG"},
   { 0x47, "#ASI_DCACHE_TAG"},
   { 0x49, "#ASI_INTR_RECEIVE"},
target-sparc/op_helper.c +5 -5
index e946ec7..63fef8c 100644
@@ -3088,19 +3088,19 @@ void helper_ldda_asi(target_ulong addr, int asi, int rd)
     case 0x2c: // Nucleus quad LDD 128 bit atomic LE
         helper_check_align(addr, 0xf);
         if (rd == 0) {
-            env->gregs[1] = ldq_kernel(addr + 8);
+            env->gregs[1] = ldq_nucleus(addr + 8);
             if (asi == 0x2c)
                 bswap64s(&env->gregs[1]);
         } else if (rd < 8) {
-            env->gregs[rd] = ldq_kernel(addr);
-            env->gregs[rd + 1] = ldq_kernel(addr + 8);
+            env->gregs[rd] = ldq_nucleus(addr);
+            env->gregs[rd + 1] = ldq_nucleus(addr + 8);
             if (asi == 0x2c) {
                 bswap64s(&env->gregs[rd]);
                 bswap64s(&env->gregs[rd + 1]);
             }
         } else {
-            env->regwptr[rd] = ldq_kernel(addr);
-            env->regwptr[rd + 1] = ldq_kernel(addr + 8);
+            env->regwptr[rd] = ldq_nucleus(addr);
+            env->regwptr[rd + 1] = ldq_nucleus(addr + 8);
             if (asi == 0x2c) {
                 bswap64s(&env->regwptr[rd]);
                 bswap64s(&env->regwptr[rd + 1]);
#1 lore raw
Quoted 13 lines · Igor V. Kovalenko

From: Igor V. Kovalenko <[email protected]>

---
 sparc-dis.c              |    2 ++
 target-sparc/op_helper.c |   10 +++++-----

 2 files changed, 7 insertions(+), 5 deletions(-)
sparc-dis.c +0 -0
index c1b682d..dbd3b4f 100644

sparc-dis.c static const arg asi_table_v9[] = · line 2162

Quoted 8 lines
sparc-dis.c +2 -0
@@ -2155,6 +2155,8 @@ static const arg asi_table_v9[] =
   /* These are UltraSPARC extensions.  */
   { 0x14, "#ASI_PHYS_USE_EC"},
   { 0x15, "#ASI_PHYS_BYPASS_EC_WITH_EBIT"},
+  { 0x24, "#ASI_NUCLEUS_QUAD_LDD" },
+  { 0x2c, "#ASI_NUCLEUS_QUAD_LDD_LITTLE" },
   { 0x45, "#ASI_LSU_CONTROL_REG"},
   { 0x47, "#ASI_DCACHE_TAG"},
   { 0x49, "#ASI_INTR_RECEIVE"},

The patch does not apply because the above line is not in the tree.

This change should be also mentioned in the commit body.

Quoted 32 lines
target-sparc/op_helper.c +0 -0
index e946ec7..63fef8c 100644
@@ -3088,19 +3088,19 @@ void helper_ldda_asi(target_ulong addr, int asi, int rd)

    case 0x2c: // Nucleus quad LDD 128 bit atomic LE helper_check_align(addr, 0xf);
        if (rd == 0) {
-            env->gregs[1] = ldq_kernel(addr + 8);
+            env->gregs[1] = ldq_nucleus(addr + 8); if (asi == 0x2c) bswap64s(&env->gregs[1]);
        } else if (rd < 8) {
-            env->gregs[rd] = ldq_kernel(addr);
-            env->gregs[rd + 1] = ldq_kernel(addr + 8);
+            env->gregs[rd] = ldq_nucleus(addr);
+            env->gregs[rd + 1] = ldq_nucleus(addr + 8); if (asi == 0x2c) { bswap64s(&env->gregs[rd]); bswap64s(&env->gregs[rd + 1]);
            }
        } else {
-            env->regwptr[rd] = ldq_kernel(addr);
-            env->regwptr[rd + 1] = ldq_kernel(addr + 8);
+            env->regwptr[rd] = ldq_nucleus(addr);
+            env->regwptr[rd + 1] = ldq_nucleus(addr + 8); if (asi == 0x2c) { bswap64s(&env->regwptr[rd]); bswap64s(&env->regwptr[rd + 1]);

#2 lore raw
Quoted 26 lines · Blue Swirl
Quoted 13 lines · Igor V. Kovalenko

From: Igor V. Kovalenko <[email protected]>

---
 sparc-dis.c              |    2 ++
 target-sparc/op_helper.c |   10 +++++-----

 2 files changed, 7 insertions(+), 5 deletions(-)
sparc-dis.c +0 -0
index c1b682d..dbd3b4f 100644

sparc-dis.c static const arg asi_table_v9[] = · line 2162

Quoted 8 lines
sparc-dis.c +2 -0
@@ -2155,6 +2155,8 @@ static const arg asi_table_v9[] =
   /* These are UltraSPARC extensions.  */
   { 0x14, "#ASI_PHYS_USE_EC"},
   { 0x15, "#ASI_PHYS_BYPASS_EC_WITH_EBIT"},
+  { 0x24, "#ASI_NUCLEUS_QUAD_LDD" },
+  { 0x2c, "#ASI_NUCLEUS_QUAD_LDD_LITTLE" },
   { 0x45, "#ASI_LSU_CONTROL_REG"},
   { 0x47, "#ASI_DCACHE_TAG"},
   { 0x49, "#ASI_INTR_RECEIVE"},

The patch does not apply because the above line is not in the tree.

Quoted 1 line

This change should be also mentioned in the commit body.

I decided to drop disassembler update, it can be done separately once for all ASI extensions.

Signature · 2 lines
Kind regards,
Igor V. Kovalenko