Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 00eff83b64f0a5eee31b293a86656c8e61b96a14
      
https://github.com/WebKit/WebKit/commit/00eff83b64f0a5eee31b293a86656c8e61b96a14
  Author: Dan Hecht <[email protected]>
  Date:   2025-09-15 (Mon, 15 Sep 2025)

  Changed paths:
    M Source/JavaScriptCore/offlineasm/x86.rb

  Log Message:
  -----------
  [JSC] Fix x86 offlineasm lowering of shift
https://bugs.webkit.org/show_bug.cgi?id=298882
rdar://160625576

Reviewed by Yusuke Suzuki.

On x86, when the shift-by is in a register, the register must be %cl.
The shift lowering code handled this with the following transformation:

When %rA != %ecx:

    shift %rA, %rB

    =>

    xchg %rA, %rcx
    shift %cl, %rB
    xchg %rA, %rcx

But this is incorrect when %rB is %rcx since the shift value/destination
lives in %rA for the duration of the shift instruction.

So, when %rB is %rcx, we should use %rA as the shift value/dest
operand of the shift instruction.

This bug appeared in IPInt _simd_*_bitmask but apparently does not
occur in any other offlineasm code.

Manually tested this by inspecting the resulting bitmask code and also
verifying that this fixes the IPInt SIMD bitmask
instructions on x86 using simd-instructions-bitwise.js.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to