mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 12:41:50 +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) {
|
||||
auto offsetValue{*(valuePointer + offset)};
|
||||
if (offsetValue) {
|
||||
if (zeroed) {
|
||||
instruction = instructions::Movk(destination, offsetValue, offset).raw;
|
||||
} else {
|
||||
instruction = instructions::Movz(destination, offsetValue, offset).raw;
|
||||
zeroed = true;
|
||||
}
|
||||
if (!zeroed) {
|
||||
instruction = instructions::Movz(destination, offsetValue, offset).raw;
|
||||
zeroed = true;
|
||||
} else if (offsetValue && zeroed) {
|
||||
instruction = instructions::Movk(destination, offsetValue, offset).raw;
|
||||
} else {
|
||||
instruction = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user