Graphical-Micro-Architecture-Simulator icon indicating copy to clipboard operation
Graphical-Micro-Architecture-Simulator copied to clipboard

MOVZ & MOVK

Open Kyle-Mitchell opened this issue 2 years ago • 1 comments

717 registerFile[destReg] = immediate << quadrantShift; 726 registerFile[destReg] = registerFile[destReg] | (immediate << quadrantShift);

These two lines of code have immediate as int types. This causes issues with the results of MOVK and MOVZ. Some of the observed issues:

MOVZ X1, 0x8000, LSL #16 will result in X1 having a value of 0xffffffff80000000, this is a sign extended result where sign extension should not happen.

MOVZ X1, 0x8000, LSL #32 will result in X1 having a value of 0x8000.

MOVZ X1, 0x8000, LSL #48 will result in X1 having a value of 0xffffffff80000000, this is wrong in sign and distance.

I can not suggest a fix as I do not have a Java build environment handy.

Kyle-Mitchell avatar Feb 22 '23 23:02 Kyle-Mitchell

@Kyle-Mitchell if you are still interested in knowing how to build this project and make the changes yourself I have uploaded a tutorial in this pull request #7

simdeistud avatar Dec 07 '23 20:12 simdeistud