[LoongArch] Fix '-mno-lsx' option not disabling LASX feature (#143821)
When '-march' with LASX feature and '-mno-lsx' options are used together, '-mno-lsx' fails to disable LASX, leaving 'HasFeatureLASX=true' and causing incorrect '__loongarch_sx/asx=1' macro definition. Fixes https://github.com/loongson-community/discussions/issues/95
This commit is contained in:
@@ -252,6 +252,7 @@ void loongarch::getLoongArchTargetFeatures(const Driver &D,
|
||||
Features.push_back("+lsx");
|
||||
} else /*-mno-lsx*/ {
|
||||
Features.push_back("-lsx");
|
||||
Features.push_back("-lasx");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -946,6 +946,10 @@
|
||||
// RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
|
||||
// RUN: %clang --target=loongarch64 -mno-lasx -mno-lsx -x c -E -dM %s -o - \
|
||||
// RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
|
||||
// RUN: %clang --target=loongarch64 -march=la464 -mno-lsx -x c -E -dM %s -o - \
|
||||
// RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
|
||||
// RUN: %clang --target=loongarch64 -mno-lsx -march=la464 -x c -E -dM %s -o - \
|
||||
// RUN: | FileCheck --match-full-lines --check-prefix=MNO-LSX %s
|
||||
// MNO-LSX-NOT: #define __loongarch_asx
|
||||
// MNO-LSX-NOT: #define __loongarch_simd_width
|
||||
// MNO-LSX-NOT: #define __loongarch_sx
|
||||
|
||||
Reference in New Issue
Block a user