This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] [1/2] Add intrinsic for Zbc extension
ClosedPublic

Authored by LevyHsu on Apr 1 2021, 2:46 AM.

Details

Summary

Head files are included in the second patch in case the name needs to be changed.

RV32 / 64:
clmul
clmulh
clmulr

Diff Detail

Event Timeline

LevyHsu created this revision.Apr 1 2021, 2:46 AM
LevyHsu requested review of this revision.Apr 1 2021, 2:46 AM
LevyHsu retitled this revision from [RISCV] [2/2] Add intrinsic for Zbc extension to [RISCV] [1/2] Add intrinsic for Zbc extension.Apr 1 2021, 2:47 AM
craig.topper added inline comments.Apr 1 2021, 6:38 PM
clang/include/clang/Basic/BuiltinsRISCV.def
22

I think we should drop the underscore in clmul_h and clmul_r. The mnemonic doesn't have a period between them. So that's different than orc.b and crc32.w.

llvm/include/llvm/IR/IntrinsicsRISCV.td
82

clmul_h -> clmulh
clmul_r -> clmulr

LevyHsu updated this revision to Diff 334882.Apr 1 2021, 7:13 PM
LevyHsu marked 2 inline comments as done.
  1. clang/include/clang/Basic/BuiltinsRISCV.def clang/lib/CodeGen/CGBuiltin.cpp llvm/include/llvm/IR/IntrinsicsRISCV.td clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbc.c clang/test/CodeGen/RISCV/rvb-intrinsics/riscv64-zbc.c
    • Renaming clmul_h clmul_r to clmulh clmulr
  1. llvm/test/CodeGen/RISCV/rv32zbc-intrinsic.ll llvm/test/CodeGen/RISCV/rv64zbc-intrinsic.ll
    • Renaming clmul.h clmul.r to clmulh clmulr
craig.topper accepted this revision.Apr 1 2021, 11:04 PM

LGTM. We can adjust the builtin names in the future if we need to do something different to match gcc.

This revision is now accepted and ready to land.Apr 1 2021, 11:04 PM
This revision was automatically updated to reflect the committed changes.