- added an optimization to FxBoolCast that it doesn't force the source value to a 0/1 integer if not explicitly needed. When doing comparisons we do not care about actual values, we only want to know if it is 0 or not.
- added the above for the 'if' condition. It works for integers, floats and pointers and will save 3 instructions if the condition is a non-boolean that can be implicitly casted to bool.
This commit is contained in:
parent
5b952b116a
commit
da56e5908d
2 changed files with 48 additions and 25 deletions
|
|
@ -457,10 +457,11 @@ public:
|
|||
class FxBoolCast : public FxExpression
|
||||
{
|
||||
FxExpression *basex;
|
||||
bool NeedValue;
|
||||
|
||||
public:
|
||||
|
||||
FxBoolCast(FxExpression *x);
|
||||
FxBoolCast(FxExpression *x, bool needvalue = true);
|
||||
~FxBoolCast();
|
||||
FxExpression *Resolve(FCompileContext&);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue