[meta] MIPS support in SpiderMonkey
Categories
(Core :: JavaScript Engine, task, P5)
Tracking
()
People
(Reporter: tcampbell, Unassigned)
References
(Depends on 4 open bugs, Blocks 1 open bug)
Details
(Keywords: meta)
MIPS is not an officially supported platform, but we still receive contributed bug fixes and reports for it. This meta bug is to keep track of those issues.
This includes both 32 and 64 bit MIPS.
Comment 1•4 years ago
|
||
Currently neither mips32 nor mips64 compile (with emulator support). I am increasingly of the opinion that this is dead code.
Comment 2•4 years ago
|
||
(In reply to Lars T Hansen [:lth] from comment #1)
Currently neither mips32 nor mips64 compile (with emulator support). I am increasingly of the opinion that this is dead code.
Currently the js could compile and run on my mips64el machine, and pass almost all tests, but the mips32 port may be broken a long time ago.
The mips64el emulator will crash due to unaligned load/store, and some of these instructions seem to be emitted by baseline compiler.
Such as: https://searchfox.org/mozilla-central/source/js/src/jit/BaselineCodeGen.cpp#384, it use a load32() on an unaligned address, and mips' emulator requires the address to be aligned , other platforms seem to be fine with such unaligned operations.
Since the code is shared by all platforms, I'm not sure how to fix it.
- If the unaligned operation is a bug, then the fix will help to fix mips emulator too.
- If the unaligned operation is supposed to emitted, then could we change the load32() here to load32Unaligned()?
- Or we can just remove the mips emulator's address check? Since the code currently could run my mips64el machine, but not in emulator. But it may affect the performance on mips machines that without hardware level unaligned operations support.
Thanks!
Comment 3•4 years ago
|
||
(In reply to Zhao Jiazhong from comment #2)
it use a load32() on an unaligned address, and mips' emulator requires the address to be aligned , other platforms seem to be fine with such unaligned operations.
We could change it to load32Unaligned
?
Comment 4•4 years ago
|
||
I filed a bug to fix MIPS64 compilation. There are some warnings too but I ignored them for now.
Comment 5•4 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #3)
We could change it to
load32Unaligned
?
Okay, I will find out other unaligned operations like load32 here and see if I can fix the mips64 emulator.
(In reply to Lars T Hansen [:lth] from comment #4)
I filed a bug to fix MIPS64 compilation. There are some warnings too but I ignored them for now.
Thanks! I only tried the release mode, and missed this bug.
Comment 6•4 years ago
•
|
||
So, with fixes for bug 1699686, bug 1699689, and bug 1699696 i'm to the point where the mips64 simulator runs the wasm jit-tests. I still hit some assertions (when running with MIPS_UNALIGNED=1 to filter out alignment issues):
Hit MOZ_CRASH(call) at /home/lhansen/m-u/js/src/jit/mips64/Simulator-mips64.cpp:2224
results from unsupported simulator ABI, there are very many of these errors, and after a little investigation, Clang reports that 20 signature types are not supported.
Assertion failure: rt != scratch, at /home/lhansen/m-u/js/src/jit/mips64/MacroAssembler-mips64.cpp:439
is some register management problem but I haven't looked deeper. There are very many of these too, especially when running the spec tests. They seem to be caused by the ScratchRegister being used without the ScratchRegisterScope (or the bugs would have been noticed a long time ago); this problem seems to be widespread in the MIPS macroassembler files.
There are also several segfaults.
Altogether, 674 tests failed, 1510 tests passed (69% pass rate), 16 timeouts.
It would be good to have these problems addressed so that we have a stable test bed for MIPS64 too. We try to account for MIPS in the wasm compilers, but without any way of testing what we do it's hard to say that that's worth the effort.
Comment 7•4 years ago
|
||
(In reply to Zhao Jiazhong from comment #2)
(In reply to Lars T Hansen [:lth] from comment #1)
Currently neither mips32 nor mips64 compile (with emulator support). I am increasingly of the opinion that this is dead code.
Currently the js could compile and run on my mips64el machine, and pass almost all tests, ...
The mips64el emulator will crash due to unaligned load/store, ...
Even with the unalign problems bypassed and some other problems fixed there are a number of additional problems here, see comment 6. Some of these (the assertion on the call instruction) are emulator-only issues that it would be good to have fixed (so that we can test with the emulator), but others (the assembler assertions) are possibly bugs in native builds too, and probably higher priority to fix.
Comment 8•4 years ago
|
||
Thanks for your infomation, I will test the native debug build.
Comment 9•4 years ago
|
||
Note: the branchTestValue
changes in this patch will also have to be ported to MIPS.
Comment 10•4 years ago
|
||
(In reply to Iain Ireland [:iain] from comment #9)
Note: the
branchTestValue
changes in this patch will also have to be ported to MIPS.
Thanks for your information! I ported the patch to mips64 at https://phabricator.services.mozilla.com/D111234.
Description
•