2
0
Эх сурвалжийг харах

CONSOLE: Handle P64, GPR64, TOC* and PPE (PS3) in PPC interpreter.

PS3 build command: make HOST_CC="gcc -m32" CROSS=ppu-lv2-
Mike Pall 13 жил өмнө
parent
commit
ca6bf2d9a4
5 өөрчлөгдсөн 316 нэмэгдсэн , 108 устгасан
  1. 4 1
      src/Makefile
  2. 7 2
      src/host/buildvm_asm.c
  3. 5 0
      src/lj_arch.h
  4. 11 0
      src/lj_frame.h
  5. 289 105
      src/vm_ppc.dasc

+ 4 - 1
src/Makefile

@@ -404,8 +404,11 @@ ifeq (ppc,$(TARGET_LJARCH))
   ifneq (,$(findstring LJ_ARCH_ROUND 1,$(TARGET_TESTARCH)))
     DASM_AFLAGS+= -D ROUND
   endif
+  ifneq (,$(findstring LJ_ARCH_PPC64 1,$(TARGET_TESTARCH)))
+    DASM_AFLAGS+= -D GPR64
+  endif
   ifeq (PS3,$(TARGET_SYS))
-    DASM_AFLAGS+= -D PS3
+    DASM_AFLAGS+= -D PPE -D TOC
   endif
 endif
 endif

+ 7 - 2
src/host/buildvm_asm.c

@@ -108,11 +108,16 @@ static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n,
     exit(1);
   }
 #elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE
+#if LJ_TARGET_PS3
+#define TOCPREFIX "."
+#else
+#define TOCPREFIX ""
+#endif
   if ((ins >> 26) == 16) {
-    fprintf(ctx->fp, "\t%s %d, %d, %s\n",
+    fprintf(ctx->fp, "\t%s %d, %d, " TOCPREFIX "%s\n",
 	    (ins & 1) ? "bcl" : "bc", (ins >> 21) & 31, (ins >> 16) & 31, sym);
   } else if ((ins >> 26) == 18) {
-    fprintf(ctx->fp, "\t%s %s\n", (ins & 1) ? "bl" : "b", sym);
+    fprintf(ctx->fp, "\t%s " TOCPREFIX "%s\n", (ins & 1) ? "bl" : "b", sym);
   } else {
     fprintf(stderr,
 	    "Error: unsupported opcode %08x for %s symbol relocation.\n",

+ 5 - 0
src/lj_arch.h

@@ -174,7 +174,11 @@
 #elif LUAJIT_TARGET == LUAJIT_ARCH_PPC
 
 #define LJ_ARCH_NAME		"ppc"
+#if _LP64
+#define LJ_ARCH_BITS		64
+#else
 #define LJ_ARCH_BITS		32
+#endif
 #define LJ_ARCH_ENDIAN		LUAJIT_BE
 #define LJ_ARCH_HASFPU		1
 #define LJ_TARGET_PPC		1
@@ -200,6 +204,7 @@
 #endif
 #if __PPC64__ || __powerpc64__ || LJ_TARGET_XBOX360
 #define LJ_ARCH_PPC64		1
+#define LJ_ARCH_NOFFI		1
 #endif
 #if _ARCH_PPCSQ
 #define LJ_ARCH_SQRT		1

+ 11 - 0
src/lj_frame.h

@@ -100,6 +100,16 @@ enum {
 #define CFRAME_SIZE		64
 #define CFRAME_SHIFT_MULTRES	3
 #elif LJ_TARGET_PPC
+#if LJ_ARCH_PPC64
+#define CFRAME_OFS_ERRF		472
+#define CFRAME_OFS_NRES		468
+#define CFRAME_OFS_PREV		448
+#define CFRAME_OFS_L		464
+#define CFRAME_OFS_PC		460
+#define CFRAME_OFS_MULTRES	456
+#define CFRAME_SIZE		400
+#define CFRAME_SHIFT_MULTRES	3
+#else
 #define CFRAME_OFS_ERRF		48
 #define CFRAME_OFS_NRES		44
 #define CFRAME_OFS_PREV		40
@@ -108,6 +118,7 @@ enum {
 #define CFRAME_OFS_MULTRES	28
 #define CFRAME_SIZE		272
 #define CFRAME_SHIFT_MULTRES	3
+#endif
 #elif LJ_TARGET_PPCSPE
 #define CFRAME_OFS_ERRF		28
 #define CFRAME_OFS_NRES		24

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 289 - 105
src/vm_ppc.dasc


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно