ppcexec: Rename bool function enums.

Use "logical" since the functions deal with multiple bits instead of a single boolean value and because the 601 manual calls them Logical Instructions.
Use "ppc" for the enums because logical_and is defined elsewhere and because the original DPPC code used these names for those functions.
This commit is contained in:
joevt 2024-03-26 18:51:42 -07:00 committed by dingusdev
parent d8129bd643
commit 64df253053
3 changed files with 44 additions and 44 deletions

View File

@ -352,15 +352,15 @@ extern uint64_t exceptions_processed;
// instruction enums
typedef enum {
bool_and = 1,
bool_andc = 2,
bool_eqv = 3,
bool_nand = 4,
bool_nor = 5,
bool_or = 6,
bool_orc = 7,
bool_xor = 8,
} bool_fun;
ppc_and = 1,
ppc_andc = 2,
ppc_eqv = 3,
ppc_nand = 4,
ppc_nor = 5,
ppc_or = 6,
ppc_orc = 7,
ppc_xor = 8,
} logical_fun;
typedef enum {
LK0,
@ -450,7 +450,7 @@ extern void ppc_crorc();
extern void ppc_crxor();
extern void ppc_isync();
template <bool_fun bool_op, field_rc rec> extern void ppc_do_bool();
template <logical_fun logical_op, field_rc rec> extern void ppc_logical();
template <field_carry carry, field_rc rec, field_ov ov> extern void ppc_add();
template <field_rc rec, field_ov ov> extern void ppc_adde();

View File

@ -696,14 +696,14 @@ void initialize_ppc_opcode_tables() {
OP31(438, ppc_ecowx);
OP31dc(24, ppc_shift, SHFT1);
OP31dc(28, ppc_do_bool, bool_and);
OP31dc(60, ppc_do_bool, bool_andc);
OP31dc(124, ppc_do_bool, bool_nor);
OP31dc(284, ppc_do_bool, bool_eqv);
OP31dc(316, ppc_do_bool, bool_xor);
OP31dc(412, ppc_do_bool, bool_orc);
OP31dc(444, ppc_do_bool, bool_or);
OP31dc(476, ppc_do_bool, bool_nand);
OP31dc(28, ppc_logical, ppc_and);
OP31dc(60, ppc_logical, ppc_andc);
OP31dc(124, ppc_logical, ppc_nor);
OP31dc(284, ppc_logical, ppc_eqv);
OP31dc(316, ppc_logical, ppc_xor);
OP31dc(412, ppc_logical, ppc_orc);
OP31dc(444, ppc_logical, ppc_or);
OP31dc(476, ppc_logical, ppc_nand);
OP31dc(536, ppc_shift, SHFT0);
OP31d(792, ppc_sraw);
OP31d(824, ppc_srawi);

View File

@ -367,24 +367,24 @@ void dppc_interpreter::ppc_xori() {
template void dppc_interpreter::ppc_xori<SHFT0>();
template void dppc_interpreter::ppc_xori<SHFT1>();
template <bool_fun bool_op, field_rc rec>
void dppc_interpreter::ppc_do_bool() {
template <logical_fun logical_op, field_rc rec>
void dppc_interpreter::ppc_logical() {
ppc_grab_regssab(ppc_cur_instruction);
if (bool_op == bool_fun::bool_and)
if (logical_op == logical_fun::ppc_and)
ppc_result_a = ppc_result_d & ppc_result_b;
else if (bool_op == bool_fun::bool_andc)
else if (logical_op == logical_fun::ppc_andc)
ppc_result_a = ppc_result_d & ~(ppc_result_b);
else if (bool_op == bool_fun::bool_eqv)
else if (logical_op == logical_fun::ppc_eqv)
ppc_result_a = ~(ppc_result_d ^ ppc_result_b);
else if (bool_op == bool_fun::bool_nand)
else if (logical_op == logical_fun::ppc_nand)
ppc_result_a = ~(ppc_result_d & ppc_result_b);
else if (bool_op == bool_fun::bool_nor)
else if (logical_op == logical_fun::ppc_nor)
ppc_result_a = ~(ppc_result_d | ppc_result_b);
else if (bool_op == bool_fun::bool_or)
else if (logical_op == logical_fun::ppc_or)
ppc_result_a = ppc_result_d | ppc_result_b;
else if (bool_op == bool_fun::bool_orc)
else if (logical_op == logical_fun::ppc_orc)
ppc_result_a = ppc_result_d | ~(ppc_result_b);
else if (bool_op == bool_fun::bool_xor)
else if (logical_op == logical_fun::ppc_xor)
ppc_result_a = ppc_result_d ^ ppc_result_b;
if (rec)
@ -393,22 +393,22 @@ void dppc_interpreter::ppc_do_bool() {
ppc_store_iresult_reg(reg_a, ppc_result_a);
}
template void dppc_interpreter::ppc_do_bool<bool_and, RC0>();
template void dppc_interpreter::ppc_do_bool<bool_andc, RC0>();
template void dppc_interpreter::ppc_do_bool<bool_eqv, RC0>();
template void dppc_interpreter::ppc_do_bool<bool_nand, RC0>();
template void dppc_interpreter::ppc_do_bool<bool_nor, RC0>();
template void dppc_interpreter::ppc_do_bool<bool_or, RC0>();
template void dppc_interpreter::ppc_do_bool<bool_orc, RC0>();
template void dppc_interpreter::ppc_do_bool<bool_xor, RC0>();
template void dppc_interpreter::ppc_do_bool<bool_and, RC1>();
template void dppc_interpreter::ppc_do_bool<bool_andc, RC1>();
template void dppc_interpreter::ppc_do_bool<bool_eqv, RC1>();
template void dppc_interpreter::ppc_do_bool<bool_nand, RC1>();
template void dppc_interpreter::ppc_do_bool<bool_nor, RC1>();
template void dppc_interpreter::ppc_do_bool<bool_or, RC1>();
template void dppc_interpreter::ppc_do_bool<bool_orc, RC1>();
template void dppc_interpreter::ppc_do_bool<bool_xor, RC1>();
template void dppc_interpreter::ppc_logical<ppc_and, RC0>();
template void dppc_interpreter::ppc_logical<ppc_andc, RC0>();
template void dppc_interpreter::ppc_logical<ppc_eqv, RC0>();
template void dppc_interpreter::ppc_logical<ppc_nand, RC0>();
template void dppc_interpreter::ppc_logical<ppc_nor, RC0>();
template void dppc_interpreter::ppc_logical<ppc_or, RC0>();
template void dppc_interpreter::ppc_logical<ppc_orc, RC0>();
template void dppc_interpreter::ppc_logical<ppc_xor, RC0>();
template void dppc_interpreter::ppc_logical<ppc_and, RC1>();
template void dppc_interpreter::ppc_logical<ppc_andc, RC1>();
template void dppc_interpreter::ppc_logical<ppc_eqv, RC1>();
template void dppc_interpreter::ppc_logical<ppc_nand, RC1>();
template void dppc_interpreter::ppc_logical<ppc_nor, RC1>();
template void dppc_interpreter::ppc_logical<ppc_or, RC1>();
template void dppc_interpreter::ppc_logical<ppc_orc, RC1>();
template void dppc_interpreter::ppc_logical<ppc_xor, RC1>();
template <field_rc rec, field_ov ov>
void dppc_interpreter::ppc_neg() {