[Nexus-developers] NeXus-64 bit

Akeroyd, FA (Freddie) F.A.Akeroyd at rl.ac.uk
Thu Aug 23 15:47:20 BST 2007


Hi Mark,

Autoconf provides the AC_TYPE_INT64_T and AC_TYPE_UINT64_T macros that
we can use; they will defined int64_t and uint64_t types appropriate for
the system if there is no C99 <stdint.h> header file available to
provide them instead. I'm happy to do this bit if you want to commit
what you have.

Freddie

-----Original Message-----
From: nexus-developers-bounces at nexusformat.org
[mailto:nexus-developers-bounces at nexusformat.org] On Behalf Of Mark
Koennecke
Sent: 23 August 2007 15:10
To: nexus-developers at nexusformat.org
Subject: [Nexus-developers] NeXus-64 bit

Hi everyone,

I now got 64 bit integers working for NeXus for HDF-5 and XML. It 
required changes to  several
bindings too. And we are entering a ball of mud:

Contrary to my  expectations I had to notice that a long on an Intel-PC 
is 32bit only and not 64bit.
On an alpha a long is sufficient to get a 64 bit integer.  It would be 
interesting to test this on a
64-bit Intel, but I have none available. In order to get a 64 bit 
integer on 32 bit Intel you need a
long long type. But long long is C99 standard. As this is not yet 50 
years old, there might be
platforms/compilers out there which cannot do this. Well, I worked 
around this. Partially I
used tests for sizeof(long) in order to get the right thing done. But I 
also had to create a new
define, NX64INT, which must be initailized to the correct number type on

the current platform.
I currently have some logic in napi.h to do this, but this could also be

done by a compiler
option automatically determined by the configure script.

The question I want answered before I commit this is:
- The 64 bit integers  introduces platform problems. Do we still want
this?

As an aggravating factor I extended napi_test.c and thus all the 
automatic tests "fail" now.
Sorry, Freddie.  I also  fixed the #16 issue with \0 terminated strings 
in XML. 
Given the complications stated above and the fact that I am not 
convinced that Freddies
suggestion would solve the 64 bit byte order issue, there is no support 
for 64 bit ints in
HDF-4 as of now. It would anyway be ugly, because we would need to 
annotate HDF-4 pseudo
64 bit 32 bit datasets in some way to distinguish them.  Freddie 
suggested some tricky stuff with
bit shifting but I believe the difference between BE and LE is in which 
direction to shift in order
to get the low bytes out.

             What do you think?

                            Mark
 

_______________________________________________
NeXus-developers mailing list
NeXus-developers at nexusformat.org
http://lists.nexusformat.org/mailman/listinfo/nexus-developers



More information about the NeXus-developers mailing list