2007-10-14 20:27:31 +04:00
|
|
|
#ifdef TARGET_ABI32
|
|
|
|
#define ADDR(x) ((x) & 0xffffffff)
|
|
|
|
#else
|
|
|
|
#define ADDR(x) (x)
|
|
|
|
#endif
|
|
|
|
|
2004-10-01 01:55:55 +04:00
|
|
|
/*** Integer load ***/
|
|
|
|
#define SPARC_LD_OP(name, qp) \
|
|
|
|
void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
|
|
|
|
{ \
|
2007-10-14 20:27:31 +04:00
|
|
|
T1 = (target_ulong)glue(qp, MEMSUFFIX)(ADDR(T0)); \
|
2004-10-01 01:55:55 +04:00
|
|
|
}
|
|
|
|
|
2007-09-20 18:54:22 +04:00
|
|
|
#define SPARC_LD_OP_S(name, qp) \
|
|
|
|
void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
|
|
|
|
{ \
|
2007-10-14 20:27:31 +04:00
|
|
|
T1 = (target_long)glue(qp, MEMSUFFIX)(ADDR(T0)); \
|
2005-07-02 18:31:34 +04:00
|
|
|
}
|
|
|
|
|
2004-10-01 01:55:55 +04:00
|
|
|
#define SPARC_ST_OP(name, op) \
|
|
|
|
void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
|
|
|
|
{ \
|
2007-10-14 20:27:31 +04:00
|
|
|
glue(op, MEMSUFFIX)(ADDR(T0), T1); \
|
2004-10-01 01:55:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
SPARC_LD_OP(ld, ldl);
|
|
|
|
SPARC_LD_OP(ldub, ldub);
|
|
|
|
SPARC_LD_OP(lduh, lduw);
|
2005-07-02 18:31:34 +04:00
|
|
|
SPARC_LD_OP_S(ldsb, ldsb);
|
|
|
|
SPARC_LD_OP_S(ldsh, ldsw);
|
2004-10-01 01:55:55 +04:00
|
|
|
|
|
|
|
/*** Integer store ***/
|
|
|
|
SPARC_ST_OP(st, stl);
|
|
|
|
SPARC_ST_OP(stb, stb);
|
|
|
|
SPARC_ST_OP(sth, stw);
|
|
|
|
|
|
|
|
void OPPROTO glue(op_std, MEMSUFFIX)(void)
|
|
|
|
{
|
2007-10-17 21:37:13 +04:00
|
|
|
uint64_t tmp = ((uint64_t)T1 << 32) | (uint64_t)(T2 & 0xffffffff);
|
|
|
|
|
|
|
|
glue(stq, MEMSUFFIX)(ADDR(T0), tmp);
|
2004-10-01 01:55:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void OPPROTO glue(op_ldstub, MEMSUFFIX)(void)
|
|
|
|
{
|
2007-10-14 20:27:31 +04:00
|
|
|
T1 = glue(ldub, MEMSUFFIX)(ADDR(T0));
|
|
|
|
glue(stb, MEMSUFFIX)(ADDR(T0), 0xff); /* XXX: Should be Atomically */
|
2004-10-01 01:55:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void OPPROTO glue(op_swap, MEMSUFFIX)(void)
|
|
|
|
{
|
2007-10-14 20:27:31 +04:00
|
|
|
target_ulong tmp = glue(ldl, MEMSUFFIX)(ADDR(T0));
|
|
|
|
glue(stl, MEMSUFFIX)(ADDR(T0), T1); /* XXX: Should be Atomically */
|
2004-10-01 01:55:55 +04:00
|
|
|
T1 = tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
void OPPROTO glue(op_ldd, MEMSUFFIX)(void)
|
|
|
|
{
|
2007-10-17 21:37:13 +04:00
|
|
|
uint64_t tmp;
|
|
|
|
|
|
|
|
tmp = glue(ldq, MEMSUFFIX)(ADDR(T0));
|
|
|
|
T1 = tmp >> 32;
|
|
|
|
T0 = tmp & 0xffffffff;
|
2004-10-01 01:55:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*** Floating-point store ***/
|
|
|
|
void OPPROTO glue(op_stf, MEMSUFFIX) (void)
|
|
|
|
{
|
2007-10-14 20:27:31 +04:00
|
|
|
glue(stfl, MEMSUFFIX)(ADDR(T0), FT0);
|
2004-10-01 01:55:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void OPPROTO glue(op_stdf, MEMSUFFIX) (void)
|
|
|
|
{
|
2007-10-14 20:27:31 +04:00
|
|
|
glue(stfq, MEMSUFFIX)(ADDR(T0), DT0);
|
2004-10-01 01:55:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*** Floating-point load ***/
|
|
|
|
void OPPROTO glue(op_ldf, MEMSUFFIX) (void)
|
|
|
|
{
|
2007-10-14 20:27:31 +04:00
|
|
|
FT0 = glue(ldfl, MEMSUFFIX)(ADDR(T0));
|
2004-10-01 01:55:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void OPPROTO glue(op_lddf, MEMSUFFIX) (void)
|
|
|
|
{
|
2007-10-14 20:27:31 +04:00
|
|
|
DT0 = glue(ldfq, MEMSUFFIX)(ADDR(T0));
|
2004-10-01 01:55:55 +04:00
|
|
|
}
|
2005-07-02 18:31:34 +04:00
|
|
|
|
|
|
|
#ifdef TARGET_SPARC64
|
2007-07-08 00:50:33 +04:00
|
|
|
void OPPROTO glue(op_lduw, MEMSUFFIX)(void)
|
|
|
|
{
|
2007-10-14 20:27:31 +04:00
|
|
|
T1 = (uint64_t)(glue(ldl, MEMSUFFIX)(ADDR(T0)) & 0xffffffff);
|
2007-07-08 00:50:33 +04:00
|
|
|
}
|
|
|
|
|
2005-07-02 18:31:34 +04:00
|
|
|
void OPPROTO glue(op_ldsw, MEMSUFFIX)(void)
|
|
|
|
{
|
2007-10-14 20:27:31 +04:00
|
|
|
T1 = (int64_t)(glue(ldl, MEMSUFFIX)(ADDR(T0)) & 0xffffffff);
|
2005-07-02 18:31:34 +04:00
|
|
|
}
|
|
|
|
|
2005-07-23 18:27:54 +04:00
|
|
|
SPARC_LD_OP(ldx, ldq);
|
|
|
|
SPARC_ST_OP(stx, stq);
|
2005-07-02 18:31:34 +04:00
|
|
|
#endif
|
2004-10-01 01:55:55 +04:00
|
|
|
#undef MEMSUFFIX
|