[BUG] AArch64 `+no<ext>` modifiers don't disable extensions the `--mcpu` CPU enables by default
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start in getFeaturesFromClang in Support/lib/MArchTarget/MArchTargetMinimal.cpp, where the AArch64 block appends the CPU's DefaultExtensions and keeps only the + entries, which drops an explicit -sve. The test ArchTarget.AArch64MarchNegativeModifierDoesNotOverrideCpuDefaults in Support/unittests/MArchTarget/MarchTest.cpp pins the current behavior. Done when +nosve on neoverse-v1 yields -sve, the --march=armv9-a+nosve case also yields -sve2, and the test is updated to match.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug description
Actual behavior
On AArch64, a +no<ext> modifier doesn't disable an extension that the --mcpu CPU enables by default. neoverse-v1 has SVE, and +nosve is dropped whether it is written on --mcpu or on --march:
$ mojo build --target-triple=aarch64-unknown-linux-gnu --mcpu=neoverse-v1+nosve --emit=llvm -o - t.mojo | grep -o '"target-features"="[^"]*"' | sort -u | tr ',"' '\n\n' | grep -E '^[+-]sve2?$'
+sve
$ mojo build --target-triple=aarch64-unknown-linux-gnu --march=armv9-a+nosve --mcpu=neoverse-v1 --emit=llvm -o - t.mojo | grep -o '"target-features"="[^"]*"' | sort -u | tr ',"' '\n\n' | grep -E '^[+-]sve2?$'
+sve
Extensions that only the architecture brings are removed: --march=armv9-a+nosve alone, or with --mcpu=neoverse-n1 (no SVE), gives neither sve nor sve2.
The cause seems to be in getFeaturesFromClang (Support/lib/MArchTarget/MArchTargetMinimal.cpp): clang resolves the explicit -sve into opts->Features, the AArch64 block then appends the CPU's DefaultExtensions (+sve), and only the + entries are kept, so the -sve is lost.
Expected behavior
As in clang (23.1.1), an explicit +no<ext> wins over the CPU's defaults, and the CPU's other extensions stay:
$ echo 'void f(void) {}' | clang --target=aarch64-unknown-linux-gnu -mcpu=neoverse-v1+nosve -S -emit-llvm -o - -x c - | grep -o '"target-features"="[^"]*"' | tr ',"' '\n\n' | grep -E '^[+-]sve2?$'
-sve
$ echo 'void f(void) {}' | clang --target=aarch64-unknown-linux-gnu -march=armv9-a+nosve -mcpu=neoverse-v1 -S -emit-llvm -o - -x c - | grep -o '"target-features"="[^"]*"' | tr ',"' '\n\n' | grep -E '^[+-]sve2?$'
-sve
-sve2
Steps to reproduce
t.mojo:
def main():
pass
Run the two mojo build commands above. Expected -sve (plus -sve2 for the --march case); observed +sve.
ArchTarget.AArch64MarchNegativeModifierDoesNotOverrideCpuDefaults in Support/unittests/MArchTarget/MarchTest.cpp pins the current behavior. Its FIXME points at #6918, which is the RISC-V --march/--mcpu issue; I'll point it here.
System information
Reproduced against a source build of the compiler at main (19bc97aa93c246ca432132df462a8ee6b68bf44b), not a released package, so pixi list max does not apply. macOS arm64 host (Apple M1 Pro) cross-compiling to aarch64-unknown-linux-gnu.
- Lenguaje dominante
- Mojo
- Estrellas
- 30.2k
- Forks
- 3.2k
- Merge medio
- 6 d 20 h
- PR fusionados (30 d)
- 25
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de modular/modular
-
bug_feature_triaged Team: Mojo Libraries
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
[BUG]Incomplete Apache LicenseAbiertobug bug_feature_triaged documentation mojo
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
Los mantenedores suelen responder en 2 días
-
`Counter.lt()` and `Counter.gt()` disagree with `__eq__`, and `a.lt(a)` can be `True`Posiblemente ocupada @YidaWeng la tomó hace 2 días. Abiertobug_feature_triaged Team: Mojo Libraries
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
modular/modular#7696 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
[BUG] `Counter` `-=`, `+=` and `&=` leave keys behind when they remove many keysPosiblemente ocupada @Tharun-Kumar-McW la tomó hace 5 días. Abiertobug bug_feature_triaged mojo-stdlib Team: Mojo Libraries
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
modular/modular#7658 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[BUG] exp(NaN) returns infAbiertobug bug_feature_triaged mojo Team: Mojo Libraries
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
modular/modular#7646 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de modular/modular
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
sagemathinc/sagebrush#1683 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
baseballyama/rsvelte#5235 ·
Los mantenedores suelen responder en 1 día
-
lang-core: member access on a component instance reads its internal fields instead of giving nullAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
midspiral/LemmaScript#355 · 1 comentario ·
Los mantenedores suelen responder en 1 día