mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
3c67e8f020
It was pointed out by Blub\w (gmqcc) that OP_MUL_FV and friends were buggy when the operands overlapped (eg, x = x.x * x) as the result would become 'x.x*x.x x.y*x.x*x.x x.z*x.x*x.x' (note the x.x squared for y and z). On testing, sure enough the bug was present (and is a nice demonstration that QF's VM does NOT have strict-aliasing bugs). As a very nice benefit: the code produced by the fixes is actually faster than the broken version :). The ruamoko code used for testing: void (string fmt, ...) printf = #0; vector foo (vector x) { x = x * x.x; return x; } vector bar (vector x) { x = x.x * x; return x; } int main () { vector x = '2 3 4'; vector y = foo (x); vector z = bar (x); printf ("x=%v y=%v z=%v 2*x=%v\n", x, y, z, 2*x); return 0; } |
||
---|---|---|
.. | ||
Makefile.am | ||
pr_builtins.c | ||
pr_debug.c | ||
pr_edict.c | ||
pr_exec.c | ||
pr_load.c | ||
pr_opcode.c | ||
pr_parse.c | ||
pr_resolve.c | ||
pr_resource.c | ||
pr_strings.c | ||
pr_zone.c |