[Sablevm-developer] Porting SableVM to ia64 done in 3 (lazy) hours
Brought to you by:
egagnon
From: Grzegorz P. <gr...@se...> - 2002-10-11 18:33:18
|
Hi! Just wanted you to know, that "ia64" has been just added to the list of architectures supported by SableVM JVM, next to i386 and alpha. Thanks to Martin Schulze <jo...@in...> who installed build deps on merulo.d.o and thanks to Bdale Garbee <bd...@ga...> who asissted the port and installed the packages right after they were ready. "HelloWorld!" app started since the first kick. The diff is below, at the end of this amil I also inlined very simple&small c app that helps a bit w/ porting. It may be not so bad idea to have it in the sources. Maybe it's time for new release? ;-) Best regards Grzegorz B. Prokopski --- ./sablevm-1.0.4/src/libsablevm/include/jni_system_specific.h 2002-08-14 23:29:54.000000000 -0600 +++ ./sablevm-1.0.4-new/src/libsablevm/include/jni_system_specific.h 2002-10-11 08:49:24.000000000 -0600 @@ -15,7 +15,7 @@ /* ia64, alpha and i386 are identical here */ -#if ((defined (__alpha__) || defined (__i386__)) && defined (__GNUC__)) +#if ((defined (__ia64__) || defined (__alpha__) || defined (__i386__)) && defined (__GNUC__)) #define JNICALL #define JNIEXPORT @@ -38,3 +38,4 @@ #endif #endif /* NOT SVM_JNI_SYSTEM_SPECIFIC_H */ + --- ./sablevm-1.0.4/src/libsablevm/system.c 2002-08-18 23:16:06.000000000 -0600 +++ ./sablevm-1.0.4-new/src/libsablevm/system.c 2002-10-11 10:53:09.000000000 -0600 @@ -5,7 +5,7 @@ * modification of SableVM. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#if ((defined (__alpha__) || defined (__i386__)) && defined (__GNUC__)) +#if ((defined (__ia64__) || defined (__alpha__) || defined (__i386__)) && defined (__GNUC__)) /* ---------------------------------------------------------------------- @@ -28,6 +28,8 @@ #elif defined(__i386__) /* do nothing */ +#elif defined(__ia64__) + /* do nothing */ #else #error #endif @@ -99,6 +101,15 @@ /* *INDENT-ON* */ #endif +#if (defined (__ia64__)) +#include <ia64intrin.h> + + jboolean result; + + result = __sync_bool_compare_and_swap (pword, old_value, new_value); + +#endif + return result ? JNI_TRUE : JNI_FALSE; } --- ./sablevm-1.0.4/src/libsablevm/system.h 2002-08-14 23:29:54.000000000 -0600 +++ ./sablevm-1.0.4-new/src/libsablevm/system.h 2002-10-11 09:25:47.000000000 -0600 @@ -48,7 +48,7 @@ */ -#if ((defined (__alpha__) || defined (__i386__)) && defined (__GNUC__)) +#if ((defined (__ia64__) || defined (__alpha__) || defined (__i386__)) && defined (__GNUC__)) /* "inline" is now an official keyword since the latest C standard (1999). So, it is a reasonable assuption to expect a target compiler to @@ -88,6 +88,18 @@ #define SVM_ALIGNMENT_POWER 3 /* 2 ^^ SVM_ALIGNMENT_POWER == SVM_ALIGNMENT */ #define SVM_PAGE_SIZE 8192 +#elif defined (__ia64__) + +typedef _svmt_u64 _svmt_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 16384 + #endif /* FFI specific types */ The helper program is this: gadek@merulo:~/sablevm/tests$ cat ./typesizes.c #include <unistd.h> int main(void) { int i; printf("Size of char is %i\n", sizeof(char)); printf("Size of short is %i\n", sizeof(unsigned short)); printf("Size of int is %i\n", sizeof(int)); printf("Size of long int is %i\n", sizeof(long int)); printf("Size of long long int is %i\n", sizeof(long long int)); printf("Size of float is %i\n", sizeof(float)); printf("Size of double is %i\n", sizeof(double)); printf("Size of void* is %i\n", sizeof(void*)); i = getpagesize(); printf("Size of page is %i\n", i); return 0; } |