<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>282901</bug_id>
          
          <creation_ts>2024-11-10 10:25:08 -0800</creation_ts>
          <short_desc>[RISCV] Using lshift64 in MacroAssembler for RISCV</short_desc>
          <delta_ts>2024-12-10 01:24:13 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="MingZhu Yan">yanmingzhu</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>david.abd+webkit</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2074144</commentid>
    <comment_count>0</comment_count>
    <who name="MingZhu Yan">yanmingzhu</who>
    <bug_when>2024-11-10 10:25:08 -0800</bug_when>
    <thetext>Meet this error during compiling on my riscv64gc board.

```txt
/home/debian/repo/WebKit/Source/JavaScriptCore/assembler/MacroAssembler.h:1044:9: error: no matching member function for call to &apos;lshift64’
        lshift64(imm, shiftAmount, dest);
        ^~~~~~~~
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2074146</commentid>
    <comment_count>1</comment_count>
    <who name="MingZhu Yan">yanmingzhu</who>
    <bug_when>2024-11-10 10:34:56 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/36463</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075690</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-11-17 10:26:13 -0800</bug_when>
    <thetext>&lt;rdar://problem/140078409&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2076214</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-11-19 12:21:54 -0800</bug_when>
    <thetext>Committed 286814@main (9eb4f2a6c659): &lt;https://commits.webkit.org/286814@main&gt;

Reviewed commits have been landed. Closing PR #36463 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2080145</commentid>
    <comment_count>4</comment_count>
    <who name="">david.abd+webkit</who>
    <bug_when>2024-12-09 02:56:06 -0800</bug_when>
    <thetext>I am compiling webkitgtk-2.47.2 and still see this or similar issue. I checked `Source/JavaScriptCore/assembler/MacroAssembler.h` to make sure that the file is OK.

It seems there are 6 implementations for lshift32 and 5 for lshift64. I assume it needs `void lshift64(TrustedImm32 imm, RegisterID shiftAmount, RegisterID dest)`, which is not implemented. ARM64 has all 6 implemented.  Same for X86_64. I didn&apos;t check the rest.

Error:
```
builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp
In file included from /builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:28:
In file included from /builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/bytecode/ArithProfile.h:28:
In file included from /builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/jit/GPRInfo.h:28:
In file included from /builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/assembler/MacroAssembler.h:85:
/builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h:4612:17: warning: enumeration value &apos;Carry&apos; not handled in switch [-Wswitch]
 4612 |         switch (cond) {
      |                 ^~~~
In file included from /builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:28:
In file included from /builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/bytecode/ArithProfile.h:28:
In file included from /builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/jit/GPRInfo.h:28:
/builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/assembler/MacroAssembler.h:1054:9: error: no matching member function for call to &apos;lshift64&apos;
 1054 |         lshift64(imm, shiftAmount, dest);
      |         ^~~~~~~~
/builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h:678:10: note: candidate function not viable: no known conversion from &apos;TrustedImm32&apos; to &apos;RegisterID&apos; (aka &apos;JSC::RISCV64Registers::RegisterID&apos;) for 1st argument
  678 |     void lshift64(RegisterID src, RegisterID shiftAmount, RegisterID dest)
      |          ^        ~~~~~~~~~~~~~~
/builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h:695:10: note: candidate function not viable: no known conversion from &apos;TrustedImm32&apos; to &apos;Address&apos; for 1st argument
  695 |     void lshift64(Address src, RegisterID shiftAmount, RegisterID dest)
      |          ^        ~~~~~~~~~~~
/builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h:688:10: note: candidate function not viable: no known conversion from &apos;TrustedImm32&apos; to &apos;RegisterID&apos; (aka &apos;JSC::RISCV64Registers::RegisterID&apos;) for 1st argument
  688 |     void lshift64(RegisterID src, TrustedImm32 imm, RegisterID dest)
      |          ^        ~~~~~~~~~~~~~~
/builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h:683:10: note: candidate function not viable: requires 2 arguments, but 3 were provided
  683 |     void lshift64(TrustedImm32 shiftAmount, RegisterID dest)
      |          ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/webkitgtk-2.47.2-build/webkitgtk-2.47.2/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h:673:10: note: candidate function not viable: requires 2 arguments, but 3 were provided
  673 |     void lshift64(RegisterID shiftAmount, RegisterID dest)
      |          ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2080182</commentid>
    <comment_count>5</comment_count>
    <who name="MingZhu Yan">yanmingzhu</who>
    <bug_when>2024-12-09 06:03:46 -0800</bug_when>
    <thetext>Re-opening for pull request https://github.com/WebKit/WebKit/pull/37639</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2080186</commentid>
    <comment_count>6</comment_count>
    <who name="MingZhu Yan">yanmingzhu</who>
    <bug_when>2024-12-09 06:10:40 -0800</bug_when>
    <thetext>I can also reproduce this error; I might have forgotten to commit it before.
I just submitted a new PR that at least allows the build pass</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2080214</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-12-09 09:00:21 -0800</bug_when>
    <thetext>Committed 287553@main (c8bc3a81f32f): &lt;https://commits.webkit.org/287553@main&gt;

Reviewed commits have been landed. Closing PR #37639 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2080458</commentid>
    <comment_count>8</comment_count>
    <who name="">david.abd+webkit</who>
    <bug_when>2024-12-10 01:24:13 -0800</bug_when>
    <thetext>I can confirm that https://github.com/WebKit/WebKit/pull/37639 fixed the compilation error. I still cannot build, but that&apos;s another compile issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>