Skip to content

Conversation

ivan999
Copy link

@ivan999 ivan999 commented Jun 16, 2025

GcnDecodeContext private methods structure has been changed.
getEncodingLength, getOpMapOffset have been deleted.

GetInstructionEncoding function has been deleted.
Logic from this function has been put to a set of new private methods.

The main idea was to reduce repeating of the switch cases.

Small corrections have been added too:
32 bits encodings methods parameter has been changed in the header file to u32, to be the same as in the cpp file.
InstEncoding::ILLEGAL is not needed anymore, so it has been removed.

@ivan999
Copy link
Author

ivan999 commented Jun 16, 2025

I have changed the formatting to pass the clang check.

@ivan999
Copy link
Author

ivan999 commented Jun 17, 2025

I have changed the order of checking the codes in the purpose to clarify the most frequently used codes faster.

output

VOP1, VOPC, and VOP2 can be checked first because they're the only instruction types with the top bit (bit 31) set to 0.

Among them, VOP1 and VOPC should be checked before VOP2, because their encodings are identified using the top 7 bits (MASK_7bit), which provides more specificity than the single top bit used by VOP2 (MASK_1bit).

This way, VOP1 and VOPC won’t accidentally be misclassified as VOP2.

@ivan999 ivan999 changed the title Reduced amount of switch cases during instruction decoding Changed the order of defining the current code Jun 17, 2025
@ivan999
Copy link
Author

ivan999 commented Jun 20, 2025

I haven't changed anything in the last version not be able to build the project on MacOS.

@ivan999
Copy link
Author

ivan999 commented Jun 20, 2025

I merged with main, maybe I had been loosing some fixes before...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant