[a64] Fix `OPCODE_SPLAT`

Writing to the wrong register!
This commit is contained in:
Wunkolo 2024-05-10 20:49:42 -07:00
parent 207e2c11fd
commit de040f0b42
1 changed files with 8 additions and 8 deletions

View File

@ -1062,9 +1062,9 @@ struct SPLAT_I8 : Sequence<SPLAT_I8, I<OPCODE_SPLAT, V128Op, I8Op>> {
static void Emit(A64Emitter& e, const EmitArgType& i) {
if (i.src1.is_constant) {
e.MOV(W0, i.src1.constant());
e.DUP(Q0.B16(), W0);
e.DUP(i.dest.reg().B16(), W0);
} else {
e.DUP(Q0.B16(), i.src1);
e.DUP(i.dest.reg().B16(), i.src1);
}
}
};
@ -1072,9 +1072,9 @@ struct SPLAT_I16 : Sequence<SPLAT_I16, I<OPCODE_SPLAT, V128Op, I16Op>> {
static void Emit(A64Emitter& e, const EmitArgType& i) {
if (i.src1.is_constant) {
e.MOV(W0, i.src1.constant());
e.DUP(Q0.H8(), W0);
e.DUP(i.dest.reg().H8(), W0);
} else {
e.DUP(Q0.H8(), i.src1);
e.DUP(i.dest.reg().H8(), i.src1);
}
}
};
@ -1082,9 +1082,9 @@ struct SPLAT_I32 : Sequence<SPLAT_I32, I<OPCODE_SPLAT, V128Op, I32Op>> {
static void Emit(A64Emitter& e, const EmitArgType& i) {
if (i.src1.is_constant) {
e.MOV(W0, i.src1.constant());
e.DUP(Q0.S4(), W0);
e.DUP(i.dest.reg().S4(), W0);
} else {
e.DUP(Q0.S4(), i.src1);
e.DUP(i.dest.reg().S4(), i.src1);
}
}
};
@ -1092,9 +1092,9 @@ struct SPLAT_F32 : Sequence<SPLAT_F32, I<OPCODE_SPLAT, V128Op, F32Op>> {
static void Emit(A64Emitter& e, const EmitArgType& i) {
if (i.src1.is_constant) {
e.MOV(W0, i.src1.value->constant.i32);
e.DUP(Q0.S4(), W0);
e.DUP(i.dest.reg().S4(), W0);
} else {
e.DUP(Q0.S4(), i.src1.reg().toQ().Selem()[0]);
e.DUP(i.dest.reg().S4(), i.src1.reg().toQ().Selem()[0]);
}
}
};