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

xUNPKD831 rd, rs1 insn should be an alias of SRxI16 rd, rs1, 8 #124

Open
marcfedorow opened this issue Dec 15, 2021 · 0 comments
Open

xUNPKD831 rd, rs1 insn should be an alias of SRxI16 rd, rs1, 8 #124

marcfedorow opened this issue Dec 15, 2021 · 0 comments

Comments

@marcfedorow
Copy link

marcfedorow commented Dec 15, 2021

xUNPKD821 is not that trivial so probably it may be an instruction. #37 comment says there is no usecase for it.

If unpack instructions are not too common, they probably should be implemented via shuffles and/or shifts, e.g.
ZUNPKD820 rd, rs1 => SLLI rd, rs1, 8; SRLI16 rd, rd, 8
ZUNPKD832 rd, rs1 => SHFLI rd, rs1, 8; SRLI16 rd, rd, 8
same for SUNPKD8XX with SRAI16

Other unpacks may be more tricky to implement in just two insns, e.g.
ZUNPKD810 rd, rs1 => URSTSA16 rd, rs1, rs1; SHFLI rd, rd, 8

Actually it seems like ZUNPKD8XY rd, rs1 may be generalized via XPERM8 rd, rs1, rs2.
RS2 will contain the following:

RS2 = ~0;
RS2.B[2] = X; RS2.B[0] = Y;
RS2.B[4+2] = 4+X; RS2.B[4+0] = 4+Y; // rv64

So effectively any ZUNPKD is a LI + XPERM8.
While thees are very specific constants, I am still not sure if it is effective (i.e. more effective then shift + shuffle + SIMD shift).

@marcfedorow marcfedorow changed the title xUNPKD820 rd, rs1 insn should be an alias of SRxI16 rd, rs1, 8 xUNPKD831 rd, rs1 insn should be an alias of SRxI16 rd, rs1, 8 Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant