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

Intrinsics/Builtins: Support for custom argument names/order #151

Open
3 tasks
PhilippvK opened this issue Dec 13, 2024 · 1 comment
Open
3 tasks

Intrinsics/Builtins: Support for custom argument names/order #151

PhilippvK opened this issue Dec 13, 2024 · 1 comment

Comments

@PhilippvK
Copy link
Member

As far as I can tell the order and/or names of arguments used when defining and intrinsics (in the YAML settings) should match the assembly operands of the instruction definition.

The spec of the Core-V Extension builtins uses custom argument names (i.e. i,j instead of rs1,rs2) and places the "destination & accumulator" registers not at the front. Here is a concrete Examples:

  • int32_t __builtin_riscv_cv_mac_mac (int32_t x, int32_t y, int32_t z) (Source)

    Argument/result mapping:

    • result, z: rD
    • x: rs1
    • y: rs2

    Generated assembler:

    cv.mac  rD,rs1,rs2

We should...

  • Provide (optional) YAML syntax to define how the builtins' argument names map to the instructions' operands
  • Make sure that the order of arguments is generated as expected
  • Clarify (docstring/readme) how argument names of intrinsics are specified implicitly/explicitly
@thomasgoodfellow
Copy link
Collaborator

Agreed - as it happens the previous (phase 1) implementation for the assembler faced a similar problem for instructions with unconventional argument ordering. That solution was a hack; something neater needed here.

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

No branches or pull requests

2 participants