mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 07:17:30 +09:00
Issue #2313 - Implement WebAssembly sign extension opcodes. https://bugzilla.mozilla.org/show_bug.cgi?id=1389461
This commit is contained in:
parent
3798308cff
commit
61b73a894a
37 changed files with 444 additions and 33 deletions
|
|
@ -4973,7 +4973,7 @@ class MUrsh : public MShiftInstruction
|
|||
ALLOW_CLONE(MUrsh)
|
||||
};
|
||||
|
||||
class MSignExtend
|
||||
class MSignExtendInt32
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
|
|
@ -4986,7 +4986,7 @@ class MSignExtend
|
|||
private:
|
||||
Mode mode_;
|
||||
|
||||
MSignExtend(MDefinition* op, Mode mode)
|
||||
MSignExtendInt32(MDefinition* op, Mode mode)
|
||||
: MUnaryInstruction(op), mode_(mode)
|
||||
{
|
||||
setResultType(MIRType::Int32);
|
||||
|
|
@ -4994,17 +4994,67 @@ class MSignExtend
|
|||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(SignExtend)
|
||||
INSTRUCTION_HEADER(SignExtendInt32)
|
||||
TRIVIAL_NEW_WRAPPERS
|
||||
|
||||
Mode mode() { return mode_; }
|
||||
Mode mode() const { return mode_; }
|
||||
|
||||
MDefinition* foldsTo(TempAllocator& alloc) override;
|
||||
bool congruentTo(const MDefinition* ins) const override {
|
||||
if (!congruentIfOperandsEqual(ins))
|
||||
return false;
|
||||
return ins->isSignExtendInt32() && ins->toSignExtendInt32()->mode_ == mode_;
|
||||
}
|
||||
AliasSet getAliasSet() const override {
|
||||
return AliasSet::None();
|
||||
}
|
||||
|
||||
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
|
||||
bool canRecoverOnBailout() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
ALLOW_CLONE(MSignExtend)
|
||||
ALLOW_CLONE(MSignExtendInt32)
|
||||
};
|
||||
|
||||
class MSignExtendInt64
|
||||
: public MUnaryInstruction,
|
||||
public NoTypePolicy::Data
|
||||
{
|
||||
public:
|
||||
enum Mode {
|
||||
Byte,
|
||||
Half,
|
||||
Word
|
||||
};
|
||||
|
||||
private:
|
||||
Mode mode_;
|
||||
|
||||
MSignExtendInt64(MDefinition* op, Mode mode)
|
||||
: MUnaryInstruction(op), mode_(mode)
|
||||
{
|
||||
setResultType(MIRType::Int64);
|
||||
setMovable();
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(SignExtendInt64)
|
||||
TRIVIAL_NEW_WRAPPERS
|
||||
|
||||
Mode mode() const { return mode_; }
|
||||
|
||||
MDefinition* foldsTo(TempAllocator& alloc) override;
|
||||
bool congruentTo(const MDefinition* ins) const override {
|
||||
if (!congruentIfOperandsEqual(ins))
|
||||
return false;
|
||||
return ins->isSignExtendInt64() && ins->toSignExtendInt64()->mode_ == mode_;
|
||||
}
|
||||
AliasSet getAliasSet() const override {
|
||||
return AliasSet::None();
|
||||
}
|
||||
|
||||
ALLOW_CLONE(MSignExtendInt64)
|
||||
};
|
||||
|
||||
class MBinaryArithInstruction
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue