This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add bfp and bfpw intrinsic in zbf extension
ClosedPublic

Authored by Jimerlife on Jan 10 2022, 11:41 PM.

Diff Detail

Event Timeline

Jimerlife created this revision.Jan 10 2022, 11:41 PM
Jimerlife requested review of this revision.Jan 10 2022, 11:41 PM
craig.topper added inline comments.Jan 11 2022, 12:01 AM
clang/include/clang/Basic/BuiltinsRISCV.def
36

Capital Z

37

I think we should have __builtin_riscv_bfp_32 and __builtin_riscv_bfp_64. It's more convenient and portable for software to be written in terms of number of bits being operated on rather than changing behavior based on xlen.

llvm/include/llvm/IR/IntrinsicsRISCV.td
98

We only need one intrinsic. BitManipGPRGPRIntrinsics is type overloaded. We can check the type in isel patterns.

Jimerlife edited the summary of this revision. (Show Details)

According to machine target, write two intrinsic builtin_riscv_bfp_rv32 and builtin_riscv_bfp_rv64.
Support __builtin_riscv_bfp_rv32 used in RV64 target.

Jimerlife added inline comments.Jan 11 2022, 11:19 PM
clang/include/clang/Basic/BuiltinsRISCV.def
36

done

37

I have rewrite two intrinsics according to target machine

llvm/include/llvm/IR/IntrinsicsRISCV.td
98

Only save one intrinsic pattern.

Jimerlife marked 3 inline comments as done.Jan 11 2022, 11:24 PM
Jimerlife updated this revision to Diff 399281.Jan 12 2022, 3:13 AM

format code

This revision is now accepted and ready to land.Jan 12 2022, 9:46 AM
This revision was landed with ongoing or failed builds.Jan 12 2022, 6:54 PM
This revision was automatically updated to reflect the committed changes.