mirror of
https://github.com/luau-lang/luau.git
synced 2025-01-19 09:18:07 +00:00
24cacc94ed
Some checks are pending
benchmark / callgrind (map[branch:main name:luau-lang/benchmark-data], ubuntu-22.04) (push) Waiting to run
build / macos (push) Waiting to run
build / macos-arm (push) Waiting to run
build / ubuntu (push) Waiting to run
build / windows (Win32) (push) Waiting to run
build / windows (x64) (push) Waiting to run
build / coverage (push) Waiting to run
build / web (push) Waiting to run
release / macos (push) Waiting to run
release / ubuntu (push) Waiting to run
release / windows (push) Waiting to run
release / web (push) Waiting to run
To implement math.lerp without branches, we add SELECT_NUM which selects one of the two inputs based on the comparison condition. For simplicity, we only support C == D for now; this can be extended to a more generic version with a IrCondition operand E, but that requires more work on the SSE side (to flip the comparison for some conditions like Greater, and expose more generic vcmpsd). Note: On AArch64 this will effectively result in a change in floating point behavior between native code and non-native code: clang synthesizes fmadd (because floating point contraction is allowed by default, and the arch always has the instruction), whereas this change will use fmul+fadd. I am not sure if this is good or bad, and if this is a problem in C or not. Specifically, clang's behavior results in different results between X64 and AArch64 when *not* using codegen, and with this change the behavior when using codegen is... the same? :) Fixing this will require either using LERP_NUM instead and hand-coding lowering, or exposing some sort of "quasi" MADD_NUM (which would lower to fma on AArch64 and mul+add on X64). A small benefit to the current approach is `lerp(1, 5, t)` constant-folds the subtraction. With LERP_NUM this optimization will need to be implemented manually as a partial constant-folding for LERP_NUM. A similar problem exists today for vector.cross & vector.dot. So maybe this is not something we need to fix, unsure. |
||
---|---|---|
.. | ||
conformance | ||
require | ||
AnyTypeSummary.test.cpp | ||
AssemblyBuilderA64.test.cpp | ||
AssemblyBuilderX64.test.cpp | ||
AstJsonEncoder.test.cpp | ||
AstQuery.test.cpp | ||
AstQueryDsl.cpp | ||
AstQueryDsl.h | ||
AstVisitor.test.cpp | ||
Autocomplete.test.cpp | ||
BuiltinDefinitions.test.cpp | ||
ClassFixture.cpp | ||
ClassFixture.h | ||
CodeAllocator.test.cpp | ||
Compiler.test.cpp | ||
Config.test.cpp | ||
Conformance.test.cpp | ||
ConformanceIrHooks.h | ||
ConstraintGeneratorFixture.cpp | ||
ConstraintGeneratorFixture.h | ||
ConstraintSolver.test.cpp | ||
CostModel.test.cpp | ||
DataFlowGraph.test.cpp | ||
DenseHash.test.cpp | ||
DiffAsserts.cpp | ||
DiffAsserts.h | ||
Differ.test.cpp | ||
EqSat.language.test.cpp | ||
EqSat.propositional.test.cpp | ||
EqSat.slice.test.cpp | ||
EqSatSimplification.test.cpp | ||
Error.test.cpp | ||
Fixture.cpp | ||
Fixture.h | ||
FragmentAutocomplete.test.cpp | ||
Frontend.test.cpp | ||
Generalization.test.cpp | ||
InsertionOrderedMap.test.cpp | ||
Instantiation2.test.cpp | ||
IostreamOptional.h | ||
IrBuilder.test.cpp | ||
IrCallWrapperX64.test.cpp | ||
IrLowering.test.cpp | ||
IrRegAllocX64.test.cpp | ||
JsonEmitter.test.cpp | ||
Lexer.test.cpp | ||
Linter.test.cpp | ||
LValue.test.cpp | ||
main.cpp | ||
Module.test.cpp | ||
NonstrictMode.test.cpp | ||
NonStrictTypeChecker.test.cpp | ||
Normalize.test.cpp | ||
NotNull.test.cpp | ||
Parser.test.cpp | ||
RegisterCallbacks.cpp | ||
RegisterCallbacks.h | ||
Repl.test.cpp | ||
RequireByString.test.cpp | ||
RequireTracer.test.cpp | ||
RuntimeLimits.test.cpp | ||
ScopedFlags.h | ||
Set.test.cpp | ||
SharedCodeAllocator.test.cpp | ||
Simplify.test.cpp | ||
StringUtils.test.cpp | ||
Subtyping.test.cpp | ||
Symbol.test.cpp | ||
ToDot.test.cpp | ||
TopoSort.test.cpp | ||
ToString.test.cpp | ||
Transpiler.test.cpp | ||
TxnLog.test.cpp | ||
TypeFunction.test.cpp | ||
TypeFunction.user.test.cpp | ||
TypeInfer.aliases.test.cpp | ||
TypeInfer.annotations.test.cpp | ||
TypeInfer.anyerror.test.cpp | ||
TypeInfer.builtins.test.cpp | ||
TypeInfer.cfa.test.cpp | ||
TypeInfer.classes.test.cpp | ||
TypeInfer.definitions.test.cpp | ||
TypeInfer.functions.test.cpp | ||
TypeInfer.generics.test.cpp | ||
TypeInfer.intersectionTypes.test.cpp | ||
TypeInfer.loops.test.cpp | ||
TypeInfer.modules.test.cpp | ||
TypeInfer.negations.test.cpp | ||
TypeInfer.oop.test.cpp | ||
TypeInfer.operators.test.cpp | ||
TypeInfer.primitives.test.cpp | ||
TypeInfer.provisional.test.cpp | ||
TypeInfer.refinements.test.cpp | ||
TypeInfer.singletons.test.cpp | ||
TypeInfer.tables.test.cpp | ||
TypeInfer.test.cpp | ||
TypeInfer.tryUnify.test.cpp | ||
TypeInfer.typePacks.test.cpp | ||
TypeInfer.typestates.test.cpp | ||
TypeInfer.unionTypes.test.cpp | ||
TypeInfer.unknownnever.test.cpp | ||
TypePack.test.cpp | ||
TypePath.test.cpp | ||
TypeVar.test.cpp | ||
Unifier2.test.cpp | ||
Variant.test.cpp | ||
VecDeque.test.cpp | ||
VisitType.test.cpp |