Skip to content

Commit a8381ce

Browse files
DinoVmeta-codesync[bot]
authored andcommitted
Fix a few issues with primitive handling
Summary: w1 is the "reg_general_auxilary_return_loc" so when setting errors/success we should use that umov reauires an index, we should use fmov The move to the floating point error indicator needs to use fmov too Reviewed By: yoney Differential Revision: D93679174 fbshipit-source-id: 347b46fc116fa366d507526a376d676ae0b789dd
1 parent 610de04 commit a8381ce

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cinderx/Jit/codegen/autogen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ void TranslateGuard(Environ* env, const Instruction* instr) {
269269
if (instr->getInput(2)->dataType() == jit::lir::OperandBase::kDouble) {
270270
JIT_CHECK(kind == kNotZero, "Only NotZero is supported for double")
271271
auto vecd_reg = AutoTranslator::getVecD(instr->getInput(2));
272-
as->umov(reg, vecd_reg);
272+
as->fmov(reg, vecd_reg);
273273
as->cbz(reg, deopt_label);
274274
is_double = true;
275275
} else {

cinderx/Jit/codegen/gen_asm.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ void* generateDeoptTrampoline(bool generator_mode) {
855855
// shared, we do this move unconditionally, but even if not needed, it's
856856
// harmless. (To eliminate it, we'd need another trampoline specifically for
857857
// deopt of primitive-returning functions, just to do this one move.)
858-
a.mov(a64::w2, a64::w0);
858+
a.mov(a64::w1, a64::w0);
859859
a.fmov(a64::d1, a64::x0);
860860

861861
annot.add("resumeInInterpreter", &a, annot_cursor);
@@ -2133,11 +2133,11 @@ void NativeGenerator::generateEpilogue(BaseNode* epilogue_cursor) {
21332133
if (func_->returnsPrimitive()) {
21342134
JIT_CHECK(!is_gen, "generators can't return primitives");
21352135
if (func_->returnsPrimitiveDouble()) {
2136-
// Loads an *integer* 1 in D0.. value doesn't matter,
2136+
// Loads an *integer* 1 in D1.. value doesn't matter,
21372137
// but it needs to be non-zero.
2138-
as_->movi(a64::d0, 1);
2138+
as_->fmov(a64::d1, 1.0);
21392139
} else {
2140-
as_->mov(a64::w2, 1);
2140+
as_->mov(a64::w1, 1);
21412141
}
21422142
}
21432143

@@ -3126,7 +3126,7 @@ NativeGenerator::generateBoxedReturnWrapper() {
31263126
as_->fmov(arch::reg_scratch_0, a64::d1);
31273127
as_->cbz(arch::reg_scratch_0, error);
31283128
} else {
3129-
as_->cmp(a64::w2, 0);
3129+
as_->cmp(a64::w1, 0);
31303130
as_->b_eq(box_done);
31313131
}
31323132

0 commit comments

Comments
 (0)