Skip to content

Commit b931008

Browse files
ylzsxAmi-zhang
authored andcommitted
[LoongArch][CodeGen] Implement 128-bit and 256-bit vector shuffle. (llvm#100054)
[LoongArch][CodeGen] Implement 128-bit and 256-bit vector shuffle operations. In LoongArch, shuffle operations can be divided into two types: - Single-vector shuffle: Shuffle using only one vector, with the other vector being `undef` or not selected by mask. This can be expanded to instructions such as `vreplvei` and `vshuf4i`. - Two-vector shuffle: Shuflle using two vectors. This can be expanded to instructions like `vilv[l/h]`, `vpack[ev/od]`, `vpick[ev/od]` and the basic `vshuf`. In the future, more optimizations may be added, such as handling 1-bit vectors and processing single element patterns, etc. (cherry picked from commit 464ea88) Change-Id: I1ea504e1c0d394cc56c48e04ea32cb990c5bd31e
1 parent dae4195 commit b931008

17 files changed

+2160
-5
lines changed

clang/lib/Driver/ToolChains/Arch/LoongArch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,15 @@ void loongarch::getLoongArchTargetFeatures(const Driver &D,
216216
// Option -msimd=lsx depends on 64-bit FPU.
217217
// -m*-float and -mfpu=none/0/32 conflict with -mlsx.
218218
if (llvm::find(Features, "-d") != Features.end())
219-
D.Diag(diag::err_drv_loongarch_wrong_fpu_width) << /*LSX*/ 0;
219+
D.Diag(diag::err_drv_loongarch_wrong_fpu_width_for_lsx);
220220
// The previous option does not contain feature -lsx.
221221
else if (llvm::find(Features, "-lsx") == Features.end())
222222
Features.push_back("+lsx");
223223
} else if (MSIMD == "lasx") {
224224
// Option -msimd=lasx depends on 64-bit FPU and LSX.
225225
// -m*-float and -mfpu=none/0/32 conflict with -mlsx.
226226
if (llvm::find(Features, "-d") != Features.end())
227-
D.Diag(diag::err_drv_loongarch_wrong_fpu_width) << /*LASX*/ 1;
227+
D.Diag(diag::err_drv_loongarch_wrong_fpu_width_for_lasx);
228228
else if (llvm::find(Features, "-lsx") != Features.end())
229229
D.Diag(diag::err_drv_loongarch_invalid_simd_option_combination);
230230
// The previous option does not contain feature -lasx.

0 commit comments

Comments
 (0)