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

Added instr_get_tab() #15

Merged
merged 4 commits into from
Dec 20, 2024
Merged

Added instr_get_tab() #15

merged 4 commits into from
Dec 20, 2024

Conversation

cheng-alvin
Copy link
Owner

This branch describes the introduction and implementation of the insert_get_tab(). As outlined in the commit messages, this function will take in a instruction structure and fetch the corresponding instruction encoder table by looking up a specific table and sorting through a list of identities, similar to quadratics if you recall from school ;).

cheng-alvin and others added 4 commits December 20, 2024 13:52
This commit added the `instr_get_tab()` function, this function
takes in the instruction in a `instruction_t` form and outputs the
instruction encoder tables required based off the instruction's
encooder identity from the `op_identify()` function implemented
in C++ in the `operand.cpp` file.

This function encapsulates the responsibilties of the `assemble()`
function and allows further optimisations by caching certain data,
but also allows it to be exposed to the callers of the library
As implemented in commit d382803,
a new function has taken over the looking up of the instruction
encder reference tables, this commit describes the changes required
to migrate the previous code and leveraging the new `instr_get_tab()`
funciton.

Now, the tables returned from the `instr_get_tab` can be cached and
other encoding instances (Since there are two passes of the assemb-
ler, one pre and one normal pass)inside the `assemble()` function
may reference the passed down `tabs` argument, preventing the dup-
licate invokation of the searching of the instruction encoder ref-
erence tables. (Well, yea its a small small optimisation but it could
potentially save time when indexing large sets of instructions)
Since the `IS_LABEL` macro is used in many modules, namely the
`codegen` and `instruction` modules, it has been exposed in this
header file. More consideration will be given to its exact "res-
ting place" in the future, this is just a place to stash a dec
for now until a new place is found.

Also, the corrisponding `instr_get_tab()` function, although lacking
documentation has been declared in this header file to allow the
`codegen` module among many other external modules and library users
to access the function in 1950a53:

> migrate the previous code and leveraging the new `instr_get_tab()`
> [function].
This commit added the previously missing documentation messages
that documented the functionality and parameters of the `instr_
get_tabs()` function
@cheng-alvin cheng-alvin added the enhancement New feature or request label Dec 20, 2024
@cheng-alvin cheng-alvin merged commit e908290 into main Dec 20, 2024
4 checks passed
@cheng-alvin cheng-alvin deleted the get-tab-func branch December 20, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant