mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-27 03:44:14 +01:00
Fix MoveRegister
to clear when value is 0
The register wouldn't be cleared with a `MOVZ` when a value was zero due to the condition for writing an instruction requiring the `offsetValue` to be non-zero.
This commit is contained in:
parent
f7ab3abb86
commit
8892eb08e6
@ -257,13 +257,11 @@ namespace skyline::nce {
|
|||||||
|
|
||||||
for (auto &instruction : instructions) {
|
for (auto &instruction : instructions) {
|
||||||
auto offsetValue{*(valuePointer + offset)};
|
auto offsetValue{*(valuePointer + offset)};
|
||||||
if (offsetValue) {
|
if (!zeroed) {
|
||||||
if (zeroed) {
|
|
||||||
instruction = instructions::Movk(destination, offsetValue, offset).raw;
|
|
||||||
} else {
|
|
||||||
instruction = instructions::Movz(destination, offsetValue, offset).raw;
|
instruction = instructions::Movz(destination, offsetValue, offset).raw;
|
||||||
zeroed = true;
|
zeroed = true;
|
||||||
}
|
} else if (offsetValue && zeroed) {
|
||||||
|
instruction = instructions::Movk(destination, offsetValue, offset).raw;
|
||||||
} else {
|
} else {
|
||||||
instruction = 0;
|
instruction = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user