Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sw] rework intrinsics (e.g. for custom instructions) #263

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Jan 28, 2022

This PR is a rework of the "intrinsics" library (set of macros), which can be used to implement custom instructions, and also of the two applications that use these intrinsics (the FPU test program and the bit-manipulation test program).

The new intrinsics are far more convenient to handle as they can be used as plain C function without the need to pay attention to register allocation or any other background assembly issues (= intrinsics).

The following example uses a R2-format intrinsic to rebuild the add instruction as custom instruction:

uint32_t rs1 = 0x12345678;
uint32_t rs2 = some_function();
uint32_t res = CUSTOM_INSTR_R2_TYPE(0b0000000, rs2, rs1, 0b000, 0b0110011);

Thanks to @google for their CFU-Playground project, which provided the idea for the improved intrinsic macro library and also thanks to @umarcor for pointing that out to me.

@stnolting stnolting added enhancement New feature or request SW software-related labels Jan 28, 2022
@stnolting stnolting self-assigned this Jan 28, 2022
@stnolting stnolting changed the title [sw] rework intrinsics (custom instructions) [sw] rework intrinsics (e.g. for custom instructions) Jan 28, 2022
@stnolting stnolting marked this pull request as ready for review January 28, 2022 07:12
@stnolting stnolting merged commit 1dc777e into master Jan 28, 2022
@stnolting stnolting deleted the rework_intrinsics branch January 28, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SW software-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant