Skip to content

Commit b3a938d

Browse files
committed
Bug 1944011 - Part 31: Generate boilerplate for LWasmCompareExchangeI64. r=jandem
These are almost the same everywhere, except that the operands are sometimes in a different order... Differential Revision: https://phabricator.services.mozilla.com/D235804
1 parent 55571d1 commit b3a938d

File tree

6 files changed

+42
-133
lines changed

6 files changed

+42
-133
lines changed

js/src/jit/LIROps.yaml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4962,7 +4962,13 @@
49624962
gen_boilerplate: false
49634963

49644964
- name: WasmCompareExchangeI64
4965-
gen_boilerplate: false
4965+
result_type: Int64
4966+
operands:
4967+
memoryBase: WordSized
4968+
ptr: WordSized
4969+
expected: Int64
4970+
replacement: Int64
4971+
mir_op: WasmCompareExchangeHeap
49664972

49674973
- name: WasmAtomicBinopI64
49684974
result_type: Int64
@@ -5066,7 +5072,13 @@
50665072
gen_boilerplate: false
50675073

50685074
- name: WasmCompareExchangeI64
5069-
gen_boilerplate: false
5075+
result_type: Int64
5076+
operands:
5077+
ptr: WordSized
5078+
expected: Int64
5079+
replacement: Int64
5080+
memoryBase: WordSized
5081+
mir_op: WasmCompareExchangeHeap
50705082

50715083
- name: WasmAtomicBinopI64
50725084
result_type: Int64
@@ -5172,7 +5184,13 @@
51725184
gen_boilerplate: false
51735185

51745186
- name: WasmCompareExchangeI64
5175-
gen_boilerplate: false
5187+
result_type: Int64
5188+
operands:
5189+
ptr: WordSized
5190+
oldValue: Int64
5191+
newValue: Int64
5192+
memoryBase: WordSized
5193+
mir_op: WasmCompareExchangeHeap
51765194

51775195
- name: WasmAtomicBinopI64
51785196
result_type: Int64
@@ -5230,7 +5248,13 @@
52305248
gen_boilerplate: false
52315249

52325250
- name: WasmCompareExchangeI64
5233-
gen_boilerplate: false
5251+
result_type: Int64
5252+
operands:
5253+
ptr: WordSized
5254+
oldValue: Int64
5255+
newValue: Int64
5256+
memoryBase: WordSized
5257+
mir_op: WasmCompareExchangeHeap
52345258

52355259
- name: WasmAtomicBinopI64
52365260
result_type: Int64
@@ -5276,7 +5300,13 @@
52765300
mir_op: true
52775301

52785302
- name: WasmCompareExchangeI64
5279-
gen_boilerplate: false
5303+
result_type: Int64
5304+
operands:
5305+
ptr: WordSized
5306+
oldValue: Int64
5307+
newValue: Int64
5308+
memoryBase: WordSized
5309+
mir_op: WasmCompareExchangeHeap
52805310

52815311
- name: WasmAtomicBinopI64
52825312
result_type: Int64
@@ -5322,7 +5352,13 @@
53225352
mir_op: true
53235353

53245354
- name: WasmCompareExchangeI64
5325-
gen_boilerplate: false
5355+
result_type: Int64
5356+
operands:
5357+
ptr: WordSized
5358+
oldValue: Int64
5359+
newValue: Int64
5360+
memoryBase: WordSized
5361+
mir_op: WasmCompareExchangeHeap
53265362

53275363
- name: WasmAtomicBinopI64
53285364
result_type: Int64

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -306,31 +306,6 @@ class LWasmAtomicStoreI64 : public LInstructionHelper<0, 2 + INT64_PIECES, 2> {
306306
const LDefinition* tmpHigh() { return getTemp(1); }
307307
};
308308

309-
class LWasmCompareExchangeI64
310-
: public LInstructionHelper<INT64_PIECES, 2 + 2 * INT64_PIECES, 0> {
311-
public:
312-
LIR_HEADER(WasmCompareExchangeI64);
313-
314-
LWasmCompareExchangeI64(const LAllocation& ptr,
315-
const LInt64Allocation& expected,
316-
const LInt64Allocation& replacement,
317-
const LAllocation& memoryBase)
318-
: LInstructionHelper(classOpcode) {
319-
setOperand(0, ptr);
320-
setInt64Operand(1, expected);
321-
setInt64Operand(1 + INT64_PIECES, replacement);
322-
setOperand(1 + 2 * INT64_PIECES, memoryBase);
323-
}
324-
325-
MWasmCompareExchangeHeap* mir() const {
326-
return mir_->toWasmCompareExchangeHeap();
327-
}
328-
const LAllocation* ptr() { return getOperand(0); }
329-
LInt64Allocation expected() { return getInt64Operand(1); }
330-
LInt64Allocation replacement() { return getInt64Operand(1 + INT64_PIECES); }
331-
const LAllocation* memoryBase() { return getOperand(1 + 2 * INT64_PIECES); }
332-
};
333-
334309
} // namespace jit
335310
} // namespace js
336311

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -132,32 +132,6 @@ class LUDivOrMod : public LBinaryMath<0> {
132132
}
133133
};
134134

