OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [sim/] [erc32/] [end.c] - Blame information for rev 823

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
#include <stdio.h>
2
 
3
int
4
main()
5
{
6
 
7
    unsigned int    u1;
8
    char           *c;
9
    double          d1;
10
    float          *f1;
11
 
12
    c = (char *) &u1;
13
    u1 = 0x0F;
14
    if (c[0] == 0x0F)
15
        puts("#define HOST_LITTLE_ENDIAN\n");
16
    else
17
        puts("#define HOST_BIG_ENDIAN\n");
18
 
19
    d1 = 1.0;
20
    f1 = (float *) &d1;
21
    if (*((int *) f1) != 0x3ff00000)
22
        puts("#define HOST_LITTLE_ENDIAN_FLOAT\n");
23
    else
24
        puts("#define HOST_BIG_ENDIAN_FLOAT\n");
25
    return 0;
26
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.