This is an archive of the discontinued LLVM Phabricator instance.

[SiFive][RISCV][clang] Support C intrinsics for xsfvcp extension.
ClosedPublic

Authored by 4vtomat on Apr 13 2023, 6:07 AM.

Diff Detail

Event Timeline

4vtomat created this revision.Apr 13 2023, 6:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2023, 6:08 AM
4vtomat requested review of this revision.Apr 13 2023, 6:08 AM

We need SemaChecking.cpp code to check the range of the constant arguments.

craig.topper added inline comments.Apr 13 2023, 7:32 PM
clang/include/clang/Basic/riscv_vector.td
2422

redundant*

4vtomat updated this revision to Diff 513464.Apr 14 2023, 12:57 AM

Resolved Craig's comments.

4vtomat updated this revision to Diff 514810.Apr 18 2023, 7:52 PM

Resolved Kito's comment.

4vtomat updated this revision to Diff 514812.Apr 18 2023, 7:59 PM

Rename riscv_sifive_vcix.td to riscv_sifive_vector.td

craig.topper added inline comments.Apr 18 2023, 9:28 PM
clang/include/clang/Basic/riscv_sifive_vector.td
41 ↗(On Diff #514812)

Indent

64 ↗(On Diff #514812)

This should be indented further

4vtomat updated this revision to Diff 514821.Apr 18 2023, 10:18 PM

Resolved Craig's comments.

This revision is now accepted and ready to land.Apr 19 2023, 12:12 AM
craig.topper added inline comments.Apr 19 2023, 12:17 AM
clang/include/clang/Basic/riscv_sifive_vector.td
46 ↗(On Diff #514821)

We might consider breaking this class into 2 different classes. One for EncodeVtype=1 and EncodeVtype=0. The simplification might be worth the little bit of duplication.

4vtomat updated this revision to Diff 516596.Apr 24 2023, 7:33 PM

Resolved Craig's comment.

4vtomat updated this revision to Diff 516598.Apr 24 2023, 7:36 PM

Removed unnecessary comment.

kito-cheng accepted this revision.Apr 28 2023, 5:12 AM
kito-cheng added a subscriber: kito-cheng.

LGTM, but IMO the title should still contain [RISCV][clang]

4vtomat retitled this revision from [SiFive] Support C intrinsics for xsfvcp extension. to [SiFive][RISCV][clang] Support C intrinsics for xsfvcp extension..May 2 2023, 5:28 AM
TWeaver added a subscriber: TWeaver.May 2 2023, 7:20 AM

Hello and Good Afternoon from the UK,

I believe this revision has started the following build bot to start failing on these 5 tests:

https://lab.llvm.org/buildbot/#/builders/216/builds/20627

xsfvcp-x-rv64.c
xsfvcp-x.c
xsfvcp-xv.c
xsfvcp-xvv.c
xsfvcp-xvw.c

Is anyone able to take a look?

Thanks in advance,
Tom W

Hello and Good Afternoon from the UK,

I believe this revision has started the following build bot to start failing on these 5 tests:

https://lab.llvm.org/buildbot/#/builders/216/builds/20627

xsfvcp-x-rv64.c
xsfvcp-x.c
xsfvcp-xv.c
xsfvcp-xvv.c
xsfvcp-xvw.c

Is anyone able to take a look?

Thanks in advance,
Tom W

I'll take a look, thanks!

I'll take a look, thanks!

Much obliged and thanks for the speedy reply! 👍

4vtomat added a comment.EditedMay 2 2023, 7:55 AM

Hi @craig.topper and @kito-cheng , the build error message was: 'Z:\test\llvm-project\clang\test\CodeGen\RISCV\rvv-intrinsics-autogenerated\non-policy\non-overloaded\xsfvcp-x-rv64.c:4:10: fatal error: 'riscv_vector.h' file not found'.
Have you ever met this before? I'm not sure if I forgot to add something or not..

dyung added a subscriber: dyung.May 2 2023, 8:13 AM

Hi @craig.topper and @kito-cheng , the build error message was: 'Z:\test\llvm-project\clang\test\CodeGen\RISCV\rvv-intrinsics-autogenerated\non-policy\non-overloaded\xsfvcp-x-rv64.c:4:10: fatal error: 'riscv_vector.h' file not found'.
Have you ever met this before? I'm not sure if I forgot to add something or not..

This bot only builds the x86_64 backend. Isn’t that file only generated when the riscv backend is built?

Hi @craig.topper and @kito-cheng , the build error message was: 'Z:\test\llvm-project\clang\test\CodeGen\RISCV\rvv-intrinsics-autogenerated\non-policy\non-overloaded\xsfvcp-x-rv64.c:4:10: fatal error: 'riscv_vector.h' file not found'.
Have you ever met this before? I'm not sure if I forgot to add something or not..

I found it, seems I have to add this in the beginning of the file: '// REQUIRES: riscv-registered-target' to prevent the test case run in other targets.

Hi @craig.topper and @kito-cheng , the build error message was: 'Z:\test\llvm-project\clang\test\CodeGen\RISCV\rvv-intrinsics-autogenerated\non-policy\non-overloaded\xsfvcp-x-rv64.c:4:10: fatal error: 'riscv_vector.h' file not found'.
Have you ever met this before? I'm not sure if I forgot to add something or not..

This bot only builds the x86_64 backend. Isn’t that file only generated when the riscv backend is built?

Got it, I should add 'REQUIRES: riscv-registered-target' in the beginning of the file, thanks!!

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/xsfvcp-xvv-rv64.c