You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replacing a / b by a * (1 / b), which gmqcc sometimes does, can cause an accuracy loss.
See explanations on gcc's -freciprocal-math and why it's not default but only part of -funsafe-math-optimizations.
Attached an incomplete patch to do this. It lacks the case for vector / float division - that "folding" actually emulates the missing DIV_VF QC instruction, and as such, a different emulation has to be provided when the folding is to be turned off.
As such, with the optimization flag, v / f should be implemented like now as v * (1 / f), whereas without the flag, it should be implemented as vec3(v_x / f, v_y / f, v_z / f), which admittedly incurs an insane amount of QC instructions.
It's a bit less accurate than it should be in GMQCC:
graphitemaster/gmqcc#210
To get better equality between compilers, change the code so both
compilers emit the same.
Replacing
a / b
bya * (1 / b)
, which gmqcc sometimes does, can cause an accuracy loss.See explanations on gcc's
-freciprocal-math
and why it's not default but only part of-funsafe-math-optimizations
.Attached an incomplete patch to do this. It lacks the case for vector / float division - that "folding" actually emulates the missing DIV_VF QC instruction, and as such, a different emulation has to be provided when the folding is to be turned off.
As such, with the optimization flag,
v / f
should be implemented like now asv * (1 / f)
, whereas without the flag, it should be implemented asvec3(v_x / f, v_y / f, v_z / f)
, which admittedly incurs an insane amount of QC instructions.move-reciprocal-division-to-non-default-flag.diff.txt
The text was updated successfully, but these errors were encountered: