Open heiher opened 1 day ago
Although the lasx
feature is not enabled in the LoongArch target specification, the CPU defaults to generic
. This is replaced in the LLVM backend with the la464
processor model, which includes the lasx
feature.
static MCSubtargetInfo *
createLoongArchMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) {
if (CPU.empty() || CPU == "generic")
CPU = TT.isArch64Bit() ? "la464" : "generic-la32";
return createLoongArchMCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS);
}
The issue was addressed in the llvm main branch by llvm/llvm-project#114922. I'll request a backport.
I tried this code:
I expected to see this happen:
The
simd
function was not compiled due to the missinglasx
feature.Instead, this happened:
The
simd
function was generated.Meta
rustc --version --verbose
:rustc -Z unstable-options --print target-spec-json
: