Skip to content

Commit 79083ed

Browse files
committed
Bug 1944011 - Part 28: Generate boilerplate for WasmTruncateToInt64. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D235801
1 parent 7ad995c commit 79083ed

File tree

11 files changed

+38
-121
lines changed

11 files changed

+38
-121
lines changed

js/src/jit/LIROps.yaml

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4942,7 +4942,11 @@
49424942
gen_boilerplate: false
49434943

49444944
- name: WasmTruncateToInt64
4945-
gen_boilerplate: false
4945+
result_type: Int64
4946+
operands:
4947+
input: WordSized
4948+
num_temps: 1
4949+
mir_op: true
49464950

49474951
- name: Int64ToFloatingPoint
49484952
result_type: WordSized
@@ -4984,7 +4988,11 @@
49844988
gen_boilerplate: false
49854989

49864990
- name: WasmTruncateToInt64
4987-
gen_boilerplate: false
4991+
result_type: Int64
4992+
operands:
4993+
input: WordSized
4994+
num_temps: 1
4995+
mir_op: true
49884996

49894997
- name: Int64ToFloatingPoint
49904998
result_type: WordSized
@@ -5031,7 +5039,12 @@
50315039
mir_op: BuiltinInt64ToFloatingPoint
50325040

50335041
- name: WasmTruncateToInt64
5034-
gen_boilerplate: false
5042+
result_type: Int64
5043+
operands:
5044+
input: WordSized
5045+
instance: WordSized
5046+
call_instruction: true
5047+
mir_op: WasmBuiltinTruncateToInt64
50355048

50365049
- name: WasmAtomicLoadI64
50375050
gen_boilerplate: false
@@ -5072,7 +5085,10 @@
50725085
gen_boilerplate: false
50735086

50745087
- name: WasmTruncateToInt64
5075-
gen_boilerplate: false
5088+
result_type: Int64
5089+
operands:
5090+
input: WordSized
5091+
mir_op: true
50765092

50775093
- name: Int64ToFloatingPoint
50785094
result_type: WordSized
@@ -5098,7 +5114,10 @@
50985114
gen_boilerplate: false
50995115

51005116
- name: WasmTruncateToInt64
5101-
gen_boilerplate: false
5117+
result_type: Int64
5118+
operands:
5119+
input: WordSized
5120+
mir_op: true
51025121

51035122
- name: Int64ToFloatingPoint
51045123
result_type: WordSized
@@ -5149,7 +5168,10 @@
51495168
gen_boilerplate: false
51505169

51515170
- name: WasmTruncateToInt64
5152-
gen_boilerplate: false
5171+
result_type: Int64
5172+
operands:
5173+
input: WordSized
5174+
mir_op: true
51535175

51545176
- name: Int64ToFloatingPoint
51555177
result_type: WordSized
@@ -5193,7 +5215,10 @@
51935215
gen_boilerplate: false
51945216

51955217
- name: WasmTruncateToInt64
5196-
gen_boilerplate: false
5218+
result_type: Int64
5219+
operands:
5220+
input: WordSized
5221+
mir_op: true
51975222

51985223
- name: Int64ToFloatingPoint
51995224
result_type: WordSized
@@ -5225,7 +5250,10 @@
52255250
gen_boilerplate: false
52265251

52275252
- name: WasmTruncateToInt64
5228-
gen_boilerplate: false
5253+
result_type: Int64
5254+
operands:
5255+
input: WordSized
5256+
mir_op: true
52295257

52305258
- name: Int64ToFloatingPoint
52315259
result_type: WordSized

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

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

