From: Wolfgang Bumiller Date: Sun, 13 Jan 2013 19:36:54 +0000 (+0100) Subject: make MUL_VF and MUL_FV friendlier for compilers X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5036c3190df4a80a441bede5517626ce1296f5e2;p=xonotic%2Fdarkplaces.git make MUL_VF and MUL_FV friendlier for compilers --- diff --git a/prvm_exec.c b/prvm_exec.c index f2ad83ed..42eee2ec 100644 --- a/prvm_exec.c +++ b/prvm_exec.c @@ -672,6 +672,7 @@ void MVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessag int restorevm_tempstringsbuf_cursize; double calltime; double tm, starttm; + double tempfloat; calltime = Sys_DirtyTime(); diff --git a/prvm_execprogram.h b/prvm_execprogram.h index c787e6fe..39f2cacb 100644 --- a/prvm_execprogram.h +++ b/prvm_execprogram.h @@ -47,14 +47,16 @@ OPC->_float = OPA->vector[0]*OPB->vector[0] + OPA->vector[1]*OPB->vector[1] + OPA->vector[2]*OPB->vector[2]; break; case OP_MUL_FV: - OPC->vector[0] = OPA->_float * OPB->vector[0]; - OPC->vector[1] = OPA->_float * OPB->vector[1]; - OPC->vector[2] = OPA->_float * OPB->vector[2]; + tempfloat = OPA->_float; + OPC->vector[0] = tempfloat * OPB->vector[0]; + OPC->vector[1] = tempfloat * OPB->vector[1]; + OPC->vector[2] = tempfloat * OPB->vector[2]; break; case OP_MUL_VF: - OPC->vector[0] = OPB->_float * OPA->vector[0]; - OPC->vector[1] = OPB->_float * OPA->vector[1]; - OPC->vector[2] = OPB->_float * OPA->vector[2]; + tempfloat = OPB->_float; + OPC->vector[0] = tempfloat * OPA->vector[0]; + OPC->vector[1] = tempfloat * OPA->vector[1]; + OPC->vector[2] = tempfloat * OPA->vector[2]; break; case OP_DIV_F: if( OPB->_float != 0.0f )