[fc-arch] Beautify the arch template

This commit is contained in:
Behdad Esfahbod 2009-11-18 14:08:00 -05:00
parent d074706b50
commit d5ebf48e34
2 changed files with 39 additions and 13 deletions

View File

@ -24,8 +24,8 @@
#include "fcint.h"
#include <ctype.h>
#define ENDIAN_TEST 0x12345678
#define MACHINE_SIGNATURE_SIZE (9*23 + 1)
#define ENDIAN_TEST 0x01020304
#define MACHINE_SIGNATURE_SIZE 1024
static char *
FcCacheMachineSignature (void)
@ -34,9 +34,9 @@ FcCacheMachineSignature (void)
int32_t magic = ENDIAN_TEST;
char * m = (char *)&magic;
sprintf (buf, "%2x%2x%2x%2x_"
"%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_"
"%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x",
sprintf (buf, "%01x%01x%01x%01x_"
"%02x_%02x_%02x_%02x_%02x_%02x_%02x_%02x_%02x_%02x_%02x_%02x_"
"%02x_%02x_%02x_%02x_%02x_%02x_%02x_%02x_%02x_%02x",
m[0], m[1], m[2], m[3],
(unsigned int)sizeof (FcAlign),
(unsigned int)sizeof (char),

View File

@ -28,11 +28,37 @@
@@@ name. Architecture names are used to construct file names, so
@@@ use something reasonable and don't include any spaces
@@@
@@@ name endian FcAlign char char* int intptr_t Pattern EltPtr Elt * Elt ObjPtr VLPtr Value Binding VL * StrSet * CharSet Leaf** Char16 * Char16 Leaf Char32 Cache
x86 78563412_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_0000000c_00000004_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020
x86-64 78563412_00000008_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000038
ppc 12345678_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_00000010_00000004_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020
ppc64 12345678_00000008_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000038
m68k 12345678_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_0000000c_00000004_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020
mipsel 78563412_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_00000010_00000004_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020
sparc64 12345678_00000008_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000038
@@@ So far the differences boil down to: endianness, 32 vs 64 bit, and on
@@@ 32bit archs, whether double is aligned to one word or two words.
@@@
@@@ ,name
@@@ | ,endian
@@@ | | ,FcAlign
@@@ | | | ,char
@@@ | | | | ,char*
@@@ | | | | | ,int
@@@ | | | | | | ,intptr_t
@@@ | | | | | | | ,Pattern
@@@ | | | | | | | | ,EltPtr
@@@ | | | | | | | | | ,Elt *
@@@ | | | | | | | | | | ,Elt
@@@ | | | | | | | | | | | ,ObjPtr
@@@ | | | | | | | | | | | | ,ValueListPtr
@@@ | | | | | | | | | | | | | ,Value
@@@ | | | | | | | | | | | | | | ,ValueBinding
@@@ | | | | | | | | | | | | | | | ,ValueList *
@@@ | | | | | | | | | | | | | | | | ,StrSet *
@@@ | | | | | | | | | | | | | | | | | ,CharSet
@@@ | | | | | | | | | | | | | | | | | | ,CharLeaf **
@@@ | | | | | | | | | | | | | | | | | | | ,Char16 *
@@@ | | | | | | | | | | | | | | | | | | | | ,Char16
@@@ | | | | | | | | | | | | | | | | | | | | | ,CharLeaf
@@@ | | | | | | | | | | | | | | | | | | | | | | ,Char32
@@@ | | | | | | | | | | | | | | | | | | | | | | | ,Cache
@@@ | | | | | | | | | | | | | | | | | | | | | | | |
x86 4321_08_01_04_04_04_10_04_04_08_04_04_0c_04_04_04_10_04_04_02_20_04_20
mipsel 4321_08_01_04_04_04_10_04_04_08_04_04_10_04_04_04_10_04_04_02_20_04_20
x86-64 4321_08_01_08_04_08_18_08_08_10_04_08_10_04_08_08_18_08_08_02_20_04_38
m68k 1234_08_01_04_04_04_10_04_04_08_04_04_0c_04_04_04_10_04_04_02_20_04_20
ppc 1234_08_01_04_04_04_10_04_04_08_04_04_10_04_04_04_10_04_04_02_20_04_20
ppc64 1234_08_01_08_04_08_18_08_08_10_04_08_10_04_08_08_18_08_08_02_20_04_38