This revision implements IR Intrinsic support for RISCV Scalar Crypto extension according to the specification of version 1.0
Co-author:@ksyx & @VincentWu & @lihongliang & @achieveartificialintelligence
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/IR/IntrinsicsRISCV.td | ||
---|---|---|
1449 | one space before ":" |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
264 | This should be done in the else block where hasStdExtZbb() is handled. Zbp is for GREVI. | |
2925 | This should not be needed with the other change. | |
llvm/lib/Target/RISCV/RISCVInstrInfoZk.td | ||
24 | This needs to be rebased on the current Zk patch. | |
141 | There are no _K instructions in the most recent Zk patches. All Zb* related changes should be in RISCVInstrInfoZb.td |
llvm/include/llvm/IR/IntrinsicsRISCV.td | ||
---|---|---|
129 | Capital Z | |
130 | rev8 is the same as llvm.bswap.i32 or llvm.bswap.i64. We don't need an intrinsic for it. | |
1495 | Capitalize Z in the comments. | |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
282 | You want Zbkb in addition to Zbb here. | |
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td | ||
892 | This should stay Zbp only. | |
901 | This should stay Zbp only. | |
1196 | We don't need int_riscv_rev8. We can use bswap | |
llvm/test/CodeGen/RISCV/rv32zbc-zbkc-intrinsic.ll | ||
5 | Can we use a single check-prefix? | |
llvm/test/CodeGen/RISCV/rv32zbp-zbkb.ll | ||
7 ↗ | (On Diff #402875) | Can we use one check-prefix for Zbp and Zbkb? |
llvm/test/CodeGen/RISCV/rv64zbb-zbp-zbkb.ll | ||
9 ↗ | (On Diff #402875) | Can we use one check-prefix for Zbb, Zbp, and Zbkb? |
llvm/test/CodeGen/RISCV/rv64zbc-zbkc-intrinsic.ll | ||
5 | Can we use a single check-prefix? | |
llvm/test/CodeGen/RISCV/rv64zbp-zbkb.ll | ||
7 ↗ | (On Diff #402875) | Can we use one check-prefix for Zbp and Zbkb? |
llvm/test/CodeGen/RISCV/rv64zksed-intrinsic.ll | ||
14 | Something went wrong here | |
30 | And here |
llvm/lib/Target/RISCV/RISCV.td | ||
---|---|---|
175 | The string for Zbb was recently updated. Please update to match. | |
llvm/test/CodeGen/RISCV/rv32zbb-zbp-zbkb.ll | ||
9 ↗ | (On Diff #403139) | Can we share a prefix for Zbb/Zbp/Zbkb? |
llvm/test/CodeGen/RISCV/rv64zbb-zbp-zbkb.ll | ||
507 ↗ | (On Diff #403139) | This a bug that Zbp doesn't match Zbb. I'll fix it. You'll need to add Zbkb to RISCVTargetLowering::hasAndNotCompare in this patch. |
llvm/include/llvm/IR/IntrinsicsRISCV.td | ||
---|---|---|
1494 | Why does this intrinsic have the Returned attribute? |
llvm/include/llvm/IR/IntrinsicsRISCV.td | ||
---|---|---|
1494 | Maybe this is following the old 0.9.0 version that mixes the use of rs1/rd registers. |
llvm/include/llvm/IR/IntrinsicsRISCV.td | ||
---|---|---|
1494 | I see, but that was still a mistake. The Returned property means that the *value* passed into the argument is the *value* that is returned. Even if rd/rs1 are the same register, the operation still changes the value in that register. |
llvm/include/llvm/IR/IntrinsicsRISCV.td | ||
---|---|---|
1494 | Thanks for pointing out this as I may misunderstood this while implementing. |
llvm/include/llvm/IR/IntrinsicsRISCV.td | ||
---|---|---|
1494 | Thanks! I've committed in 352e19c. |
Capital Z