2 #define ADDR(x) ((x) & 0xffffffff)
8 #define SPARC_LD_OP(name, qp) \
9 void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
11 T1 = (target_ulong)glue(qp, MEMSUFFIX)(ADDR(T0)); \
14 #define SPARC_LD_OP_S(name, qp) \
15 void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
17 T1 = (target_long)glue(qp, MEMSUFFIX)(ADDR(T0)); \
20 #define SPARC_ST_OP(name, op) \
21 void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
23 glue(op, MEMSUFFIX)(ADDR(T0), T1); \
27 SPARC_LD_OP(ldub
, ldub
);
28 SPARC_LD_OP(lduh
, lduw
);
29 SPARC_LD_OP_S(ldsb
, ldsb
);
30 SPARC_LD_OP_S(ldsh
, ldsw
);
32 /*** Integer store ***/
34 SPARC_ST_OP(stb
, stb
);
35 SPARC_ST_OP(sth
, stw
);
37 void OPPROTO
glue(op_std
, MEMSUFFIX
)(void)
39 uint64_t tmp
= ((uint64_t)T1
<< 32) | (uint64_t)(T2
& 0xffffffff);
41 glue(stq
, MEMSUFFIX
)(ADDR(T0
), tmp
);
44 void OPPROTO
glue(op_ldstub
, MEMSUFFIX
)(void)
46 T1
= glue(ldub
, MEMSUFFIX
)(ADDR(T0
));
47 glue(stb
, MEMSUFFIX
)(ADDR(T0
), 0xff); /* XXX: Should be Atomically */
50 void OPPROTO
glue(op_swap
, MEMSUFFIX
)(void)
52 target_ulong tmp
= glue(ldl
, MEMSUFFIX
)(ADDR(T0
));
53 glue(stl
, MEMSUFFIX
)(ADDR(T0
), T1
); /* XXX: Should be Atomically */
57 void OPPROTO
glue(op_ldd
, MEMSUFFIX
)(void)
61 tmp
= glue(ldq
, MEMSUFFIX
)(ADDR(T0
));
63 T0
= tmp
& 0xffffffff;
66 /*** Floating-point store ***/
67 void OPPROTO
glue(op_stf
, MEMSUFFIX
) (void)
69 glue(stfl
, MEMSUFFIX
)(ADDR(T0
), FT0
);
72 void OPPROTO
glue(op_stdf
, MEMSUFFIX
) (void)
74 glue(stfq
, MEMSUFFIX
)(ADDR(T0
), DT0
);
77 /*** Floating-point load ***/
78 void OPPROTO
glue(op_ldf
, MEMSUFFIX
) (void)
80 FT0
= glue(ldfl
, MEMSUFFIX
)(ADDR(T0
));
83 void OPPROTO
glue(op_lddf
, MEMSUFFIX
) (void)
85 DT0
= glue(ldfq
, MEMSUFFIX
)(ADDR(T0
));
89 void OPPROTO
glue(op_lduw
, MEMSUFFIX
)(void)
91 T1
= (uint64_t)(glue(ldl
, MEMSUFFIX
)(ADDR(T0
)) & 0xffffffff);
94 void OPPROTO
glue(op_ldsw
, MEMSUFFIX
)(void)
96 T1
= (int64_t)(glue(ldl
, MEMSUFFIX
)(ADDR(T0
)) & 0xffffffff);
99 SPARC_LD_OP(ldx
, ldq
);
100 SPARC_ST_OP(stx
, stq
);