summaryrefslogtreecommitdiffstats
path: root/target-m68k/op_mem.h
blob: 556829f691b53ceea66a379ec341467ce76809d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Load/store ops.  */
#define MEM_LD_OP(name,suffix) \
OP(glue(glue(ld,name),MEMSUFFIX)) \
{ \
    uint32_t addr = get_op(PARAM2); \
    set_op(PARAM1, glue(glue(ld,suffix),MEMSUFFIX)(addr)); \
    FORCE_RET(); \
}

MEM_LD_OP(8u32,ub)
MEM_LD_OP(8s32,sb)
MEM_LD_OP(16u32,uw)
MEM_LD_OP(16s32,sw)
MEM_LD_OP(32,l)

#undef MEM_LD_OP

#define MEM_ST_OP(name,suffix) \
OP(glue(glue(st,name),MEMSUFFIX)) \
{ \
    uint32_t addr = get_op(PARAM1); \
    glue(glue(st,suffix),MEMSUFFIX)(addr, get_op(PARAM2)); \
    FORCE_RET(); \
}

MEM_ST_OP(8,b)
MEM_ST_OP(16,w)
MEM_ST_OP(32,l)

#undef MEM_ST_OP

OP(glue(ldf64,MEMSUFFIX))
{
    uint32_t addr = get_op(PARAM2);
    set_opf64(PARAM1, glue(ldfq,MEMSUFFIX)(addr));
    FORCE_RET();
}

OP(glue(stf64,MEMSUFFIX))
{
    uint32_t addr = get_op(PARAM1);
    glue(stfq,MEMSUFFIX)(addr, get_opf64(PARAM2));
    FORCE_RET();
}

#undef MEMSUFFIX
OpenPOWER on IntegriCloud