[webkit-changes] [WebKit/WebKit] c20c54: ARM64 MacroAssembler should support populationCoun...

Keith Miller noreply at github.com
Mon May 15 05:30:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c20c54c79ae66f9d644a52d2331702492da083e2
      https://github.com/WebKit/WebKit/commit/c20c54c79ae66f9d644a52d2331702492da083e2
  Author: Keith Miller <keith_miller at apple.com>
  Date:   2023-05-15 (Mon, 15 May 2023)

  Changed paths:
    M Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
    M Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h
    M Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp

  Log Message:
  -----------
  ARM64 MacroAssembler should support populationCount functions
https://bugs.webkit.org/show_bug.cgi?id=256771

Reviewed by Yusuke Suzuki.

Now that we have vector instructions we should support emitting inline code for population count. The new code matches the assembly emitted by GCC to do the population count. Clang uses a different instruction to sum the vector that we don't implement yet addlv vs GCC's addv. Although, those could be the synonyms for the same instruction, I didn't check.

* Source/JavaScriptCore/assembler/ARM64Assembler.h:
* Source/JavaScriptCore/assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::countPopulation32):
(JSC::MacroAssemblerARM64::countPopulation64):
(JSC::MacroAssemblerARM64::supportsCountPopulation):
* Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h:
(JSC::Wasm::ExpressionType>::addI32Popcnt):
(JSC::Wasm::ExpressionType>::addI64Popcnt):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addI32Popcnt):
(JSC::Wasm::B3IRGenerator::addI64Popcnt):
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::addI32Popcnt):
(JSC::Wasm::BBQJIT::addI64Popcnt):

Canonical link: https://commits.webkit.org/264068@main




More information about the webkit-changes mailing list