URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 24 |
Rev 33 |
#include <stdio.h>
|
#include <stdio.h>
|
|
|
int
|
int
|
main()
|
main()
|
{
|
{
|
|
|
unsigned int u1;
|
unsigned int u1;
|
char *c;
|
char *c;
|
double d1;
|
double d1;
|
float *f1;
|
float *f1;
|
|
|
c = (char *) &u1;
|
c = (char *) &u1;
|
u1 = 0x0F;
|
u1 = 0x0F;
|
if (c[0] == 0x0F)
|
if (c[0] == 0x0F)
|
puts("#define HOST_LITTLE_ENDIAN\n");
|
puts("#define HOST_LITTLE_ENDIAN\n");
|
else
|
else
|
puts("#define HOST_BIG_ENDIAN\n");
|
puts("#define HOST_BIG_ENDIAN\n");
|
|
|
d1 = 1.0;
|
d1 = 1.0;
|
f1 = (float *) &d1;
|
f1 = (float *) &d1;
|
if (*((int *) f1) != 0x3ff00000)
|
if (*((int *) f1) != 0x3ff00000)
|
puts("#define HOST_LITTLE_ENDIAN_FLOAT\n");
|
puts("#define HOST_LITTLE_ENDIAN_FLOAT\n");
|
else
|
else
|
puts("#define HOST_BIG_ENDIAN_FLOAT\n");
|
puts("#define HOST_BIG_ENDIAN_FLOAT\n");
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.