mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
An Improved Quake C Compiler
2d4a054440
Do not assume that the destination is a temporary location, as our peephole optimizer will break this. For example, the following IR code (generated via from `x ^= gety()`): (0) binst6 <- BITXOR x, call5 (0) x <- STORE_F binst6 after peephole optimization becomes: (7) x <- BITXOR x, call5 Therefore we cannot assume that the output of the virtual xor instruction can be utilized as a temporary value. BITXOR becomes `(x | y) - (x & y)`, which would wrongly be generated as: x = x | y; temp0 = x & y; x = x - temp0; While this particular case can be fixed by using temp0 first and then x, the cross-product case would not be so simple. Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com> Fixes #190 |
||
---|---|---|
doc | ||
misc | ||
tests | ||
.gitattributes | ||
.gitignore | ||
algo.h | ||
ast.cpp | ||
ast.h | ||
AUTHORS | ||
CMakeLists.txt | ||
code.cpp | ||
conout.cpp | ||
exec.cpp | ||
fold.cpp | ||
fold.h | ||
ftepp.cpp | ||
gmqcc.h | ||
gmqcc.ini.example | ||
intrin.cpp | ||
intrin.h | ||
ir.cpp | ||
ir.h | ||
lexer.cpp | ||
lexer.h | ||
LICENSE | ||
main.cpp | ||
Makefile | ||
opts.cpp | ||
opts.def | ||
parser.cpp | ||
parser.h | ||
README | ||
stat.cpp | ||
test.cpp | ||
utf8.cpp | ||
util.cpp |
An improved QuakeC compiler