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

Shorter names, and consistency for instructions with immediate operands #46

Closed
grnewell opened this issue Sep 10, 2020 · 1 comment
Closed
Labels
specification Improvements or additions to the specification

Comments

@grnewell
Copy link

I suggest using shorter names where possible and where it's still a useful mnemonic. Also, I believe we should always indicate in the name if the instruction has an immediate operand by having an "i" suffix. Considering both of these recommendations and the earlier recommendations to delete the "s: prefix and remove dots in dissimilar instructions, I suggest renaming the following instructions:

(change "enc" to "e" and "dec" to "d" for brevity)

  • saes32.encs --> aes32esi (AES RV32 encrypt: sub-bytes, immediate)

  • saes32.encsm --> aes32esmi (AES RV32 encrypt: sub-bytes + mix-columns, immediate)

  • saes32.decs --> aes32dsi (AES RV32 decrypt: sub-bytes, immediate)

  • saes32.decsm --> aes32dsmi (AES RV32 decrypt: sub-bytes + mix-columns, immediate)

  • saes64.sk1 --> aes64ks1i (AES RV64 key-schedule "one" [sub-bytes, rotate, immediate round-constant])

  • saes64.ks2 --> aes64ks2 (AES RV64 key-schedule "two" [XOR summation])

  • saes64.imix --> aes64im (AES RV64 inverse-mix-columns)

  • saes64.encsm --> aes64esm (AES RV64 encrypt shift-rows, sub-bytes, mix-columns)

  • saes64.encs --> aes64es (AES RV64 encrypt shift-rows, sub-bytes)

  • saes64.decsm --> aes64dsm (AES RV64 decrypt shift-rows, sub-bytes, mix-columns)

  • saes64.ceds --> aes64ds (AES RV64 decrypt shift-rows, sub-bytes)
    (Should we also get rid of the "32" and "64" in these instruction names? The few resulting collisions could easily be disambiguated)

  • ssha256.sig0 --> sha256sig0 (SHA256 "sigma-zero" function) (both RV32 and RV64)

  • ssha256.sig1 --> sha256sig1 (SHA256 "sigma-one" function) (")

  • ssha256.sum0 --> sha256sum0 (SHA256 "sum-zero" function) (")

  • ssha256.sum1 --> sha256sum0 (SHA256 "sum-one" function) (")

  • ssha512.sum0r --> sha512sum0r (SHA512 "sum-zero" function w/ rotate) (RV32 only)

  • ssha512.sum1r --> sha512sum0r (SHA512 "sum-one" function w/ rotate) (")

  • ssha512.sig0l --> sha512sig0l (SHA512 "sigma-zero" function, low) (")

  • ssha512.sig0h --> sha512sig0h (SHA512 "sigma-zero" function, high) (")

  • ssha512.sig1l --> sha512sig1l (SHA512 "sigma-one" function, low) (")

  • ssha512.sig1h --> sha512sig1h (SHA512 "sigma-one" function, high) (")

  • ssha512.sum0 --> sha512sum0r (SHA512 "sum-zero" function) (RV64 only)

  • ssha512.sum1 --> sha512sum0r (SHA512 "sum-one" function) (")

  • ssha512.sig0 --> sha512sig0h (SHA512 "sigma-zero" function) (")

  • ssha512.sig1 --> sha512sig1l (SHA512 "sigma-one" function) (")

  • ssm3.p0 --> sm3p0 (SM3 "p-zero" function) (both RV32 and RV64)

  • ssm3.p1 --> sm3p1 (SM3 "p-one" function (")
    ssm4.ed --> sm4ed (SM4 encrypt-decrypt) (")
    ssm4.ks --> sm4ks (SM4 key-schedule) (")

  • pollentropy --> pollentropyi (both RV32 and RV64)
    (Should this be shortened? Twelve characters seems excessive)

@ben-marshall
Copy link
Member

Thanks for this! I will collate these into a table and send them out to the TG in an email.

@ben-marshall ben-marshall added the specification Improvements or additions to the specification label Sep 11, 2020
@ben-marshall ben-marshall added this to Instruction Specification in RISC-V Scalar Cryptography Extensions Sep 11, 2020
RISC-V Scalar Cryptography Extensions automation moved this from Instruction Specification to Finished Tasks Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
specification Improvements or additions to the specification
Projects
Development

No branches or pull requests

2 participants