270-
class LWasmTruncateToInt64 : public LCallInstructionHelper<INT64_PIECES, 2, 0> {
271-
static const size_t Input = 0;
272-
static const size_t Instance = 1;
273-
274-
public:
275-
LIR_HEADER(WasmTruncateToInt64);
276-
277-
LWasmTruncateToInt64(const LAllocation& in, const LAllocation& instance)
278-
: LCallInstructionHelper(classOpcode) {
279-
setOperand(Input, in);
280-
setOperand(Instance, instance);
281-
}
282-
283-
LAllocation* input() { return getOperand(Input); }
284-
LAllocation* instance() { return getOperand(Instance); }
285-
286-
MWasmBuiltinTruncateToInt64* mir() const {
287-
return mir_->toWasmBuiltinTruncateToInt64();
288-
}
289-
};
290-
291270
class LWasmAtomicLoadI64 : public LInstructionHelper<INT64_PIECES, 2, 0> {
292271
public:
293272
LIR_HEADER(WasmAtomicLoadI64);

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,6 @@ class LUMod : public LBinaryMath<0> {
171171
MMod* mir() { return mir_->toMod(); }
172172
};
173173

174-
class LWasmTruncateToInt64 : public LInstructionHelper<1, 1, 0> {
175-
public:
176-
LIR_HEADER(WasmTruncateToInt64);
177-
178-
explicit LWasmTruncateToInt64(const LAllocation& in)
179-
: LInstructionHelper(classOpcode) {
180-
setOperand(0, in);
181-
}
182-
183-
MWasmTruncateToInt64* mir() const { return mir_->toWasmTruncateToInt64(); }
184-
};
185-
186174
class LDivOrModI64 : public LBinaryMath<0> {
187175
public:
188176
LIR_HEADER(DivOrModI64)

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -275,18 +275,6 @@ class LUDivOrModI64 : public LBinaryMath<1> {
275275
}
276276
};
277277

278-
class LWasmTruncateToInt64 : public LInstructionHelper<1, 1, 0> {
279-
public:
280-
LIR_HEADER(WasmTruncateToInt64);
281-
282-
explicit LWasmTruncateToInt64(const LAllocation& in)
283-
: LInstructionHelper(classOpcode) {
284-
setOperand(0, in);
285-
}
286-
287-
MWasmTruncateToInt64* mir() const { return mir_->toWasmTruncateToInt64(); }
288-
};
289-
290278
} // namespace jit
291279
} // namespace js
292280

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 LWasmTruncateToInt64 : public LCallInstructionHelper<INT64_PIECES, 1, 0> {
143-
public:
144-
LIR_HEADER(WasmTruncateToInt64);
145-
146-
explicit LWasmTruncateToInt64(const LAllocation& in)
147-
: LCallInstructionHelper(classOpcode) {
148-
setOperand(0, in);
149-
}
150-
151-
MWasmTruncateToInt64* mir() const { return mir_->toWasmTruncateToInt64(); }
152-
};
153-
154142
class LWasmAtomicLoadI64 : public LInstructionHelper<INT64_PIECES, 1, 0> {
155143
public:
156144
LIR_HEADER(WasmAtomicLoadI64);

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,6 @@ class LUDivOrModI64 : public LBinaryMath<1> {
113113
}
114114
};
115115

116-
class LWasmTruncateToInt64 : public LInstructionHelper<1, 1, 0> {
117-
public:
118-
LIR_HEADER(WasmTruncateToInt64);
119-
120-
explicit LWasmTruncateToInt64(const LAllocation& in)
121-
: LInstructionHelper(classOpcode) {
122-
setOperand(0, in);
123-
}
124-
125-
MWasmTruncateToInt64* mir() const { return mir_->toWasmTruncateToInt64(); }
126-
};
127-
128116
} // namespace jit
129117
} // namespace js
130118

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -275,18 +275,6 @@ class LUDivOrModI64 : public LBinaryMath<1> {
275275
}
276276
};
277277

278-
class LWasmTruncateToInt64 : public LInstructionHelper<1, 1, 0> {
279-
public:
280-
LIR_HEADER(WasmTruncateToInt64);
281-
282-
explicit LWasmTruncateToInt64(const LAllocation& in)
283-
: LInstructionHelper(classOpcode) {
284-
setOperand(0, in);
285-
}
286-
287-
MWasmTruncateToInt64* mir() const { return mir_->toWasmTruncateToInt64(); }
288-
};
289-
290278
} // namespace jit
291279
} // namespace js
292280

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ void CodeGenerator::visitWasmTruncateToInt64(LWasmTruncateToInt64* lir) {
897897
addOutOfLineCode(ool, mir);
898898

899899
FloatRegister temp =
900-
mir->isUnsigned() ? ToFloatRegister(lir->temp()) : InvalidFloatReg;
900+
mir->isUnsigned() ? ToFloatRegister(lir->temp0()) : InvalidFloatReg;
901901

902902
Label* oolEntry = ool->entry();
903903
Label* oolRejoin = ool->rejoin();

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,6 @@ class LUDivOrModI64 : public LBinaryMath<1> {
122122
}
123123
};
124124

125-
class LWasmTruncateToInt64 : public LInstructionHelper<1, 1, 1> {
126-
public:
127-
LIR_HEADER(WasmTruncateToInt64);
128-
129-
LWasmTruncateToInt64(const LAllocation& in, const LDefinition& temp)
130-
: LInstructionHelper(classOpcode) {
131-
setOperand(0, in);
132-
setTemp(0, temp);
133-
}
134-
135-
MWasmTruncateToInt64* mir() const { return mir_->toWasmTruncateToInt64(); }
136-
137-
const LDefinition* temp() { return getTemp(0); }
138-
};
139-
140125
} // namespace jit
141126
} // namespace js
142127

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ void CodeGenerator::visitWasmTruncateToInt64(LWasmTruncateToInt64* lir) {
11231123
Register64 output = ToOutRegister64(lir);
11241124

11251125
MWasmTruncateToInt64* mir = lir->mir();
1126-
FloatRegister floatTemp = ToFloatRegister(lir->temp());
1126+
FloatRegister floatTemp = ToFloatRegister(lir->temp0());
11271127

11281128
Label fail, convert;
11291129

0 commit comments

Comments
 (0)