Thread: [Sablevm-developer] Bug#245834: Missing amd64 support.
Brought to you by:
egagnon
From: Kurt R. <Q...@pi...> - 2004-04-25 17:56:52
|
Package: sablevm Version: 1.1.3-1 It currently doesn't seem to have support for amd64. Adding support for it seems mostly adding || defined(__x86_64__) where __i386__ is used, except for system.h where the word/allignment needs to be chagned from 32bit/4byte to 64bit/8byte. I just don't know enough assembler/hardware details for the things in system.c Kurt |
From: Andreas J. <aj...@an...> - 2004-05-01 22:38:10
|
tags 245834 + patch On 04-Apr-25 19:42, Kurt Roeckx wrote: > It currently doesn't seem to have support for amd64. Adding > support for it seems mostly adding || defined(__x86_64__) where > __i386__ is used, except for system.h where the word/allignment > needs to be chagned from 32bit/4byte to 64bit/8byte. > > I just don't know enough assembler/hardware details for the > things in system.c The attached patch seems to work for me. Regards Andreas Jochens diff -urN ../tmp-orig/sablevm-1.1.3/src/libsablevm/include/jni_system_specific.h ./src/libsablevm/include/jni_system_specific.h --- ../tmp-orig/sablevm-1.1.3/src/libsablevm/include/jni_system_specific.h 2004-04-12 20:29:07.000000000 +0000 +++ ./src/libsablevm/include/jni_system_specific.h 2004-05-01 20:42:28.402644600 +0000 @@ -20,6 +20,7 @@ || defined (__i386__) || defined (__powerpc__) || defined (__s390__) \ || defined (__hppa__) || defined (__arm__) || defined (__m68k__) \ || defined (__mc68000__) || defined (__mips__) || defined (__mipsel__) \ + || defined (__x86_64__) \ ) && defined (__GNUC__)) #define JNICALL diff -urN ../tmp-orig/sablevm-1.1.3/src/libsablevm/system.c ./src/libsablevm/system.c --- ../tmp-orig/sablevm-1.1.3/src/libsablevm/system.c 2004-04-12 20:29:08.000000000 +0000 +++ ./src/libsablevm/system.c 2004-05-01 20:54:17.985771568 +0000 @@ -18,6 +18,7 @@ || defined (__i386__) || defined (__powerpc__) || defined (__s390__) \ || defined (__hppa__) || defined (__arm__) || defined (__m68k__) \ || defined (__mc68000__) || defined (__mips__) || defined (__mipsel__) \ + || defined (__x86_64__) \ ) && defined (__GNUC__)) /* @@ -346,6 +347,20 @@ : "memory"); /* *INDENT-ON* */ +#elif defined (__x86_64__) + + _svmt_word current_value; + _svmt_u8 result; + +/* *INDENT-OFF* */ + __asm__ __volatile__ ("lock\n\t" + "cmpxchgq %3, %1\n\t" + "sete %0" + :"=q" (result), "=m" (*pword), "=a" (current_value) + :"r" (new_value), "m" (*pword), "a" (old_value) + :"memory"); +/* *INDENT-ON* */ + #else #error "SableVM is not prepared to run on this kind of a system; no atomic compare&swap defined." #endif diff -urN ../tmp-orig/sablevm-1.1.3/src/libsablevm/system.h ./src/libsablevm/system.h --- ../tmp-orig/sablevm-1.1.3/src/libsablevm/system.h 2004-04-12 20:29:08.000000000 +0000 +++ ./src/libsablevm/system.h 2004-05-01 20:53:12.493727872 +0000 @@ -54,6 +54,7 @@ || defined (__i386__) || defined (__powerpc__) || defined (__s390__) \ || defined (__hppa__) || defined (__arm__) || defined (__m68k__) \ || defined (__mc68000__) || defined (__mips__) || defined (__mipsel__) \ + || defined (__x86_64__) \ ) && defined (__GNUC__)) /* "inline" is now an official keyword since the latest C standard (1999). @@ -231,6 +232,25 @@ /* #include <inlined_i386-gcc-2.95.h> */ +#elif defined (__x86_64__) + +typedef _svmt_u64 _svmt_word; +typedef _svmt_d64 _svmt_float_word; + +#define SVM_WORD_SIZE 8 /* size in bytes */ +#define SVM_WORD_BIT_COUNT 64 /* size in bits */ + +/* see comments at the head of this file */ +#define SVM_ALIGNMENT 8 +#define SVM_ALIGNMENT_POWER 3 /* 2 ^^ SVM_ALIGNMENT_POWER == SVM_ALIGNMENT */ +#define SVM_PAGE_SIZE 4096 + +#if (GCC_VERSION >= 2095) && (GCC_VERSION <3000) +#include <inlined_i386-gcc-2.95.h> +#else +#include <inlined_i386-gcc-3.3.h> +#endif /* (GCC_VERSION >= 2095) && (GCC_VERSION <3000) */ + #else #error "unknown system" #endif |
From: Grzegorz B. P. <ga...@de...> - 2004-05-02 01:38:10
|
On (02/05/04 00:19), Andreas Jochens wrote: > tags 245834 + patch > > On 04-Apr-25 19:42, Kurt Roeckx wrote: > > It currently doesn't seem to have support for amd64. Adding > > support for it seems mostly adding || defined(__x86_64__) where > > __i386__ is used, except for system.h where the word/allignment > > needs to be chagned from 32bit/4byte to 64bit/8byte. > > > > I just don't know enough assembler/hardware details for the > > things in system.c > > The attached patch seems to work for me. > Thanks. Just one thing: are we talking about x86-64 in 64bit mode? If yes, then did you have any other problems w/ porting? If no, then what would be needed to make the 64bit port? ex. is there libffi for x86-64 in 64bit mode? GBP PS: And how do I distinguish between x86-64 in 32 and 64bit mode from within C program source? -- Grzegorz B. Prokopski <ga...@de...> Debian GNU/Linux http://www.debian.org SableVM - LGPLed JVM http://www.sablevm.org Why SableVM ?!? http://devel.sablevm.org/wiki/WhySableVM |
From: Andreas J. <aj...@an...> - 2004-05-02 07:38:11
|
On 04-May-01 21:17, Grzegorz B. Prokopski wrote: > Just one thing: are we talking about x86-64 in 64bit mode? Yes, we are talking about x86_64 in 64bit native mode. > If yes, then did you have any other problems w/ porting? I needed a small patch to build the sablevm-classlib package for the amd64 architecture (see below). A few other packages needed similar small patches. I did not find any serious obstacles for a x86_64 native 64bit port. > If no, then what would be needed to make the 64bit port? > ex. is there libffi for x86-64 in 64bit mode? There is an almost complete port of the Debian system to x86_64 in native 64bit mode (including a libffi). However, there is no 'official' archive for this port yet. I hope this will change soon. Regards Andreas Jochens diff -urN ../tmp-orig/sablevm-classlib-1.1.3/native/fdlibm/ieeefp.h ./native/fdlibm/ieeefp.h --- ../tmp-orig/sablevm-classlib-1.1.3/native/fdlibm/ieeefp.h 2004-04-12 20:33:25.000000000 +0000 +++ ./native/fdlibm/ieeefp.h 2004-05-01 22:05:54.104662224 +0000 @@ -59,6 +59,10 @@ #define __IEEE_LITTLE_ENDIAN #endif +#ifdef __x86_64__ +#define __IEEE_LITTLE_ENDIAN +#endif + #ifdef __i960__ #define __IEEE_LITTLE_ENDIAN #endif |