From 997dffc64948884f025fe4ee56febb690e0473b3 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 29 May 2006 03:02:54 +0000 Subject: [PATCH] Correction in PowerPC JIT code. Fixes crash in server browser, etc, on Mac OS X and probably PowerPC Linux, too...fixes Bugzilla #2519. --- Makefile | 2 +- code/qcommon/vm_ppc_new.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 52986e9d..02c27d01 100644 --- a/Makefile +++ b/Makefile @@ -264,7 +264,7 @@ ifeq ($(PLATFORM),darwin) CC=gcc # !!! FIXME: calling conventions are still broken! See Bugzilla #2519 - #VM_PPC=vm_ppc_new + VM_PPC=vm_ppc_new BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes BASE_CFLAGS += -DMACOS_X -fno-common -pipe diff --git a/code/qcommon/vm_ppc_new.c b/code/qcommon/vm_ppc_new.c index c10e7007..bab80ce6 100644 --- a/code/qcommon/vm_ppc_new.c +++ b/code/qcommon/vm_ppc_new.c @@ -1106,7 +1106,7 @@ void VM_Compile( vm_t *vm, vmHeader_t *header ) { #endif assertInteger(opStackDepth-1); assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); + Inst( "cmpl", PPC_CMPL, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); opStackRegType[opStackDepth-1] = 0; opStackRegType[opStackDepth-2] = 0; opStackLoadInstructionAddr[opStackDepth-1] = 0; @@ -1130,7 +1130,7 @@ void VM_Compile( vm_t *vm, vmHeader_t *header ) { #endif assertInteger(opStackDepth-1); assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); + Inst( "cmpl", PPC_CMPL, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); opStackRegType[opStackDepth-1] = 0; opStackRegType[opStackDepth-2] = 0; opStackLoadInstructionAddr[opStackDepth-1] = 0; @@ -1154,7 +1154,7 @@ void VM_Compile( vm_t *vm, vmHeader_t *header ) { #endif assertInteger(opStackDepth-1); assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); + Inst( "cmpl", PPC_CMPL, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); opStackRegType[opStackDepth-1] = 0; opStackRegType[opStackDepth-2] = 0; opStackLoadInstructionAddr[opStackDepth-1] = 0; @@ -1178,7 +1178,7 @@ void VM_Compile( vm_t *vm, vmHeader_t *header ) { #endif assertInteger(opStackDepth-1); assertInteger(opStackDepth-2); - Inst( "cmp", PPC_CMP, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); + Inst( "cmpl", PPC_CMPL, 0, opStackIntRegisters[opStackDepth-2], opStackIntRegisters[opStackDepth-1] ); opStackRegType[opStackDepth-1] = 0; opStackRegType[opStackDepth-2] = 0; opStackLoadInstructionAddr[opStackDepth-1] = 0;