[Clang][LoongArch] Implement __builtin_loongarch_crc_w_d_w builtin and add diagnostics
authorgonglingqin <gonglingqin@loongson.cn>
Thu, 10 Nov 2022 12:06:17 +0000 (20:06 +0800)
committergonglingqin <gonglingqin@loongson.cn>
Fri, 11 Nov 2022 01:16:57 +0000 (09:16 +0800)
commitda34aff90d2b08f8172dd4942e398fc0c012399c
tree53602a7275c1d282049f62d6b89d65352c1e1c2a
parentffb109b6852d248c9d2e3202477dccf20aac7151
[Clang][LoongArch] Implement __builtin_loongarch_crc_w_d_w builtin and add diagnostics

This patch adds support to prevent __builtin_loongarch_crc_w_d_w from compiling
on loongarch32 in the front end and adds diagnostics accordingly.

Reference: https://github.com/gcc-mirror/gcc/blob/master/gcc/config/loongarch/larchintrin.h#L175-L184

Depends on D136906

Differential Revision: https://reviews.llvm.org/D137316
16 files changed:
clang/include/clang/Basic/BuiltinsLoongArch.def
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Basic/Targets/LoongArch.cpp
clang/lib/Basic/Targets/LoongArch.h
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Headers/larchintrin.h
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/LoongArch/intrinsic-error.c [new file with mode: 0644]
clang/test/CodeGen/LoongArch/intrinsic-la64.c [new file with mode: 0644]
llvm/include/llvm/IR/IntrinsicsLoongArch.td
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
llvm/lib/Target/LoongArch/LoongArchISelLowering.h
llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
llvm/test/CodeGen/LoongArch/intrinsic-la32-error.ll [new file with mode: 0644]
llvm/test/CodeGen/LoongArch/intrinsic-la64.ll [new file with mode: 0644]