[prev in list] [next in list] [prev in thread] [next in thread]
List: rrd-developers
Subject: Re: [rrd-developers] portable structs ... more testes
From: Andreas Maus <a.maus () science-computing ! de>
Date: 2007-06-26 8:02:25
Message-ID: 20070626080225.GJ26796 () tigger ! science-computing ! de
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Tue, Jun 26, 2007 at 08:24:24AM +0200, Tobias Oetiker wrote:
> Hi RRDdevelopers,
>
> I have done some more portability tests. this time with struct
> alignement.
>
> have a look at
>
> http://oss.oetiker.ch/rrdtool-trac/wiki/PortableRrdFormat
>
> so it seems that if the structs are layed out properly the memory
> layout is the same at least on intel/linux and sparc/solaris architectures.
>
> additional input from other architectures is highly appreciated.
Hi Tobi.
Here we go:
- MIPS:
maus@octane ~ $ hinv -c processor
1 300 MHZ IP30 Processor
CPU: MIPS R12000 Processor Chip Revision: 2.3
FPU: MIPS R12010 Floating Point Chip Revision: 0.0
maus@octane ~ $ cc -v
MIPSpro Compilers: Version 7.4
maus@octane ~ $ cc -o align ./align.c
maus@octane ~ $ ./align
struct test non-aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
struct test aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 07 5b cd 15
5b 26 43 5e 95 46 ee 81
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
Same with gcc:
maus@octane ~ $ gcc -v
Reading specs from /usr/local/gcc-2.95.3/lib/gcc-lib/mips-sgi-irix6.5/2.95.3/specs
gcc version 2.95.3 20010315 (release)
maus@octane ~ $ gcc -o align align.c
maus@octane ~ $ ./align
struct test non-aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
struct test aligned:
30 31 32 00 88 88 88 88 fing
07 5b cd 15 07 5b cd 15
5b 26 43 5e 95 46 ee 81
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
- Itanium2 IA64:
maus@itanium ~ $ cc -V
(Bundled) cc: HP aC++/ANSI C B3910B A.05.50 [May 15 2003]
maus@itanium ~ $ cc -o align align.c
maus@itanium ~ $ ./align
struct test non-aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
struct test aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 07 5b cd 15
5b 26 43 5e 95 46 ee 81
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
and with gcc:
maus@itanium ~ $ gcc -v
Reading specs from /usr/local/gcc-3.3.4/lib/gcc-lib/ia64-hp-hpux11.22/3.3.4/specs
Configured with: /soft/gcc/gcc-3.3.4/gcc-3.3.4/configure \
--prefix=/usr/local/gcc-3.3.4 --with-included-gettext --enable-shared \
--enable-languages=c,c++,f77 --with-gnu-as --enable-libunwind-exceptions Thread \
model: single gcc version 3.3.4
maus@itanium ~ $ gcc -o align align.c
maus@itanium ~ $ ./align
struct test non-aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
struct test aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 07 5b cd 15
5b 26 43 5e 95 46 ee 81
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
- PA-RISC 64bit:
maus@parisc64 ~ $ gcc -v
Reading specs from /usr/local/gcc-3.3.4/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.4/specs
Configured with: /soft/gcc/gcc-3.3.4/gcc-3.3.4/configure \
--prefix=/usr/local/gcc-3.3.4 --with-included-gettext --enable-shared \
--enable-languages=c,c++,f77 --with-gnu-as Thread model: single
gcc version 3.3.4
maus@parisc64 ~ $ gcc -o align align.c
maus@parisc64 ~ $ ./align
struct test non-aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
07 5b cd 15 88 88 88 88
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
struct test aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 07 5b cd 15
5b 26 43 5e 95 46 ee 81
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
- PowerPC 64 Bit:
[... snipp ...]
Processor Type: PowerPC_POWER5
Number Of Processors: 2
Processor Clock Speed: 1648 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
[... snipp ...]
maus@aix53 ~ $ /usr/local/gcc-3.3.4/bin/gcc -v
Reading specs from /usr/local/gcc-3.3.4/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.4/specs
Configured with: /soft/gcc/gcc-3.3.4/gcc-3.3.4/configure \
--prefix=/usr/local/gcc-3.3.4 --with-included-gettext --enable-shared \
--enable-languages=c,c++,f77 -with-cpu-common --disable-multilib Thread model: aix
gcc version 3.3.4
maus@aix53 ~ $ /usr/local/gcc-3.3.4/bin/gcc -o align align.c
maus@aix53 ~ $ ./align
struct test non-aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 5b 26 43 5e
95 46 ee 81 07 5b cd 15
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
struct test aligned:
30 31 32 00 88 88 88 88
07 5b cd 15 07 5b cd 15
5b 26 43 5e 95 46 ee 81
5b 26 43 5e 95 46 ee 81
00 00 00 00 07 5b cd 15
00 00 00 01 88 88 88 88
HTH,
Andreas.
--
Dipl.-Ing. Andreas Maus science+computing ag
System Administration Hagellocher Weg 73
mail: a.maus@science-computing.de 72070 Tuebingen, Germany
tel.: +49 7071 9457 671 www.science-computing.de
[Attachment #5 (application/pgp-signature)]
_______________________________________________
rrd-developers mailing list
rrd-developers@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic