hi,
this adds amd64 support and removes the need to use 387 instructions,
sorta. compiles and works fine here, tho haven't tried it much yet.
i'd like to know if there any speed differences in i386 or macppc (if
it still compiles :-) ), for good or bad, and if there are any
outstanding issues with this port that'd be nice to fix (someone told me
fp was not working, is this right?).
comments welcome. ok's better.
f.-
pd: this is a hack. i'd take a look to implement this properly, but
in the meantime it seems to do it.
Index: Makefile
===================================================================
RCS file: /cvs/ports/emulators/qemu/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile 25 Oct 2005 03:25:44 -0000 1.5
+++ Makefile 25 Oct 2005 06:07:04 -0000
@@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.5 2005/10/25 03:25:44 todd Exp $
-ONLY_FOR_ARCHS= i386 macppc # no success building on other archs yet
+ONLY_FOR_ARCHS= amd64 i386 macppc # no success building on other archs
yet
COMMENT= "multi system emulator"
DISTNAME= qemu-0.7.2
-PKGNAME= qemu-0.7.2
+PKGNAME= ${DISTNAME}p0
CATEGORIES= emulators
HOMEPAGE= http://fabrice.bellard.free.fr/qemu/
Index: patches/patch-Makefile_target
===================================================================
RCS file: /cvs/ports/emulators/qemu/patches/patch-Makefile_target,v
retrieving revision 1.4
diff -u -p -r1.4 patch-Makefile_target
--- patches/patch-Makefile_target 25 Oct 2005 03:25:44 -0000 1.4
+++ patches/patch-Makefile_target 25 Oct 2005 06:07:04 -0000
@@ -1,6 +1,6 @@
$OpenBSD: patch-Makefile_target,v 1.4 2005/10/25 03:25:44 todd Exp $
---- Makefile.target.orig Sun Sep 4 12:11:31 2005
-+++ Makefile.target Mon Oct 24 21:59:30 2005
+--- Makefile.target.orig Sun Sep 4 14:11:31 2005
++++ Makefile.target Tue Oct 25 02:44:17 2005
@@ -17,7 +17,7 @@ ifdef CONFIG_USER_ONLY
VPATH+=:$(SRC_PATH)/linux-user
DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
@@ -10,24 +10,6 @@ $OpenBSD: patch-Makefile_target,v 1.4 20
#CFLAGS+=-Werror
LDFLAGS=-g
LIBS=
-@@ -61,7 +61,7 @@ ifeq ($(ARCH),i386)
- CFLAGS+=-fomit-frame-pointer
- OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
- ifeq ($(HAVE_GCC3_OPTIONS),yes)
--OP_CFLAGS+= -falign-functions=0 -fno-gcse
-+OP_CFLAGS+= -falign-functions=0 -fno-gcse -mfpmath=387
- else
- OP_CFLAGS+= -malign-functions=0
- endif
-@@ -83,7 +83,7 @@ endif
- endif
-
- ifeq ($(ARCH),x86_64)
--OP_CFLAGS=$(CFLAGS) -falign-functions=0
-+OP_CFLAGS=$(CFLAGS) -falign-functions=0 -mfpmath=387
- LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld
- endif
-
@@ -138,6 +138,12 @@ OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer
LDFLAGS+=-Wl,-T,m68k.ld
endif
Index: patches/patch-target-i386_helper_c
===================================================================
RCS file: patches/patch-target-i386_helper_c
diff -N patches/patch-target-i386_helper_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-target-i386_helper_c 25 Oct 2005 06:07:04 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+--- target-i386/helper.c.orig Tue Oct 25 02:58:34 2005
++++ target-i386/helper.c Tue Oct 25 02:59:43 2005
+@@ -3483,3 +3483,13 @@ void tlb_fill(target_ulong addr, int is_
+ }
+ env = saved_env;
+ }
++
++void helper_fchs_ST0(void)
++{
++ ST0 = floatx_chs(ST0);
++}
++
++void helper_fabs_ST0(void)
++{
++ ST0 = floatx_abs(ST0);
++}
Index: patches/patch-target-i386_op_c
===================================================================
RCS file: patches/patch-target-i386_op_c
diff -N patches/patch-target-i386_op_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-target-i386_op_c 25 Oct 2005 06:07:04 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+--- target-i386/op.c.orig Tue Oct 25 02:58:19 2005
++++ target-i386/op.c Tue Oct 25 02:59:25 2005
+@@ -2100,12 +2100,12 @@ void OPPROTO op_fdivr_STN_ST0(void)
+ /* misc FPU operations */
+ void OPPROTO op_fchs_ST0(void)
+ {
+- ST0 = floatx_chs(ST0);
++ helper_fchs_ST0();
+ }
+
+ void OPPROTO op_fabs_ST0(void)
+ {
+- ST0 = floatx_abs(ST0);
++ helper_fabs_ST0();
+ }
+
+ void OPPROTO op_fxam_ST0(void)
Index: patches/patch-target-sparc_op_c
===================================================================
RCS file: patches/patch-target-sparc_op_c
diff -N patches/patch-target-sparc_op_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-target-sparc_op_c 25 Oct 2005 06:07:04 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- target-sparc/op.c.orig Tue Oct 25 02:31:41 2005
++++ target-sparc/op.c Tue Oct 25 02:32:12 2005
+@@ -1301,7 +1301,7 @@ void OPPROTO op_flush_T0(void)
+
+ void OPPROTO op_fnegs(void)
+ {
+- FT0 = -FT1;
++ do_fnegs();
+ }
+
+ void OPPROTO op_fabss(void)
Index: patches/patch-target-sparc_op_helper_c
===================================================================
RCS file: patches/patch-target-sparc_op_helper_c
diff -N patches/patch-target-sparc_op_helper_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-target-sparc_op_helper_c 25 Oct 2005 06:07:04 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+--- target-sparc/op_helper.c.orig Tue Oct 25 02:31:48 2005
++++ target-sparc/op_helper.c Tue Oct 25 02:32:36 2005
+@@ -26,6 +26,11 @@ void do_fabss(void)
+ FT0 = float32_abs(FT1);
+ }
+
++void do_fnegs(void)
++{
++ FT0 = -FT1;
++}
++
+ #ifdef TARGET_SPARC64
+ void do_fabsd(void)
+ {