}
case op_blm:
- {
- /* Input stack: ( src dest -- ) */
- struct ir* dest = pop(EM_pointersize);
- struct ir* src = pop(EM_pointersize);
- blockmove(dest, src, new_wordir(value));
+ push(new_wordir(value));
+ helper_function(".bls4");
break;
- }
case op_bls:
- {
- /* Input stack: ( src dest size -- ) */
- struct ir* dest = pop(EM_pointersize);
- struct ir* src = pop(EM_pointersize);
- struct ir* size = pop(EM_wordsize);
- blockmove(dest, src, size);
+ if (value != EM_wordsize)
+ fatal("'bls %d' not supported", value);
+ helper_function(".bls4");
break;
+ }
case op_los:
- {
- /* Copy an arbitrary amount to the stack. */
- struct ir* bytes = pop(EM_wordsize);
- struct ir* address = pop(EM_pointersize);
-
- materialise_stack();
- appendir(
- new_ir1(
- IR_STACKADJUST, EM_pointersize,
- new_ir1(
- IR_NEG, EM_wordsize,
- bytes
- )
- )
- );
-
- push(
- new_ir0(
- IR_GETSP, EM_pointersize
- )
- );
- push(address);
- push(bytes);
- materialise_stack();
- appendir(
- new_ir1(
- IR_CALL, 0,
- new_labelir("memcpy")
- )
- );
- appendir(
- new_ir1(
- IR_STACKADJUST, EM_pointersize,
- new_wordir(EM_pointersize*2 + EM_wordsize)
- )
- );
+ if (value != EM_wordsize)
+ fatal("'los %d' not supported", value);
+ helper_function_with_arg(".los4", pop(EM_wordsize));
break;
+ }
case op_sts:
- {
- /* Copy an arbitrary amount from the stack. */
- struct ir* bytes = pop(EM_wordsize);
- struct ir* dest = pop(EM_pointersize);
- struct ir* src;
-
- materialise_stack();
- src = appendir(
- new_ir0(
- IR_GETSP, EM_pointersize
- )
- );
-
- push(dest);
- push(src);
- push(bytes);
- materialise_stack();
- appendir(
- new_ir1(
- IR_CALL, 0,
- new_labelir("memcpy")
- )
- );
- appendir(
- new_ir1(
- IR_STACKADJUST, EM_pointersize,
- new_ir2(
- IR_ADD, EM_wordsize,
- new_wordir(EM_pointersize*2 + EM_wordsize),
- bytes
- )
- )
- );
+ if (value != EM_wordsize)
+ fatal("'sts %d' not supported", value);
+ helper_function_with_arg(".sts4", pop(EM_wordsize));
break;
- }
case op_lin:
{