7 case Oloadsb
: case Oloadub
: return 1;
8 case Oloadsh
: case Oloaduh
: return 2;
9 case Oloadsw
: case Oloaduw
: return 4;
10 case Oload
: return KWIDE(l
->cls
) ? 8 : 4;
19 case Ostoreb
: return 1;
20 case Ostoreh
: return 2;
21 case Ostorew
: case Ostores
: return 4;
22 case Ostorel
: case Ostored
: return 8;
28 /* require use, maintains use counts */
38 /* promote uniform stack slots to temporaries */
40 for (i
=b
->ins
; i
-b
->ins
< b
->nins
; i
++) {
41 if (Oalloc
> i
->op
|| i
->op
> Oalloc1
)
43 /* specific to NAlign == 3 */
44 assert(rtype(i
->to
) == RTmp
);
45 t
= &fn
->tmp
[i
->to
.val
];
50 for (u
=t
->use
; u
!= &t
->use
[t
->nuse
]; u
++) {
55 if (s
== -1 || s
== loadsz(l
)) {
60 if (req(i
->to
, l
->arg
[1]) && !req(i
->to
, l
->arg
[0]))
61 if (s
== -1 || s
== storesz(l
))
62 if (k
== -1 || k
== opdesc
[l
->op
].argcls
[0][0]) {
64 k
= opdesc
[l
->op
].argcls
[0][0];
69 /* get rid of the alloc and replace uses */
70 *i
= (Ins
){.op
= Onop
};
72 ue
= &t
->use
[t
->nuse
];
73 for (u
=t
->use
; u
!=ue
; u
++) {
84 err("slot %%%s is read but never stored to",
85 fn
->tmp
[l
->arg
[0].val
].name
);
86 /* try to turn loads into copies so we
87 * can eliminate them later */
92 if (KBASE(k
) != KBASE(l
->cls
))
98 l
->op
= Oextsb
+ (l
->op
- Oloadsb
);
106 fprintf(stderr
, "\n> After memory optimization:\n");