Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a set of new QC opcodes for bit shifts and unsigned integer math. #237

Merged
merged 6 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions progsvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ typedef union prvm_eval_s
prvm_int_t function;
prvm_int_t ivector[3];
prvm_int_t _int;
prvm_uint_t _uint;
prvm_int_t edict;
} prvm_eval_t;

Expand Down
6 changes: 6 additions & 0 deletions prvm_edict.c
Original file line number Diff line number Diff line change
Expand Up @@ -2443,6 +2443,12 @@ void PRVM_Prog_Load(prvm_prog_t *prog, const char *filename, unsigned char *data
case OP_STOREP_FNC:
case OP_STOREP_V:
case OP_STOREP_I:
case OP_RSHIFT_I:
case OP_LSHIFT_I:
case OP_LE_U:
case OP_LT_U:
case OP_DIV_U:
case OP_RSHIFT_U:
if (a >= prog->progs_numglobals || b >= prog->progs_numglobals || c >= prog->progs_numglobals)
prog->error_cmd("%s: out of bounds global index (statement %d)", __func__, i);
prog->statements[i].op = op;
Expand Down
22 changes: 20 additions & 2 deletions prvm_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ NULL,
"DIV_VF",

NULL,
NULL,
NULL,
"RSHIFT_I",
"LSHIFT_I",

"GLOBALADDRESS",
"ADD_PIW",
Expand Down Expand Up @@ -294,6 +294,24 @@ NULL,
NULL,

"GLOAD_V",

NULL,
NULL,

NULL,
NULL,
NULL,
NULL,


NULL,
NULL,


"^2LE_U",
"^2LT_U",
"DIV_U",
"RSHIFT_U",
};


Expand Down
Loading
Loading