When using writes to memory through a struct to merge and extract
multi-word value, it is the endianness of the host, not the target
that affects which order the component words need to be written into
the structure.
Of the 5 functions adjusted here 4 of them are unused. The 5th,
JOINSIDF will soon be used by the or1k target.
For or1k, simulated on x86-64, this change fixes this function so that
the correct bytes are now returned.
sim/common/ChangeLog:
* cgen-ops.h (SUBWORDXFSI): Compare HOST_BYTE_ORDER not
CURRENT_TARGET_BYTE_ORDER.
(SUBWORDTFSI): Likewise.
(JOINSIDF): Likewise.
(JOINSIXF): Likewise.
(JOINSITF): Likewise.
+2019-04-13 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * cgen-ops.h (SUBWORDXFSI): Compare HOST_BYTE_ORDER not
+ CURRENT_TARGET_BYTE_ORDER.
+ (SUBWORDTFSI): Likewise.
+ (JOINSIDF): Likewise.
+ (JOINSIXF): Likewise.
+ (JOINSITF): Likewise.
+
2019-03-28 Andrew Burgess <andrew.burgess@embecosm.com>
* sim-base.h: Add 'sim-assert.h' include.
2019-03-28 Andrew Burgess <andrew.burgess@embecosm.com>
* sim-base.h: Add 'sim-assert.h' include.
/* Note: typedef struct { SI parts[3]; } XF; */
union { XF in; SI out[3]; } x;
x.in = in;
/* Note: typedef struct { SI parts[3]; } XF; */
union { XF in; SI out[3]; } x;
x.in = in;
- if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG)
return x.out[word];
else
return x.out[2 - word];
return x.out[word];
else
return x.out[2 - word];
/* Note: typedef struct { SI parts[4]; } TF; */
union { TF in; SI out[4]; } x;
x.in = in;
/* Note: typedef struct { SI parts[4]; } TF; */
union { TF in; SI out[4]; } x;
x.in = in;
- if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG)
return x.out[word];
else
return x.out[3 - word];
return x.out[word];
else
return x.out[3 - word];
JOINSIDF (SI x0, SI x1)
{
union { SI in[2]; DF out; } x;
JOINSIDF (SI x0, SI x1)
{
union { SI in[2]; DF out; } x;
- if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG)
x.in[0] = x0, x.in[1] = x1;
else
x.in[1] = x0, x.in[0] = x1;
x.in[0] = x0, x.in[1] = x1;
else
x.in[1] = x0, x.in[0] = x1;
JOINSIXF (SI x0, SI x1, SI x2)
{
union { SI in[3]; XF out; } x;
JOINSIXF (SI x0, SI x1, SI x2)
{
union { SI in[3]; XF out; } x;
- if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG)
x.in[0] = x0, x.in[1] = x1, x.in[2] = x2;
else
x.in[2] = x0, x.in[1] = x1, x.in[0] = x2;
x.in[0] = x0, x.in[1] = x1, x.in[2] = x2;
else
x.in[2] = x0, x.in[1] = x1, x.in[0] = x2;
JOINSITF (SI x0, SI x1, SI x2, SI x3)
{
union { SI in[4]; TF out; } x;
JOINSITF (SI x0, SI x1, SI x2, SI x3)
{
union { SI in[4]; TF out; } x;
- if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG)
x.in[0] = x0, x.in[1] = x1, x.in[2] = x2, x.in[3] = x3;
else
x.in[3] = x0, x.in[2] = x1, x.in[1] = x2, x.in[0] = x3;
x.in[0] = x0, x.in[1] = x1, x.in[2] = x2, x.in[3] = x3;
else
x.in[3] = x0, x.in[2] = x1, x.in[1] = x2, x.in[0] = x3;