Issue 137332
Summary clang++-20 incorrect instruction encoding for VPDPBUSD on znver5 (only)
Labels clang
Assignees
Reporter gcp
    Steps to reproduce:

1. git clone https://github.com/official-stockfish/Stockfish.git
2. cd stockfish/src
3. Apply this patch to force `march=znver5`

```
diff --git a/src/Makefile b/src/Makefile
index 76b94785..f65f6f90 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -626,7 +626,7 @@ endif
 ### 3.3 Optimization
 ifeq ($(optimize),yes)
 
-       CXXFLAGS += -O3 -funroll-loops
+ CXXFLAGS += -O3 -funroll-loops -march=znver5 -mtune=znver5
 
        ifeq ($(comp),gcc)
                ifeq ($(OS), Android)
```

4. Compile with `make build ARCH=x86-64-vnni512 COMP=clang CXX=clang++-20 CC=clang-20 LD=ldd-20`
5. Run the binary on a Zen5 system, type `go infinite`
6. Program crashes in:

=> 0x00005555555b73ae <+5998>:  {vex} vpdpbusd 0xc580(%rcx),%ymm0,%ymm1

If I have to guess, due to some issue with AVXVNNI vs VNNI512 encoding. This does not happen if you target znver4.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to