Skip to content

Commit aec9be6

Browse files
committed
Bug 1944011 - Part 32: Generate boilerplate for LWasmAtomicLoadI64. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D235805
1 parent b3a938d commit aec9be6

File tree

6 files changed

+18
-56
lines changed

6 files changed

+18
-56
lines changed

js/src/jit/LIROps.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4956,7 +4956,12 @@
49564956
mir_op: true
49574957

49584958
- name: WasmAtomicLoadI64
4959-
gen_boilerplate: false
4959+
result_type: Int64
4960+
operands:
4961+
memoryBase: WordSized
4962+
ptr: WordSized
4963+
num_temps64: 1
4964+
mir_op: WasmLoad
49604965

49614966
- name: WasmAtomicStoreI64
49624967
gen_boilerplate: false
@@ -5066,7 +5071,11 @@
50665071
mir_op: WasmBuiltinTruncateToInt64
50675072

50685073
- name: WasmAtomicLoadI64
5069-
gen_boilerplate: false
5074+
result_type: Int64
5075+
operands:
5076+
ptr: WordSized
5077+
memoryBase: WordSized
5078+
mir_op: WasmLoad
50705079

50715080
- name: WasmAtomicStoreI64
50725081
gen_boilerplate: false
@@ -5178,7 +5187,10 @@
51785187
gen_boilerplate: false
51795188

51805189
- name: WasmAtomicLoadI64
5181-
gen_boilerplate: false
5190+
result_type: Int64
5191+
operands:
5192+
ptr: WordSized
5193+
mir_op: WasmLoad
51825194

51835195
- name: WasmAtomicStoreI64
51845196
gen_boilerplate: false

js/src/jit/arm/LIR-arm.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -267,22 +267,6 @@ class LSoftUDivOrMod : public LBinaryCallInstructionHelper<1, 0> {
267267
MInstruction* mir() { return mir_->toInstruction(); }
268268
};
269269

270-
class LWasmAtomicLoadI64 : public LInstructionHelper<INT64_PIECES, 2, 0> {
271-
public:
272-
LIR_HEADER(WasmAtomicLoadI64);
273-
274-
explicit LWasmAtomicLoadI64(const LAllocation& ptr,
275-
const LAllocation& memoryBase)
276-
: LInstructionHelper(classOpcode) {
277-
setOperand(0, ptr);
278-
setOperand(1, memoryBase);
279-
}
280-
281-
MWasmLoad* mir() const { return mir_->toWasmLoad(); }
282-
const LAllocation* ptr() { return getOperand(0); }
283-
const LAllocation* memoryBase() { return getOperand(1); }
284-
};
285-
286270
class LWasmAtomicStoreI64 : public LInstructionHelper<0, 2 + INT64_PIECES, 2> {
287271
public:
288272
LIR_HEADER(WasmAtomicStoreI64);

js/src/jit/mips32/LIR-mips32.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,6 @@ class LUDivOrModI64
139139
}
140140
};
141141

142-
class LWasmAtomicLoadI64 : public LInstructionHelper<INT64_PIECES, 1, 0> {
143-
public:
144-
LIR_HEADER(WasmAtomicLoadI64);
145-
146-
LWasmAtomicLoadI64(const LAllocation& ptr) : LInstructionHelper(classOpcode) {
147-
setOperand(0, ptr);
148-
}
149-
150-
const LAllocation* ptr() { return getOperand(0); }
151-
const MWasmLoad* mir() const { return mir_->toWasmLoad(); }
152-
};
153-
154142
class LWasmAtomicStoreI64 : public LInstructionHelper<0, 1 + INT64_PIECES, 1> {
155143
public:
156144
LIR_HEADER(WasmAtomicStoreI64);

js/src/jit/x86/CodeGenerator-x86.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,8 @@ void CodeGenerator::visitWasmAtomicLoadI64(LWasmAtomicLoadI64* ins) {
438438
const LAllocation* ptr = ins->ptr();
439439
BaseIndex srcAddr(ToRegister(memoryBase), ToRegister(ptr), TimesOne, offset);
440440

441-
MOZ_ASSERT(ToRegister(ins->t1()) == ecx);
442-
MOZ_ASSERT(ToRegister(ins->t2()) == ebx);
443-
MOZ_ASSERT(ToOutRegister64(ins).high == edx);
444-
MOZ_ASSERT(ToOutRegister64(ins).low == eax);
441+
MOZ_ASSERT(ToRegister64(ins->temp0()) == Register64(ecx, ebx));
442+
MOZ_ASSERT(ToOutRegister64(ins) == Register64(edx, eax));
445443

446444
masm.wasmAtomicLoad64(ins->mir()->access(), srcAddr, Register64(ecx, ebx),
447445
Register64(edx, eax));

js/src/jit/x86/LIR-x86.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,6 @@ class LUDivOrModI64
149149
}
150150
};
151151

152-
class LWasmAtomicLoadI64 : public LInstructionHelper<INT64_PIECES, 2, 2> {
153-
public:
154-
LIR_HEADER(WasmAtomicLoadI64);
155-
156-
LWasmAtomicLoadI64(const LAllocation& memoryBase, const LAllocation& ptr,
157-
const LDefinition& t1, const LDefinition& t2)
158-
: LInstructionHelper(classOpcode) {
159-
setOperand(0, memoryBase);
160-
setOperand(1, ptr);
161-
setTemp(0, t1);
162-
setTemp(1, t2);
163-
}
164-
165-
MWasmLoad* mir() const { return mir_->toWasmLoad(); }
166-
const LAllocation* memoryBase() { return getOperand(0); }
167-
const LAllocation* ptr() { return getOperand(1); }
168-
const LDefinition* t1() { return getTemp(0); }
169-
const LDefinition* t2() { return getTemp(1); }
170-
};
171-
172152
class LWasmAtomicStoreI64 : public LInstructionHelper<0, 2 + INT64_PIECES, 2> {
173153
public:
174154
LIR_HEADER(WasmAtomicStoreI64);

js/src/jit/x86/Lowering-x86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ void LIRGenerator::visitWasmLoad(MWasmLoad* ins) {
381381
if (ins->access().type() == Scalar::Int64 && ins->access().isAtomic()) {
382382
auto* lir = new (alloc())
383383
LWasmAtomicLoadI64(useRegister(memoryBase), useRegister(base),
384-
tempFixed(ecx), tempFixed(ebx));
384+
tempInt64Fixed(Register64(ecx, ebx)));
385385
defineInt64Fixed(lir, ins,
386386
LInt64Allocation(LAllocation(AnyRegister(edx)),
387387
LAllocation(AnyRegister(eax))));

0 commit comments

Comments
 (0)