135-
class LWasmCompareExchangeI64
136-
: public LInstructionHelper<INT64_PIECES, 2 + INT64_PIECES + INT64_PIECES,
137-
0> {
138-
public:
139-
LIR_HEADER(WasmCompareExchangeI64);
140-
141-
LWasmCompareExchangeI64(const LAllocation& ptr,
142-
const LInt64Allocation& oldValue,
143-
const LInt64Allocation& newValue,
144-
const LAllocation& memoryBase)
145-
: LInstructionHelper(classOpcode) {
146-
setOperand(0, ptr);
147-
setInt64Operand(1, oldValue);
148-
setInt64Operand(1 + INT64_PIECES, newValue);
149-
setOperand(1 + 2 * INT64_PIECES, memoryBase);
150-
}
151-
152-
const LAllocation* ptr() { return getOperand(0); }
153-
LInt64Allocation oldValue() { return getInt64Operand(1); }
154-
LInt64Allocation newValue() { return getInt64Operand(1 + INT64_PIECES); }
155-
const LAllocation* memoryBase() { return getOperand(1 + 2 * INT64_PIECES); }
156-
const MWasmCompareExchangeHeap* mir() const {
157-
return mir_->toWasmCompareExchangeHeap();
158-
}
159-
};
160-
161135
class LDivOrModI64 : public LBinaryMath<1> {
162136
public:
163137
LIR_HEADER(DivOrModI64)

js/src/jit/mips-shared/LIR-mips-shared.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -207,32 +207,6 @@ class LWasmUnalignedStoreI64
207207
}
208208
};
209209

210-
class LWasmCompareExchangeI64
211-
: public LInstructionHelper<INT64_PIECES, 2 + INT64_PIECES + INT64_PIECES,
212-
0> {
213-
public:
214-
LIR_HEADER(WasmCompareExchangeI64);
215-
216-
LWasmCompareExchangeI64(const LAllocation& ptr,
217-
const LInt64Allocation& oldValue,
218-
const LInt64Allocation& newValue,
219-
const LAllocation& memoryBase)
220-
: LInstructionHelper(classOpcode) {
221-
setOperand(0, ptr);
222-
setInt64Operand(1, oldValue);
223-
setInt64Operand(1 + INT64_PIECES, newValue);
224-
setOperand(1 + 2 * INT64_PIECES, memoryBase);
225-
}
226-
227-
const LAllocation* ptr() { return getOperand(0); }
228-
LInt64Allocation oldValue() { return getInt64Operand(1); }
229-
LInt64Allocation newValue() { return getInt64Operand(1 + INT64_PIECES); }
230-
const LAllocation* memoryBase() { return getOperand(1 + 2 * INT64_PIECES); }
231-
const MWasmCompareExchangeHeap* mir() const {
232-
return mir_->toWasmCompareExchangeHeap();
233-
}
234-
};
235-
236210
} // namespace jit
237211
} // namespace js
238212

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -132,32 +132,6 @@ class LUDivOrMod : public LBinaryMath<0> {
132132
}
133133
};
134134

135-
class LWasmCompareExchangeI64
136-
: public LInstructionHelper<INT64_PIECES, 2 + INT64_PIECES + INT64_PIECES,
137-
0> {
138-
public:
139-
LIR_HEADER(WasmCompareExchangeI64);
140-
141-
LWasmCompareExchangeI64(const LAllocation& ptr,
142-
const LInt64Allocation& oldValue,
143-
const LInt64Allocation& newValue,
144-
const LAllocation& memoryBase)
145-
: LInstructionHelper(classOpcode) {
146-
setOperand(0, ptr);
147-
setInt64Operand(1, oldValue);
148-
setInt64Operand(1 + INT64_PIECES, newValue);
149-
setOperand(1 + 2 * INT64_PIECES, memoryBase);
150-
}
151-
152-
const LAllocation* ptr() { return getOperand(0); }
153-
LInt64Allocation oldValue() { return getInt64Operand(1); }
154-
LInt64Allocation newValue() { return getInt64Operand(1 + INT64_PIECES); }
155-
const LAllocation* memoryBase() { return getOperand(1 + 2 * INT64_PIECES); }
156-
const MWasmCompareExchangeHeap* mir() const {
157-
return mir_->toWasmCompareExchangeHeap();
158-
}
159-
};
160-
161135
class LDivOrModI64 : public LBinaryMath<1> {
162136
public:
163137
LIR_HEADER(DivOrModI64)

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -192,30 +192,6 @@ class LWasmAtomicStoreI64 : public LInstructionHelper<0, 2 + INT64_PIECES, 2> {
192192
const LDefinition* t2() { return getTemp(1); }
193193
};
194194

195-
class LWasmCompareExchangeI64
196-
: public LInstructionHelper<INT64_PIECES, 2 + 2 * INT64_PIECES, 0> {
197-
public:
198-
LIR_HEADER(WasmCompareExchangeI64);
199-
200-
LWasmCompareExchangeI64(const LAllocation& memoryBase, const LAllocation& ptr,
201-
const LInt64Allocation& expected,
202-
const LInt64Allocation& replacement)
203-
: LInstructionHelper(classOpcode) {
204-
setOperand(0, memoryBase);
205-
setOperand(1, ptr);
206-
setInt64Operand(2, expected);
207-
setInt64Operand(2 + INT64_PIECES, replacement);
208-
}
209-
210-
MWasmCompareExchangeHeap* mir() const {
211-
return mir_->toWasmCompareExchangeHeap();
212-
}
213-
const LAllocation* memoryBase() { return getOperand(0); }
214-
const LAllocation* ptr() { return getOperand(1); }
215-
LInt64Allocation expected() { return getInt64Operand(2); }
216-
LInt64Allocation replacement() { return getInt64Operand(2 + INT64_PIECES); }
217-
};
218-
219195
} // namespace jit
220196
} // namespace js
221197

0 commit comments

Comments
 (0)