This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Re-define sha256, Zksed, and Zksh intrinsics to use i32 types.
ClosedPublic

Authored by craig.topper on Jul 6 2023, 12:55 PM.

Details

Summary

Previously we returned i32 on RV32 and i64 on RV64. The instructions
only consume 32 bits and only produce 32 bits. For RV64, the result
is sign extended to 64 bits like *W instructions.

This patch removes this detail from the interface to improve
portability and consistency. This matches the proposal for scalar
intrinsics here https://github.com/riscv-non-isa/riscv-c-api-doc/pull/44

I've included IR autoupgrade support as well.

I'll be doing this for other builtins/intrinsics that currently use
'long' in other patches.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 6 2023, 12:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2023, 12:55 PM
craig.topper requested review of this revision.Jul 6 2023, 12:55 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 6 2023, 12:55 PM

Rebase and add the missing autoupgrade tests

This revision is now accepted and ready to land.Jul 15 2023, 5:07 AM
VincentWu added a comment.EditedJul 15 2023, 5:14 AM

What about combine the rv32 and rv64 testcase into one file, since they are entire same.

VincentWu requested changes to this revision.Jul 15 2023, 5:15 AM
This revision now requires changes to proceed.Jul 15 2023, 5:15 AM

Rebase. Will merge tests next.

Merge identical tests

This revision is now accepted and ready to land.Jul 17 2023, 1:04 AM
This revision was landed with ongoing or failed builds.Jul 17 2023, 8:59 AM
This revision was automatically updated to reflect the committed changes.
clang/test/CodeGen/RISCV/rvk-intrinsics/riscv64-zksed.c