mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Issue #3049 - Adapt loongarch64 JIT glue to older JS APIs
This commit is contained in:
parent
acea3a2b6b
commit
9533e7734c
6 changed files with 33 additions and 16 deletions
|
|
@ -6570,7 +6570,7 @@ CodeGenerator::visitAbsI(LAbsI* ins)
|
|||
masm.branchTest32(Assembler::NotSigned, input, input, &positive);
|
||||
masm.neg32(input);
|
||||
LSnapshot* snapshot = ins->snapshot();
|
||||
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
|
||||
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64) || defined(JS_CODEGEN_LOONGARCH64)
|
||||
if (snapshot)
|
||||
bailoutCmp32(Assembler::Equal, input, Imm32(INT32_MIN), snapshot);
|
||||
#else
|
||||
|
|
@ -8428,7 +8428,7 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
|
|||
// If index > initializedLength, call a stub. Note that this relies on the
|
||||
// condition flags sticking from the incoming branch.
|
||||
Label callStub;
|
||||
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
|
||||
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64) || defined(JS_CODEGEN_LOONGARCH64)
|
||||
// Had to reimplement for MIPS because there are no flags.
|
||||
if (unboxedType == JSVAL_TYPE_MAGIC) {
|
||||
Address initLength(elements, ObjectElements::offsetOfInitializedLength());
|
||||
|
|
|
|||
|
|
@ -902,8 +902,8 @@ class MacroAssembler : public MacroAssemblerSpecific
|
|||
|
||||
inline void rotateLeft(Imm32 count, Register input, Register dest) PER_SHARED_ARCH;
|
||||
inline void rotateLeft(Register count, Register input, Register dest) PER_SHARED_ARCH;
|
||||
inline void rotateLeft64(Imm32 count, Register64 input, Register64 dest) DEFINED_ON(x64);
|
||||
inline void rotateLeft64(Register count, Register64 input, Register64 dest) DEFINED_ON(x64);
|
||||
inline void rotateLeft64(Imm32 count, Register64 input, Register64 dest) DEFINED_ON(x64, loongarch64);
|
||||
inline void rotateLeft64(Register count, Register64 input, Register64 dest) DEFINED_ON(x64, loongarch64);
|
||||
inline void rotateLeft64(Imm32 count, Register64 input, Register64 dest, Register temp)
|
||||
DEFINED_ON(x86, x64, arm, mips32, mips64, loongarch64);
|
||||
inline void rotateLeft64(Register count, Register64 input, Register64 dest, Register temp)
|
||||
|
|
@ -911,8 +911,8 @@ class MacroAssembler : public MacroAssemblerSpecific
|
|||
|
||||
inline void rotateRight(Imm32 count, Register input, Register dest) PER_SHARED_ARCH;
|
||||
inline void rotateRight(Register count, Register input, Register dest) PER_SHARED_ARCH;
|
||||
inline void rotateRight64(Imm32 count, Register64 input, Register64 dest) DEFINED_ON(x64);
|
||||
inline void rotateRight64(Register count, Register64 input, Register64 dest) DEFINED_ON(x64);
|
||||
inline void rotateRight64(Imm32 count, Register64 input, Register64 dest) DEFINED_ON(x64, loongarch64);
|
||||
inline void rotateRight64(Register count, Register64 input, Register64 dest) DEFINED_ON(x64, loongarch64);
|
||||
inline void rotateRight64(Imm32 count, Register64 input, Register64 dest, Register temp)
|
||||
DEFINED_ON(x86, x64, arm, mips32, mips64, loongarch64);
|
||||
inline void rotateRight64(Register count, Register64 input, Register64 dest, Register temp)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include "gc/Marking.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "jit/ExecutableAllocator.h"
|
||||
#include "vm/Realm.h"
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
|
|
@ -39,9 +38,7 @@ ABIArg ABIArgGenerator::next(MIRType type) {
|
|||
switch (type) {
|
||||
case MIRType::Int32:
|
||||
case MIRType::Int64:
|
||||
case MIRType::Pointer:
|
||||
case MIRType::RefOrNull:
|
||||
case MIRType::StackResults: {
|
||||
case MIRType::Pointer: {
|
||||
if (intRegIndex_ == NumIntArgRegs) {
|
||||
current_ = ABIArg(stackOffset_);
|
||||
stackOffset_ += sizeof(uintptr_t);
|
||||
|
|
@ -65,10 +62,6 @@ ABIArg ABIArgGenerator::next(MIRType type) {
|
|||
floatRegIndex_++;
|
||||
break;
|
||||
}
|
||||
case MIRType::Simd128: {
|
||||
MOZ_CRASH("LoongArch does not support simd yet.");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
MOZ_CRASH("Unexpected argument type");
|
||||
}
|
||||
|
|
@ -2283,7 +2276,7 @@ void Assembler::bind(RepatchLabel* label) {
|
|||
label->bind(dest.getOffset());
|
||||
}
|
||||
|
||||
void Assembler::Bind(uint8_t* rawCode, const CodeLabel& label) {
|
||||
void Assembler::Bind(uint8_t* rawCode, CodeLabel label) {
|
||||
if (label.patchAt()->bound()) {
|
||||
intptr_t offset = label.patchAt()->offset();
|
||||
intptr_t target = label.target()->offset();
|
||||
|
|
|
|||
|
|
@ -1804,8 +1804,13 @@ class Assembler : public AssemblerLOONGARCH64 {
|
|||
|
||||
using AssemblerLOONGARCH64::bind;
|
||||
|
||||
static void Bind(uint8_t* rawCode, const CodeLabel& label);
|
||||
static void Bind(uint8_t* rawCode, CodeLabel label);
|
||||
void bind(RepatchLabel* label);
|
||||
void bindLater(Label* label, wasm::TrapDesc target) {
|
||||
(void)label;
|
||||
(void)target;
|
||||
MOZ_CRASH("wasm trap patching is not supported on loongarch64 yet");
|
||||
}
|
||||
|
||||
void processCodeLabels(uint8_t* rawCode);
|
||||
|
||||
|
|
|
|||
|
|
@ -534,6 +534,11 @@ void MacroAssembler::rotateLeft(Imm32 count, Register input, Register dest) {
|
|||
as_rotri_w(dest, input, (32 - count.value) & 31);
|
||||
}
|
||||
|
||||
void MacroAssembler::rotateLeft64(Register count, Register64 src,
|
||||
Register64 dest) {
|
||||
rotateLeft64(count, src, dest, Register::Invalid());
|
||||
}
|
||||
|
||||
void MacroAssembler::rotateLeft64(Register count, Register64 src,
|
||||
Register64 dest, Register temp) {
|
||||
MOZ_ASSERT(temp == Register::Invalid());
|
||||
|
|
@ -542,6 +547,10 @@ void MacroAssembler::rotateLeft64(Register count, Register64 src,
|
|||
as_rotr_d(dest.reg, src.reg, scratch);
|
||||
}
|
||||
|
||||
void MacroAssembler::rotateLeft64(Imm32 count, Register64 src, Register64 dest) {
|
||||
rotateLeft64(count, src, dest, Register::Invalid());
|
||||
}
|
||||
|
||||
void MacroAssembler::rotateLeft64(Imm32 count, Register64 src, Register64 dest,
|
||||
Register temp) {
|
||||
MOZ_ASSERT(temp == Register::Invalid());
|
||||
|
|
@ -557,12 +566,21 @@ void MacroAssembler::rotateRight(Imm32 count, Register input, Register dest) {
|
|||
as_rotri_w(dest, input, count.value & 31);
|
||||
}
|
||||
|
||||
void MacroAssembler::rotateRight64(Register count, Register64 src,
|
||||
Register64 dest) {
|
||||
rotateRight64(count, src, dest, Register::Invalid());
|
||||
}
|
||||
|
||||
void MacroAssembler::rotateRight64(Register count, Register64 src,
|
||||
Register64 dest, Register temp) {
|
||||
MOZ_ASSERT(temp == Register::Invalid());
|
||||
as_rotr_d(dest.reg, src.reg, count);
|
||||
}
|
||||
|
||||
void MacroAssembler::rotateRight64(Imm32 count, Register64 src, Register64 dest) {
|
||||
rotateRight64(count, src, dest, Register::Invalid());
|
||||
}
|
||||
|
||||
void MacroAssembler::rotateRight64(Imm32 count, Register64 src, Register64 dest,
|
||||
Register temp) {
|
||||
MOZ_ASSERT(temp == Register::Invalid());
|
||||
|
|
|
|||
|
|
@ -550,6 +550,7 @@ class MacroAssemblerLOONGARCH64Compat : public MacroAssemblerLOONGARCH64 {
|
|||
}
|
||||
|
||||
void jump(JitCode* code) { branch(code); }
|
||||
void jump(wasm::TrapDesc target) { ma_b(target); }
|
||||
|
||||
void jump(ImmPtr ptr) {
|
||||
BufferOffset bo = m_buffer.nextOffset();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue