riscv-isac icon indicating copy to clipboard operation
riscv-isac copied to clipboard

updates for crypto scalar instructions

Open anku-anand opened this issue 2 years ago • 6 comments

anku-anand avatar Mar 28 '22 11:03 anku-anand

In the Bitmanip or crypto scalar spec, zext.h is not mentioned as pseudo instruction. Only zext.w is mentioned as pseudo instruction for add.uw, zext.w is not included in the spec. zext.h is only in zbb spec. pack and packw are only in zbkb. In the instruction decoder we can use the isa string to differentiate between zext.h and packw or pack with rs2 as x0.

anku-anand avatar Apr 11 '22 19:04 anku-anand

In the Bitmanip or crypto scalar spec, zext.h is not mentioned as pseudo instruction. Only zext.w is mentioned as pseudo instruction for add.uw, zext.w is not included in the spec. zext.h is only in zbb spec. pack and packw are only in zbkb. In the instruction decoder we can use the isa string to differentiate between zext.h and packw or pack with rs2 as x0.

This causes the same problem as before. What if both the nodes are present in the cgf? Then the decoder will always give out the instruction as zext.h.

pawks avatar Apr 12 '22 05:04 pawks

Hi,

Even if both the instructions are in the same cgf, the config part of the instructions are different. zext will have zbb and pack, packw will have zbkb. Since zext and pack will be in different isa spec, ISA strings mentioned in the config can be used to differentiate.

Also, so far for each spec we have a separate signature file. I am not sure if we will have zbb and zbkb in the same cgf.

Thanks & Regards, Anand

On Tue, Apr 12, 2022 at 11:15 AM S Pawan Kumar @.***> wrote:

In the Bitmanip or crypto scalar spec, zext.h is not mentioned as pseudo instruction. Only zext.w is mentioned as pseudo instruction for add.uw, zext.w is not included in the spec. zext.h is only in zbb spec. pack and packw are only in zbkb. In the instruction decoder we can use the isa string to differentiate between zext.h and packw or pack with rs2 as x0.

This causes the same problem as before. What if both the nodes are present in the cgf? Then the decoder will always give out the instruction as zext.h.

— Reply to this email directly, view it on GitHub https://github.com/riscv-software-src/riscv-isac/pull/34#issuecomment-1096100185, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECK3Y2ATGWYNK24EGJI6S3VEUEWXANCNFSM5R2YZ6PA . You are receiving this because you authored the thread.Message ID: @.***>

anku-anand avatar Apr 12 '22 06:04 anku-anand

This might work out for the current use case. But it is not a complete solution. Even though the config nodes are different, if both are present in the same cgf, the problem persists. I am not inclined to go down this route as it is a hack for a single scenario. For example this will be extremely problematic to implement for the other decoder (for example the one based on rvopcodes). We need to follow the same philosophy as followed in the rvopcodes. The instructions are always decoded/expressed in terms of the base instruction only.

pawks avatar Apr 12 '22 13:04 pawks

Updated cgf to use base_op and p_op_cond for pseudo instructions. Removed the condition to check for labels.

anku-anand avatar May 24 '22 11:05 anku-anand