- partial backend update from GZDoom.

This commit is contained in:
Christoph Oelckers 2022-07-02 09:30:37 +02:00
parent 486da6922d
commit 3ec8a96ddf
10 changed files with 58 additions and 12 deletions

View file

@ -1850,7 +1850,7 @@ FxExpression *FxMinusSign::Resolve(FCompileContext& ctx)
ExpEmit FxMinusSign::Emit(VMFunctionBuilder *build)
{
assert(ValueType == Operand->ValueType);
//assert(ValueType == Operand->ValueType);
ExpEmit from = Operand->Emit(build);
ExpEmit to;
assert(from.Konst == 0);
@ -2777,7 +2777,7 @@ FxExpression *FxAddSub::Resolve(FCompileContext& ctx)
else if (left->IsVector() && right->IsVector())
{
// a vector2 can be added to or subtracted from a vector 3 but it needs to be the right operand.
if (left->ValueType == right->ValueType || (left->IsVector3() && right->IsVector2()))
if (((left->IsVector3() || left->IsVector2()) && right->IsVector2()) || (left->IsVector3() && right->IsVector3()))
{
ValueType = left->ValueType;
}
@ -3522,7 +3522,8 @@ FxExpression *FxCompareEq::Resolve(FCompileContext& ctx)
return nullptr;
}
if (left->ValueType != right->ValueType) // identical types are always comparable, if they can be placed in a register, so we can save most checks if this is the case.
// identical types are always comparable, if they can be placed in a register, so we can save most checks if this is the case.
if (left->ValueType != right->ValueType && !(left->IsVector2() && right->IsVector2()) && !(left->IsVector3() && right->IsVector3()))
{
FxExpression *x;
if (left->IsNumeric() && right->ValueType == TypeString && (x = StringConstToChar(right)))