## compile-register-moves-pwrpc32-g.pkg
# Compiled by:
#
src/lib/compiler/back/low/pwrpc32/backend-pwrpc32.libstipulate
package lem = lowhalf_error_message; # lowhalf_error_message is from
src/lib/compiler/back/low/control/lowhalf-error-message.pkg package rkj = registerkinds_junk; # registerkinds_junk is from
src/lib/compiler/back/low/code/registerkinds-junk.pkgherein
# This generic is invoked (only) in:
#
#
src/lib/compiler/back/low/main/pwrpc32/backend-lowhalf-pwrpc32.pkg #
generic package compile_register_moves_pwrpc32_g (
# ================================
#
mcf: Machcode_Pwrpc32 # Machcode_Pwrpc32 is from
src/lib/compiler/back/low/pwrpc32/code/machcode-pwrpc32.codemade.api )
# Added this but things exploded, so commented it out -- 2011-06-07 CrT
# : Compile_Register_Moves # Compile_Register_Moves is from
src/lib/compiler/back/low/code/compile-register-moves.api {
# Export to client packages:
#
package mcf = mcf; # "mcf" == "machcode_form" (abstract machine code).
stipulate
package compile_register_moves
=
compile_register_moves_g ( # compile_register_moves_g is from
src/lib/compiler/back/low/code/compile-register-moves-g.pkg #
mcf # "mcf" == "machcode_form" (abstract machine code).
);
herein
Parallel_Register_Moves
=
{ tmp: Null_Or( mcf::Effective_Address ),
dst: List( rkj::Codetemp_Info ),
src: List( rkj::Codetemp_Info )
};
fun error msg
=
lem::error("compile_register_moves_pwrpc32_g", msg);
# WARNING: these move operators assume 32 bit addressing is used! # 64-bit issue XXX BUGGO FIXME
# Allen
fun move { src=>mcf::DIRECT rs, dst=>mcf::DIRECT rd } => [mcf::arith { oper=>mcf::OR, rt=>rd, ra=>rs, rb=>rs, rc=>FALSE, oe=>FALSE } ];
#
move { src=>mcf::DIRECT rs, dst=>mcf::DISPLACE { base, disp, ramregion } } => [mcf::st { st=>mcf::STW, rs, ra=>base, d=>mcf::LABEL_OP disp, ramregion } ];
#
move { src=>mcf::DISPLACE { base, disp, ramregion }, dst=>mcf::DIRECT rt } => [mcf::ll { ld=>mcf::LWZ, rt, ra=>base, d=>mcf::LABEL_OP disp, ramregion } ];
#
move _ => error "move";
end;
fun fmove { src=>mcf::FDIRECT fs, dst=>mcf::FDIRECT fd } => [mcf::funary { oper=>mcf::FMR, fb=>fs, ft=>fd, rc=>FALSE } ];
#
fmove { src=>mcf::FDIRECT fs, dst=>mcf::DISPLACE { base, disp, ramregion } } => [mcf::stf { st=>mcf::STFD, fs, ra=>base, d=>mcf::LABEL_OP disp, ramregion } ];
#
fmove { src=>mcf::DISPLACE { base, disp, ramregion }, dst=>mcf::FDIRECT ft } => [mcf::lf { ld=>mcf::LFD, ft, ra=>base, d=>mcf::LABEL_OP disp, ramregion } ];
#
fmove _ => error "fmove";
end;
compile_int_register_moves = compile_register_moves::compile_int_register_moves { move_instruction=>move, ea=>mcf::DIRECT };
compile_float_register_moves = compile_register_moves::compile_int_register_moves { move_instruction=>fmove, ea=>mcf::FDIRECT };
end;
};
end;