Use new degree FLOPs for DECORATE expressions.

- Now that the VM supports degrees, use those instructions when emitting
  code for cos and sin DECORATE expressions. (This looks like it also
  fixed a bug where sqrt also did the degree to radian conversion.)
This commit is contained in:
Randy Heit 2013-07-28 20:29:25 -05:00
parent ff7b1f6e5e
commit c810b4d724
1 changed files with 2 additions and 3 deletions

View File

@ -3458,11 +3458,10 @@ ExpEmit FxGlobalFunctionCall::Emit(VMFunctionBuilder *build)
ExpEmit v = (*ArgList)[0]->Emit(build);
assert(!v.Konst && v.RegType == REGT_FLOAT);
build->Emit(OP_MULF_RK, v.RegNum, v.RegNum, build->GetConstantFloat(M_PI / 180.0));
build->Emit(OP_FLOP, v.RegNum, v.RegNum,
(Name == NAME_Sqrt) ? FLOP_SQRT :
(Name == NAME_Sin) ? FLOP_SIN :
FLOP_COS);
(Name == NAME_Sin) ? FLOP_SIN_DEG :
FLOP_COS_DEG);
return v;
}