sparc64: improve ldf and stf insns
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>
Tue, 1 Jun 2010 20:12:48 +0000 (00:12 +0400)
committerBlue Swirl <blauwirbel@gmail.com>
Wed, 2 Jun 2010 20:06:46 +0000 (20:06 +0000)
- implemented block load/store primary/secondary with user privilege

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-sparc/op_helper.c

index 842dbd3d19a0388ea60000d8df8df07914f80ea7..470c710755f400ec45b585334ee6a83b26a5acad 100644 (file)
@@ -3163,6 +3163,20 @@ void helper_ldf_asi(target_ulong addr, int asi, int size, int rd)
             addr += 4;
         }
 
+        return;
+    case 0x70: // Block load primary, user privilege
+    case 0x71: // Block load secondary, user privilege
+        if (rd & 7) {
+            raise_exception(TT_ILL_INSN);
+            return;
+        }
+        helper_check_align(addr, 0x3f);
+        for (i = 0; i < 16; i++) {
+            *(uint32_t *)&env->fpr[rd++] = helper_ld_asi(addr, asi & 0x1f, 4,
+                                                         0);
+            addr += 4;
+        }
+
         return;
     default:
         break;
@@ -3209,6 +3223,20 @@ void helper_stf_asi(target_ulong addr, int asi, int size, int rd)
             addr += 4;
         }
 
+        return;
+    case 0x70: // Block store primary, user privilege
+    case 0x71: // Block store secondary, user privilege
+        if (rd & 7) {
+            raise_exception(TT_ILL_INSN);
+            return;
+        }
+        helper_check_align(addr, 0x3f);
+        for (i = 0; i < 16; i++) {
+            val = *(uint32_t *)&env->fpr[rd++];
+            helper_st_asi(addr, val, asi & 0x1f, 4);
+            addr += 4;
+        }
+
         return;
     default:
         break;