Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 40a9116442c908d0497fe3d5bb9d5393ee42a18a
https://github.com/WebKit/WebKit/commit/40a9116442c908d0497fe3d5bb9d5393ee42a18a
Author: Yusuke Suzuki <[email protected]>
Date: 2026-02-17 (Tue, 17 Feb 2026)
Changed paths:
M Source/JavaScriptCore/b3/B3LowerToAir.cpp
M Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp
M Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp
M Source/JavaScriptCore/b3/air/AirArg.h
M Source/JavaScriptCore/b3/air/AirFixPartialRegisterStalls.cpp
M Source/JavaScriptCore/b3/air/AirOpcode.opcodes
M Source/JavaScriptCore/b3/air/AirUseCounts.h
M Source/JavaScriptCore/b3/air/opcode_generator.rb
M Source/JavaScriptCore/b3/air/testair.cpp
M Source/JavaScriptCore/b3/testb3.h
M Source/JavaScriptCore/b3/testb3_1.cpp
M Source/JavaScriptCore/b3/testb3_8.cpp
Log Message:
-----------
[JSC] Air Greedy Register Allocator should handle FP constants
https://bugs.webkit.org/show_bug.cgi?id=308019
rdar://170516740
Reviewed by Dan Hecht.
Let's support full fledged FP constants handling in Air Greedy Register
Allocator.
1. Remove Move32ToFloat / Move64ToDouble / Move128ToVector with FPImm to
MoveFloat / MoveDouble / MoveVector, which is now well aligned to
what Move / Move32 are doing.
2. Remove MoveZeroToFloat / MoveZeroToDouble / MoveZeroToVector and use
MoveFloat / MoveDouble / MoveVector with 0 FPImm instead. This makes
0 constant handling easy and simple.
3. AirUseCounts tracks FP constants too.
4. Air Greedy Register Allocator handles FP constants rematerialization
in the same way to GP constants rematerialization. Now since we use
MoveFloat / MoveDouble / MoveVector for constant materialization, it
is easy to convert arg to FPImm (since loading from spills is also
using the same instructions).
Tests: Source/JavaScriptCore/b3/air/testair.cpp
Source/JavaScriptCore/b3/testb3_1.cpp
Source/JavaScriptCore/b3/testb3_8.cpp
* Source/JavaScriptCore/b3/B3LowerToAir.cpp:
* Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp:
* Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp:
(JSC::B3::Air::Greedy::GreedyAllocator::initSpillCosts):
(JSC::B3::Air::Greedy::GreedyAllocator::trySplitIntraBlock):
(JSC::B3::Air::Greedy::GreedyAllocator::emitSpillCodeAndEnqueueNewTmps):
* Source/JavaScriptCore/b3/air/AirArg.h:
(JSC::B3::Air::Arg::isFPImmZero const):
* Source/JavaScriptCore/b3/air/AirFixPartialRegisterStalls.cpp:
(JSC::B3::Air::fixPartialRegisterStalls):
* Source/JavaScriptCore/b3/air/AirOpcode.opcodes:
* Source/JavaScriptCore/b3/air/AirUseCounts.h:
(JSC::B3::Air::UseCounts::UseCounts):
(JSC::B3::Air::UseCounts::constant const):
(JSC::B3::Air::UseCounts::constantWidth const):
* Source/JavaScriptCore/b3/air/opcode_generator.rb:
* Source/JavaScriptCore/b3/air/testair.cpp:
* Source/JavaScriptCore/b3/testb3.h:
* Source/JavaScriptCore/b3/testb3_1.cpp:
(run):
* Source/JavaScriptCore/b3/testb3_8.cpp:
(testConstDoubleZero):
(testConstDoubleNegativeZero):
(testConstFloatZero):
(testConstFloatNegativeZero):
(testConstDoubleAddZero):
(testConstFloatAddZero):
(testConstDoubleCompareZero):
(testConstFloatCompareZero):
(testConstDoubleSelectZero):
(testConstFloatSelectZero):
(testConstDoubleMultipleZeroUses):
(testConstFloatMultipleZeroUses):
Canonical link: https://commits.webkit.org/307724@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications