From d29890ee3944c99d9181d297b938a15a8697f2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petri=20H=C3=A4kkinen?= Date: Fri, 10 Nov 2023 11:49:17 +0200 Subject: [PATCH] Disable fast path in compileCompareJump for vector constants because supporting it would require a new opcode --- Compiler/src/Compiler.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Compiler/src/Compiler.cpp b/Compiler/src/Compiler.cpp index 48f4a4ca..a7eedfc4 100644 --- a/Compiler/src/Compiler.cpp +++ b/Compiler/src/Compiler.cpp @@ -1100,6 +1100,13 @@ struct Compiler return cv && cv->type != Constant::Type_Unknown && !cv->isTruthful(); } + bool isConstantVector(AstExpr* node) + { + const Constant* cv = constants.find(node); + + return cv && cv->type == Constant::Type_Vector; + } + Constant getConstant(AstExpr* node) { const Constant* cv = constants.find(node); @@ -1123,6 +1130,10 @@ struct Compiler std::swap(left, right); } + // disable fast path for vectors because supporting it would require a new opcode + if (isConstantVector(right)) + operandIsConstant = false; + uint8_t rl = compileExprAuto(left, rs); if (isEq && operandIsConstant)