Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

[BEQI/BNEI] map uimm=0 into -1 constant #209

@jnk0le

Description

@jnk0le

-1 is popular return error code.
It can also be used to check if arbitrary bitfield (>5 bits long) is or isn't all ones (after the slli+srai or p.extract or tio.sbfextracti)

V ext is already doing signed immediates from rs1 position, so there is rather medium/low value of sticking with exact Zicsr like uimm encoding.

To apply it to HCA, only the lambda needs to be modified:

https://github.com/riscv/riscv-code-size-reduction/blob/main/benchmarks/HCA/hca#L200

(lambda instruction: True if (int(instruction["Immediate"]) == -1) else utils.fit_in_field(int(instruction["Immediate"]),"unsigned",5)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    future ideaSomething for a future version of the spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions