diff --git a/libs/gamecode/opcodes.py b/libs/gamecode/opcodes.py index 4bb1b5704..4ec39a71f 100644 --- a/libs/gamecode/opcodes.py +++ b/libs/gamecode/opcodes.py @@ -31,7 +31,7 @@ bitmap_txt = """ 1 1110 c111 stated 1 1111 00mm lea 1 1111 01td vecops2 -1 1111 10nn +1 1111 10oo fbitops 1 1111 1100 convert (conversion mode in st->b) 1 1111 1101 with (mode in st->a, value in st->b, reg in st->c) 1 1111 1110 @@ -186,6 +186,24 @@ convert_formats = { "widths": "-1, 0, -1", "types": "ev_void, ev_short, ev_void", } +fbitops_formats = { + "opcode": "OP_{op_fbit[oo].upper()}_F", + "mnemonic": "{op_fbit[oo]}.f", + "opname": "{op_fbit[oo]}", + "format": "{fbit_fmt[oo]}", + "widths": "1, 1, 1", + "types": "{fbit_types[0]}, {fbit_types[oo==3]}, {fbit_types[0]}", + "args": { + "op_fbit": ["bitand", "bitor", "bitxor", "bitnot"], + "fbit_types": ["ev_float", "ev_invalid"], + "fbit_fmt": [ + "%Ga, %Gb, %gc", + "%Ga, %Gb, %gc", + "%Ga, %Gb, %gc", + "%Ga, %gc", + ], + }, +} hops_formats = { "opcode": "OP_HOPS", "mnemonic": "hops", @@ -548,6 +566,7 @@ group_map = { "compare2": compare2_formats, "constant": constant_formats, "convert": convert_formats, + "fbitops": fbitops_formats, "hops": hops_formats, "jump": jump_formats, "lea": lea_formats, diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index 387ddc28d..c24d35bcf 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -3467,7 +3467,18 @@ pr_exec_ruamoko (progs_t *pr, int exitdepth) case OP_V4QMUL_D: OPC(dvec4) = vqmuld (OPA(dvec4), OPB(dvec4)); break; - // 10nn spare + case OP_BITAND_F: + OPC(float) = (int) OPA(float) & (int) OPB(float); + break; + case OP_BITOR_F: + OPC(float) = (int) OPA(float) | (int) OPB(float); + break; + case OP_BITXOR_F: + OPC(float) = (int) OPA(float) ^ (int) OPB(float); + break; + case OP_BITNOT_F: + OPC(float) = ~ (int) OPA(float); + break; case OP_CONV: switch (st->b) { #include "libs/gamecode/pr_convert.cinc"