x86-64: fix vbroadcastss and vbroadcastsd EVEX over-promotion

In avx2-insts.lisp, vbroadcastss and vbroadcastsd mistakenly checked
(or (xmm-register-p src) (zmm-register-p dst)) to decide whether to
emit EVEX. Because f32.4-broadcast passes src in single-reg (XMM),
this caused 128-bit and 256-bit AVX broadcast instructions to be encoded
with EVEX prefixes (62 f2 ...), raising SIGILL on hosts lacking AVX-512
support.

Fix the condition to check (zmm-register-p dst). Standard emit-avx2-inst
already auto-promotes operands using registers 16-31 to EVEX.
This commit is contained in:
Aaron Estrada 2026-09-07 02:03:27 -06:00 committed by Stas Boukarev
parent 2428c1efd0
commit 9c92f31492

View file

@ -1505,7 +1505,7 @@ REG is the source (encoded in ModR/M.r/m).
:w 0 :disp-n 4) :w 0 :disp-n 4)
(:emitter (:emitter
(cond (cond
((or (xmm-register-p src) (zmm-register-p dst)) ((zmm-register-p dst)
(emit-avx512-inst segment src dst #x66 #x18 (emit-avx512-inst segment src dst #x66 #x18
:opcode-prefix #x0f38 :opcode-prefix #x0f38
:w 0 :w 0
@ -1525,7 +1525,7 @@ REG is the source (encoded in ModR/M.r/m).
:w 1 :disp-n 8) :w 1 :disp-n 8)
(:emitter (:emitter
(cond (cond
((or (xmm-register-p src) (zmm-register-p dst)) ((zmm-register-p dst)
(emit-avx512-inst segment src dst #x66 #x19 (emit-avx512-inst segment src dst #x66 #x19
:opcode-prefix #x0f38 :opcode-prefix #x0f38
:w 1 :w 1