Bug 282901
| Summary: | [RISCV] Using lshift64 in MacroAssembler for RISCV | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | MingZhu Yan <yanmingzhu> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | david.abd+webkit, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
MingZhu Yan
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 'lshift64’
lshift64(imm, shiftAmount, dest);
^~~~~~~~
```
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
MingZhu Yan
Pull request: https://github.com/WebKit/WebKit/pull/36463
Radar WebKit Bug Importer
<rdar://problem/140078409>
EWS
Committed 286814@main (9eb4f2a6c659): <https://commits.webkit.org/286814@main>
Reviewed commits have been landed. Closing PR #36463 and removing active labels.
david.abd+webkit
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'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 'Carry' 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 'lshift64'
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 'TrustedImm32' to 'RegisterID' (aka 'JSC::RISCV64Registers::RegisterID') 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 'TrustedImm32' to 'Address' 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 'TrustedImm32' to 'RegisterID' (aka 'JSC::RISCV64Registers::RegisterID') 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.
```
MingZhu Yan
Re-opening for pull request https://github.com/WebKit/WebKit/pull/37639
MingZhu Yan
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
EWS
Committed 287553@main (c8bc3a81f32f): <https://commits.webkit.org/287553@main>
Reviewed commits have been landed. Closing PR #37639 and removing active labels.
david.abd+webkit
I can confirm that https://github.com/WebKit/WebKit/pull/37639 fixed the compilation error. I still cannot build, but that's another compile issue.