[webkit-changes] [WebKit/WebKit] c55d06: Could round rather than truncate in compileClampDo...

Keith Miller noreply at github.com
Mon Aug 21 11:57:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c55d0673236c1b2367cc0f820298c06d4967346d
      https://github.com/WebKit/WebKit/commit/c55d0673236c1b2367cc0f820298c06d4967346d
  Author: Keith Miller <keith_miller at apple.com>
  Date:   2023-08-21 (Mon, 21 Aug 2023)

  Changed paths:
    A JSTests/stress/uint8clamped-rounding-mode.js
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

  Log Message:
  -----------
  Could round rather than truncate in compileClampDoubleToByte?
https://bugs.webkit.org/show_bug.cgi?id=72054
rdar://113734964

Reviewed by Yusuke Suzuki.

Right now there's a difference between our non-optimizing code and our C++ code for ClampedUint8Arrays.
In the C++ code we correctly do a round to nearest (ties to even) but in the optimizing JITs we do a round to inifinity.
This patch fixes our optimizing code to round to nearest too.

* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::clampDoubleToByte):
(JSC::DFG::compileClampDoubleToByte):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

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




More information about the webkit-changes mailing list