From a4df0ce78d6f1beee5d2ef53e2a1a9f3fc377100 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 15 Jun 2023 10:52:35 +0200 Subject: [PATCH] x86/AVX512: use VMOVDDUP for broadcast to V2DF Like is already the case for the AVX/AVX2 form, VMOVDDUP - acting on double precision floating values - is more appropriate to use here, and it can also result in shorter insn encodings when source is memory or %xmm0...%xmm7, and no masking is applied (in allowing a 2-byte VEX prefix then instead of a 3-byte one). gcc/ * config/i386/sse.md (_vec_dup): Use vmovddup. --- gcc/config/i386/sse.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index a0824ef2350..70d7410f7a9 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -25922,9 +25922,9 @@ "TARGET_AVX512F" { /* There is no DF broadcast (in AVX-512*) to 128b register. - Mimic it with integer variant. */ + Mimic it with vmovddup, just like vec_dupv2df does. */ if (mode == V2DFmode) - return "vpbroadcastq\t{%1, %0|%0, %q1}"; + return "vmovddup\t{%1, %0|%0, %q1}"; return "vbroadcast\t{%1, %0|%0, %1}"; }