changeset 805:362b0258b4db

fix func_disp_offset in PS3
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 23 Nov 2010 23:08:56 +0900
parents aec31f182f9f
children 22a253cbb9d2
files mc-code-powerpc.c
diffstat 1 files changed, 9 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/mc-code-powerpc.c	Tue Nov 23 22:06:44 2010 +0900
+++ b/mc-code-powerpc.c	Tue Nov 23 23:08:56 2010 +0900
@@ -280,7 +280,7 @@
 
 static int max_reg_var, max_freg_var;
 
-//#ifdef __APPLE__
+#ifdef __APPLE__
 static char *reg_name[] = {
     "r0","r1","r2","r3","r4","r5","r6","r7","r8","r9",
     "r10","r11","r12","r13","r14","r15","r16","r17","r18","r19",
@@ -291,14 +291,13 @@
     "f20","f21","f22","f23","f24","f25","f26","f27","f28","f29",
     "f30","f31"
 }; 
-// #else
+#else
 // PS3 (PowerPC Fedora Core)
-#if 0
 static char *reg_name[] = {
-    "0","1","2","3","4","5","6","7","8","9",
-    "10","11","12","13","14","15","16","17","18","19",
-    "20","21","22","23","24","25","26","27","28","29",
-    "30","31",
+    "r0","r1","r2","r3","r4","r5","r6","r7","r8","r9",
+    "r10","r11","r12","r13","r14","r15","r16","r17","r18","r19",
+    "r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
+    "r30","r31",
     "0","1","2","3","4","5","6","7","8","9",
     "10","11","12","13","14","15","16","17","18","19",
     "20","21","22","23","24","25","26","27","28","29",
@@ -494,8 +493,8 @@
 #define arg_offset0  (8)
 #define arg_offset1  (8)
 
-#define func_disp_offset (8)
-#define code_disp_offset0 (0)
+#define func_disp_offset (12)
+#define code_disp_offset0 (-4)
 
 #endif
 
@@ -3271,38 +3270,6 @@
 "     .set r29,29\n"
 "     .set r30,30\n"
 "     .set r31,31\n"
-"     .set f0,0\n"
-"     .set f1,1\n"
-"     .set f2,2\n"
-"     .set f3,3\n"
-"     .set f4,4\n"
-"     .set f5,5\n"
-"     .set f6,6\n"
-"     .set f7,7\n"
-"     .set f8,8\n"
-"     .set f9,9\n"
-"     .set f10,10\n"
-"     .set f11,11\n"
-"     .set f12,12\n"
-"     .set f13,13\n"
-"     .set f14,14\n"
-"     .set f15,15\n"
-"     .set f16,16\n"
-"     .set f17,17\n"
-"     .set f18,18\n"
-"     .set f19,19\n"
-"     .set f20,20\n"
-"     .set f21,21\n"
-"     .set f22,22\n"
-"     .set f23,23\n"
-"     .set f24,24\n"
-"     .set f25,25\n"
-"     .set f26,26\n"
-"     .set f27,27\n"
-"     .set f28,28\n"
-"     .set f29,29\n"
-"     .set f30,30\n"
-"     .set f31,31\n"
       );
 #endif
 
@@ -3522,6 +3489,7 @@
     printf("\t.type\t%s,@function\n",name);
  */
     printf("%s:\n",name);
+    control = 1;
     code_setup=fwdlabel();
     arg_offset_label = fwdlabel();
     printf("\tmflr 0\n");