-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add FTEQCC pointer instructions #215
Conversation
To try with Xonotic, apply the attached patch, and compile like:
Note that there is one difference between fteqcc and gmqcc in constant folding; use this patch to remove this difference and get identical serverbench hashes so you can benchmark: gmqcc-do-not-fold-into-reciprocal-diff.txt Filed that as graphitemaster/gmqcc#210. |
@graphitemaster Any chance gmqcc could gain support for these opcodes as well (behind a flag), and then no longer emit array accessor functions? |
6593bf9
to
d7c38c3
Compare
After having talked to @ladyhavoc, renamed FIELD_F etc. instruction in the disassembly to LOAD_F etc., matching the pr_comp.h names. |
0 to 0x7FFFFFFF: reserved. 0x80000000 to 0x80000000 + num_globals - 1: global pointers. 0x80000000 + num_globals to 0x80000000 + num_globals + num_entities * num_entityfields - 1: entity field pointers. Note that there are no instructions yet to _make_ global pointers, or to load values from them. This is the beginning of implementing the pointer instruction set.
d7c38c3
to
65ae23b
Compare
This is used by FTEQCC array and pointer support.
Also, for safety, check the unused arg in 2 arg instructions.
Also fix instruction coloring and naming in disassembler. - For some reason, all LOAD_ instructions are called FIELD_ now. Weren't they called INDIRECT_ once? Well, anyway, not touching that, just making it consistent with itself. - Match new instructions in color to existing ones doing the same.
Even the ones we don't use.
Changes: - DIV -> DIV_F - FIELD_* -> LOAD_*
de6cb21
to
be41f10
Compare
Adds _F and _I type suffixes to lots of Quake-inherited opcodes that had no type suffix but used floats (or ints). Not handling IF/IFNOT yet, but documenting a plan.
be41f10
to
9f02f5f
Compare
From private chat, Spoike seems to be OK with this instruction set being added, and has plans of how to add it to FTEQCC. So I am gonna merge now. |
Retroactive approval/LGTM from my end. |
This adds the following instructions:
It changes QC "address space" as follows:
This changes nothing visible, as these pointer values are generally invisible to well written QC code, however, writing to a NULL pointer notably now errors in the QC VM (previously, it would overwrite
world.modelindex
, which, I guess, may make the map go away, doesn't do that for me though).Tested: this speeds up Xonotic serverbench by 6.8% while keeping correctness: