Thread: [Jamvm-general] Data Alignment of a double precision float
Brought to you by:
rlougher
From: Donald G. <don...@gm...> - 2008-12-11 18:31:17
|
Hello, I'm working on a MIPS SoC with the floating-point coprocessor. It requires an 8-byte aligned address to access to 'double' data. Jamvm includes codes which try to access 'double' data without 8-byte-aligned addresses. They cause 'Bus Error' on the SoC. How could I work around it. Thanks, ddgim |
From: Robert L. <rob...@gm...> - 2008-12-11 19:32:42
|
Hi Donald, 2008/12/11 Donald Gim <don...@gm...>: > Hello, > > I'm working on a MIPS SoC with the floating-point coprocessor. > It requires an 8-byte aligned address to access to 'double' data. > Jamvm includes codes which try to access 'double' data without > 8-byte-aligned addresses. > They cause 'Bus Error' on the SoC. > How could I work around it. > Try the latest development version from CVS. Instructions to get it are here: http://developer.berlios.de/cvs/?group_id=6545 There's been quite a bit of alignment work since 1.5.1, and doubles should now always be 8-byte aligned. However, I can't guarantee it will work, as I don't have a machine which requires it... Rob. > Thanks, > ddgim > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Jamvm-general mailing list > Jam...@li... > https://lists.sourceforge.net/lists/listinfo/jamvm-general > |
From: Robert L. <rob...@gm...> - 2008-12-11 19:53:52
|
P.S. When using source from CVS, you need to run autogen.sh (in the top level) to generate all the configure stuff. You can give your configure arguments to autogen.sh, which will run configure for you, once all the autconf/automake/libtool stuff has been done. Rob. 2008/12/11 Robert Lougher <rob...@gm...>: > Hi Donald, > > 2008/12/11 Donald Gim <don...@gm...>: >> Hello, >> >> I'm working on a MIPS SoC with the floating-point coprocessor. >> It requires an 8-byte aligned address to access to 'double' data. >> Jamvm includes codes which try to access 'double' data without >> 8-byte-aligned addresses. >> They cause 'Bus Error' on the SoC. >> How could I work around it. >> > > Try the latest development version from CVS. Instructions to get it are here: > > http://developer.berlios.de/cvs/?group_id=6545 > > There's been quite a bit of alignment work since 1.5.1, and doubles > should now always be 8-byte aligned. However, I can't guarantee it > will work, as I don't have a machine which requires it... > > Rob. > >> Thanks, >> ddgim >> >> ------------------------------------------------------------------------------ >> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. >> The future of the web can't happen without you. Join us at MIX09 to help >> pave the way to the Next Web now. Learn more and register at >> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ >> _______________________________________________ >> Jamvm-general mailing list >> Jam...@li... >> https://lists.sourceforge.net/lists/listinfo/jamvm-general >> > |
From: Donald G. <don...@gm...> - 2008-12-12 14:37:54
|
Thank you for your reply. I tried the recent Jamvm with the recent Classpath CVS version. I still got the Bus Error from the 'double' data alignment. The following code is from src/jni:798. This has the possibility of causing the alignment exception if 'native_type' is 'double'. Actually I ran into the issue at this part. #define GET_STATIC_FIELD(type, native_type) \ native_type Jam_GetStatic##type##Field(JNIEnv *env, jclass clazz, jfieldID fieldID) { \ FieldBlock *fb = (FieldBlock *) fieldID; \ return *(native_type *)&fb->static_value; \ } So I did a little tweak on the FieldBlock structure like below. And I could avoid the SIGBUS at this part. But I still got the Bus Error messages from other places. Should I continue tracing the source? The case below may be simple. But I guess there could be codes which are difficult to modify structurally. Please give me any hints... thanks, ddgim 512 typedef struct fieldblock { 513 double dummy_align; <=== added 514 Class *class; 515 char *name; 516 char *type; 517 char *signature; 518 u2 access_flags; 519 u2 constant; 520 int dummy_pad; <=== added 521 uintptr_t static_value; 522 u4 offset; 523 AnnotationData *annotations; 524 } FieldBlock; 2008/12/12, Robert Lougher <rob...@gm...>: > P.S. When using source from CVS, you need to run autogen.sh (in the > top level) to generate all the configure stuff. You can give your > configure arguments to autogen.sh, which will run configure for you, > once all the autconf/automake/libtool stuff has been done. > > Rob. > > 2008/12/11 Robert Lougher <rob...@gm...>: >> Hi Donald, >> >> 2008/12/11 Donald Gim <don...@gm...>: >>> Hello, >>> >>> I'm working on a MIPS SoC with the floating-point coprocessor. >>> It requires an 8-byte aligned address to access to 'double' data. >>> Jamvm includes codes which try to access 'double' data without >>> 8-byte-aligned addresses. >>> They cause 'Bus Error' on the SoC. >>> How could I work around it. >>> >> >> Try the latest development version from CVS. Instructions to get it are >> here: >> >> http://developer.berlios.de/cvs/?group_id=6545 >> >> There's been quite a bit of alignment work since 1.5.1, and doubles >> should now always be 8-byte aligned. However, I can't guarantee it >> will work, as I don't have a machine which requires it... >> >> Rob. >> >>> Thanks, >>> ddgim >>> >>> ------------------------------------------------------------------------------ >>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, >>> Nevada. >>> The future of the web can't happen without you. Join us at MIX09 to help >>> pave the way to the Next Web now. Learn more and register at >>> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ >>> _______________________________________________ >>> Jamvm-general mailing list >>> Jam...@li... >>> https://lists.sourceforge.net/lists/listinfo/jamvm-general >>> >> > |
From: Robert L. <rob...@gm...> - 2008-12-12 18:09:14
|
Hi Donald, Yes, there may be other more subtle ones lurking in the code. I'm quite keen to fix the "8-byte aligned double" issues once and for all. I've actually realised I do have a machine -- an old UltraSparc IIi -- although it's 64-bit, Ubuntu has a 32-bit userland (the problem only occurs on 32-bit machines) but I need to port JamVM to Sparc first. Alternatively, is it possible to provide a login onto your MIPS box? Rob. but it's difficult without a machine that requires it. 2008/12/12 Donald Gim <don...@gm...>: > Thank you for your reply. > > I tried the recent Jamvm with the recent Classpath CVS version. > I still got the Bus Error from the 'double' data alignment. > > The following code is from src/jni:798. > This has the possibility of causing the alignment exception if > 'native_type' is 'double'. > Actually I ran into the issue at this part. > > #define GET_STATIC_FIELD(type, native_type) \ > native_type Jam_GetStatic##type##Field(JNIEnv *env, jclass clazz, > jfieldID fieldID) { \ > FieldBlock *fb = (FieldBlock *) fieldID; \ > return *(native_type *)&fb->static_value; \ > } > > So I did a little tweak on the FieldBlock structure like below. > And I could avoid the SIGBUS at this part. > But I still got the Bus Error messages from other places. > Should I continue tracing the source? > The case below may be simple. But I guess there could be codes which > are difficult to modify structurally. > Please give me any hints... > > thanks, > ddgim > > 512 typedef struct fieldblock { > 513 double dummy_align; <=== added > 514 Class *class; > 515 char *name; > 516 char *type; > 517 char *signature; > 518 u2 access_flags; > 519 u2 constant; > 520 int dummy_pad; <=== added > 521 uintptr_t static_value; > 522 u4 offset; > 523 AnnotationData *annotations; > 524 } FieldBlock; > > > 2008/12/12, Robert Lougher <rob...@gm...>: >> P.S. When using source from CVS, you need to run autogen.sh (in the >> top level) to generate all the configure stuff. You can give your >> configure arguments to autogen.sh, which will run configure for you, >> once all the autconf/automake/libtool stuff has been done. >> >> Rob. >> >> 2008/12/11 Robert Lougher <rob...@gm...>: >>> Hi Donald, >>> >>> 2008/12/11 Donald Gim <don...@gm...>: >>>> Hello, >>>> >>>> I'm working on a MIPS SoC with the floating-point coprocessor. >>>> It requires an 8-byte aligned address to access to 'double' data. >>>> Jamvm includes codes which try to access 'double' data without >>>> 8-byte-aligned addresses. >>>> They cause 'Bus Error' on the SoC. >>>> How could I work around it. >>>> >>> >>> Try the latest development version from CVS. Instructions to get it are >>> here: >>> >>> http://developer.berlios.de/cvs/?group_id=6545 >>> >>> There's been quite a bit of alignment work since 1.5.1, and doubles >>> should now always be 8-byte aligned. However, I can't guarantee it >>> will work, as I don't have a machine which requires it... >>> >>> Rob. >>> >>>> Thanks, >>>> ddgim >>>> >>>> ------------------------------------------------------------------------------ >>>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, >>>> Nevada. >>>> The future of the web can't happen without you. Join us at MIX09 to help >>>> pave the way to the Next Web now. Learn more and register at >>>> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ >>>> _______________________________________________ >>>> Jamvm-general mailing list >>>> Jam...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jamvm-general >>>> >>> >> > |
From: Zubair A. K. <zk...@d2...> - 2008-12-12 21:08:13
|
Hi Rob We are using JamVM on our Linux platforms. If you remember, we did some study to find JamVM is the best interpreter on small hand held devices in terms of size, speed, portability, collection. We are happy with our choice and sticking to it. We are looking for port to Windows CE. Any suggestions from anyone ? Thanks Zubair Khan D2 Technologies |
From: Robert L. <rob...@gm...> - 2008-12-12 22:03:17
|
Hi Zubair, 2008/12/12 Zubair Ali Khan <zk...@d2...>: > Hi Rob > We are using JamVM on our Linux platforms. If you remember, we did some > study to find JamVM is the best interpreter on small hand held devices in > terms of size, speed, portability, collection. We are happy with our choice > and sticking to it. Yes, of course I remember! I'm very glad you're still happy with JamVM (the next release should be even better). > We are looking for port to Windows CE. Any suggestions from anyone ? A port would not be hugely difficult, but not trivial either. The most difficult aspect would be the threading, as JamVM depends on posix threads (this is assuming there is no posix layer for Windows CE). Ordinarily, I would have no interest in porting JamVM to Windows CE (at the minimum I would need a Windows CE machine, and probably Windows for development -- I have neither). However, I am euphemistically between jobs. Would you be in theory interested in sponsoring a port? Rob. > Thanks > Zubair Khan > D2 Technologies > |
From: Donald G. <don...@gm...> - 2009-03-06 12:55:32
|
Hi Rob, We tested JamVM 1.5.2 on our MIPS box. But it seems that we still have the trouble on 8-byte-unaligned double data. It could not be from your JVM. If you're still interested in any testing on the MIPS box, we're ready to provide a login onto our development server. You can access to the MIPS box from the server. Donald 2008/12/13 Robert Lougher <rob...@gm...> > Hi Donald, > > Yes, there may be other more subtle ones lurking in the code. I'm > quite keen to fix the "8-byte aligned double" issues once and for all. > I've actually realised I do have a machine -- an old UltraSparc IIi > -- although it's 64-bit, Ubuntu has a 32-bit userland (the problem > only occurs on 32-bit machines) but I need to port JamVM to Sparc > first. Alternatively, is it possible to provide a login onto your > MIPS box? > > Rob. > > but it's difficult without a machine that requires it. > > 2008/12/12 Donald Gim <don...@gm...>: > > Thank you for your reply. > > > > I tried the recent Jamvm with the recent Classpath CVS version. > > I still got the Bus Error from the 'double' data alignment. > > > > The following code is from src/jni:798. > > This has the possibility of causing the alignment exception if > > 'native_type' is 'double'. > > Actually I ran into the issue at this part. > > > > #define GET_STATIC_FIELD(type, native_type) \ > > native_type Jam_GetStatic##type##Field(JNIEnv *env, jclass clazz, > > jfieldID fieldID) { \ > > FieldBlock *fb = (FieldBlock *) fieldID; \ > > return *(native_type *)&fb->static_value; \ > > } > > > > So I did a little tweak on the FieldBlock structure like below. > > And I could avoid the SIGBUS at this part. > > But I still got the Bus Error messages from other places. > > Should I continue tracing the source? > > The case below may be simple. But I guess there could be codes which > > are difficult to modify structurally. > > Please give me any hints... > > > > thanks, > > ddgim > > > > 512 typedef struct fieldblock { > > 513 double dummy_align; <=== added > > 514 Class *class; > > 515 char *name; > > 516 char *type; > > 517 char *signature; > > 518 u2 access_flags; > > 519 u2 constant; > > 520 int dummy_pad; <=== added > > 521 uintptr_t static_value; > > 522 u4 offset; > > 523 AnnotationData *annotations; > > 524 } FieldBlock; > > > > > > 2008/12/12, Robert Lougher <rob...@gm...>: > >> P.S. When using source from CVS, you need to run autogen.sh (in the > >> top level) to generate all the configure stuff. You can give your > >> configure arguments to autogen.sh, which will run configure for you, > >> once all the autconf/automake/libtool stuff has been done. > >> > >> Rob. > >> > >> 2008/12/11 Robert Lougher <rob...@gm...>: > >>> Hi Donald, > >>> > >>> 2008/12/11 Donald Gim <don...@gm...>: > >>>> Hello, > >>>> > >>>> I'm working on a MIPS SoC with the floating-point coprocessor. > >>>> It requires an 8-byte aligned address to access to 'double' data. > >>>> Jamvm includes codes which try to access 'double' data without > >>>> 8-byte-aligned addresses. > >>>> They cause 'Bus Error' on the SoC. > >>>> How could I work around it. > >>>> > >>> > >>> Try the latest development version from CVS. Instructions to get it > are > >>> here: > >>> > >>> http://developer.berlios.de/cvs/?group_id=6545 > >>> > >>> There's been quite a bit of alignment work since 1.5.1, and doubles > >>> should now always be 8-byte aligned. However, I can't guarantee it > >>> will work, as I don't have a machine which requires it... > >>> > >>> Rob. > >>> > >>>> Thanks, > >>>> ddgim > >>>> > >>>> > ------------------------------------------------------------------------------ > >>>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, > >>>> Nevada. > >>>> The future of the web can't happen without you. Join us at MIX09 to > help > >>>> pave the way to the Next Web now. Learn more and register at > >>>> > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > >>>> _______________________________________________ > >>>> Jamvm-general mailing list > >>>> Jam...@li... > >>>> https://lists.sourceforge.net/lists/listinfo/jamvm-general > >>>> > >>> > >> > > > |
From: Robert L. <rob...@gm...> - 2009-03-06 14:39:50
|
Hi Donald, Yes, you can provide the login details. However, I can't promise when or how much time I will be able to spend on it, as I've started a new job, and currently have very little free time :( Rob. 2009/3/6 Donald Gim <don...@gm...>: > Hi Rob, > > We tested JamVM 1.5.2 on our MIPS box. > But it seems that we still have the trouble on 8-byte-unaligned double data. > It could not be from your JVM. > If you're still interested in any testing on the MIPS box, > we're ready to provide a login onto our development server. > You can access to the MIPS box from the server. > > Donald > > 2008/12/13 Robert Lougher <rob...@gm...> > - Show quoted text - >> >> Hi Donald, >> >> Yes, there may be other more subtle ones lurking in the code. I'm >> quite keen to fix the "8-byte aligned double" issues once and for all. >> I've actually realised I do have a machine -- an old UltraSparc IIi >> -- although it's 64-bit, Ubuntu has a 32-bit userland (the problem >> only occurs on 32-bit machines) but I need to port JamVM to Sparc >> first. Alternatively, is it possible to provide a login onto your >> MIPS box? >> >> Rob. >> >> but it's difficult without a machine that requires it. >> >> 2008/12/12 Donald Gim <don...@gm...>: >> > Thank you for your reply. >> > >> > I tried the recent Jamvm with the recent Classpath CVS version. >> > I still got the Bus Error from the 'double' data alignment. >> > >> > The following code is from src/jni:798. >> > This has the possibility of causing the alignment exception if >> > 'native_type' is 'double'. >> > Actually I ran into the issue at this part. >> > >> > #define GET_STATIC_FIELD(type, native_type) \ >> > native_type Jam_GetStatic##type##Field(JNIEnv *env, jclass clazz, >> > jfieldID fieldID) { \ >> > FieldBlock *fb = (FieldBlock *) fieldID; \ >> > return *(native_type *)&fb->static_value; \ >> > } >> > >> > So I did a little tweak on the FieldBlock structure like below. >> > And I could avoid the SIGBUS at this part. >> > But I still got the Bus Error messages from other places. >> > Should I continue tracing the source? >> > The case below may be simple. But I guess there could be codes which >> > are difficult to modify structurally. >> > Please give me any hints... >> > >> > thanks, >> > ddgim >> > >> > 512 typedef struct fieldblock { >> > 513 double dummy_align; <=== added >> > 514 Class *class; >> > 515 char *name; >> > 516 char *type; >> > 517 char *signature; >> > 518 u2 access_flags; >> > 519 u2 constant; >> > 520 int dummy_pad; <=== added >> > 521 uintptr_t static_value; >> > 522 u4 offset; >> > 523 AnnotationData *annotations; >> > 524 } FieldBlock; >> > >> > >> > 2008/12/12, Robert Lougher <rob...@gm...>: >> >> P.S. When using source from CVS, you need to run autogen.sh (in the >> >> top level) to generate all the configure stuff. You can give your >> >> configure arguments to autogen.sh, which will run configure for you, >> >> once all the autconf/automake/libtool stuff has been done. >> >> >> >> Rob. >> >> >> >> 2008/12/11 Robert Lougher <rob...@gm...>: >> >>> Hi Donald, >> >>> >> >>> 2008/12/11 Donald Gim <don...@gm...>: >> >>>> Hello, >> >>>> >> >>>> I'm working on a MIPS SoC with the floating-point coprocessor. >> >>>> It requires an 8-byte aligned address to access to 'double' data. >> >>>> Jamvm includes codes which try to access 'double' data without >> >>>> 8-byte-aligned addresses. >> >>>> They cause 'Bus Error' on the SoC. >> >>>> How could I work around it. >> >>>> >> >>> >> >>> Try the latest development version from CVS. Instructions to get it >> >>> are >> >>> here: >> >>> >> >>> http://developer.berlios.de/cvs/?group_id=6545 >> >>> >> >>> There's been quite a bit of alignment work since 1.5.1, and doubles >> >>> should now always be 8-byte aligned. However, I can't guarantee it >> >>> will work, as I don't have a machine which requires it... >> >>> >> >>> Rob. >> >>> >> >>>> Thanks, >> >>>> ddgim >> >>>> >> >>>> >> >>>> ------------------------------------------------------------------------------ >> >>>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, >> >>>> Nevada. >> >>>> The future of the web can't happen without you. Join us at MIX09 to >> >>>> help >> >>>> pave the way to the Next Web now. Learn more and register at >> >>>> >> >>>> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ >> >>>> _______________________________________________ >> >>>> Jamvm-general mailing list >> >>>> Jam...@li... >> >>>> https://lists.sourceforge.net/lists/listinfo/jamvm-general >> >>>> >> >>> >> >> >> > > > |