[webkit-changes] [WebKit/WebKit] 292964: 32-bit macro assemblers should support `roundTowar...

jjgriego noreply at github.com
Tue Aug 22 11:45:18 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 292964e14c7136830d5fcc7cf946b196f8430026
      https://github.com/WebKit/WebKit/commit/292964e14c7136830d5fcc7cf946b196f8430026
  Author: Joseph Griego <jgriego at igalia.com>
  Date:   2023-08-22 (Tue, 22 Aug 2023)

  Changed paths:
    M Source/JavaScriptCore/assembler/ARMv7Assembler.h
    M Source/JavaScriptCore/assembler/MIPSAssembler.h
    M Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
    M Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h

  Log Message:
  -----------
  32-bit macro assemblers should support `roundTowardsNearestIntDouble`
https://bugs.webkit.org/show_bug.cgi?id=260525

Reviewed by Yusuke Suzuki.

As title, this is used now for Uint8ClampedArray; for now, only implement the
needed rounding instruction in these assemblers--admittedly, the generated code
is a little silly, e.g. on MIPS:

              0x71afe4d0: round.w.d $f2, $f0
              0x71afe4d4: cvt.d.w $f2, $f2
              0x71afe4d8: trunc.w.d $f16, $f2

... but it is correct; to avoid the extra instructions, we'd need a different macro
assembler instruction for these rounding semantics that converts straight to a
GPR instead of an FPR; can send that as a followup patch but this gets things
working.

* Source/JavaScriptCore/assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::vcvt_floatingPointToSignedNearest):
* Source/JavaScriptCore/assembler/MIPSAssembler.h:
(JSC::MIPSAssembler::roundwd):
* Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::roundTowardNearestIntDouble):
* Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::roundTowardNearestIntDouble):

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




More information about the webkit-changes mailing list