From 7deea9aad86683a4bcc68d6dd073038039f7a267 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 13 Feb 2020 10:19:28 +0100 Subject: [PATCH] x86: fix SSE4a dependencies of ".arch .nosse*" Since ".arch .sse4a" enables SSE3 and earlier, disabling SSE3 should also disable SSE4a. And as per its name, ".arch .nosse4" should also do so. --- gas/ChangeLog | 5 +++++ gas/config/tc-i386.c | 2 +- opcodes/ChangeLog | 7 +++++++ opcodes/i386-gen.c | 6 ++++-- opcodes/i386-init.h | 12 ++++++++++-- 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index cf1266a33e..7f110e938d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2020-02-13 Jan Beulich + + * config/tc-i386.c (cpu_noarch): Use CPU_ANY_SSE4_FLAGS in + "nosse4" entry. + 2020-02-12 Jan Beulich * config/tc-i386.c (avx512): New (at file scope), moved from diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 680016ae45..6b923ccb81 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1180,7 +1180,7 @@ static const noarch_entry cpu_noarch[] = { STRING_COMMA_LEN ("nossse3"), CPU_ANY_SSSE3_FLAGS }, { STRING_COMMA_LEN ("nosse4.1"), CPU_ANY_SSE4_1_FLAGS }, { STRING_COMMA_LEN ("nosse4.2"), CPU_ANY_SSE4_2_FLAGS }, - { STRING_COMMA_LEN ("nosse4"), CPU_ANY_SSE4_1_FLAGS }, + { STRING_COMMA_LEN ("nosse4"), CPU_ANY_SSE4_FLAGS }, { STRING_COMMA_LEN ("noavx"), CPU_ANY_AVX_FLAGS }, { STRING_COMMA_LEN ("noavx2"), CPU_ANY_AVX2_FLAGS }, { STRING_COMMA_LEN ("noavx512f"), CPU_ANY_AVX512F_FLAGS }, diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index ad10bf1cb5..6b0c17f8ae 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,10 @@ +2020-02-13 Jan Beulich + + * i386-gen.c (cpu_flag_init): Move CpuSSE4a from + CPU_ANY_SSE_FLAGS entry to CPU_ANY_SSE3_FLAGS one. Add + CPU_ANY_SSE4_FLAGS entry. + * i386-init.h: Re-generate. + 2020-02-12 Jan Beulich * i386-opc.tbl (vfpclasspd, vfpclassps): Add Intel sytax form diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c index e1cc493230..79f4cc9d25 100644 --- a/opcodes/i386-gen.c +++ b/opcodes/i386-gen.c @@ -322,17 +322,19 @@ static initializer cpu_flag_init[] = { "CPU_ANY_MMX_FLAGS", "CPU_3DNOWA_FLAGS" }, { "CPU_ANY_SSE_FLAGS", - "CPU_ANY_SSE2_FLAGS|CpuSSE|CpuSSE4a" }, + "CPU_ANY_SSE2_FLAGS|CpuSSE" }, { "CPU_ANY_SSE2_FLAGS", "CPU_ANY_SSE3_FLAGS|CpuSSE2" }, { "CPU_ANY_SSE3_FLAGS", - "CPU_ANY_SSSE3_FLAGS|CpuSSE3" }, + "CPU_ANY_SSSE3_FLAGS|CpuSSE3|CpuSSE4a" }, { "CPU_ANY_SSSE3_FLAGS", "CPU_ANY_SSE4_1_FLAGS|CpuSSSE3" }, { "CPU_ANY_SSE4_1_FLAGS", "CPU_ANY_SSE4_2_FLAGS|CpuSSE4_1" }, { "CPU_ANY_SSE4_2_FLAGS", "CpuSSE4_2" }, + { "CPU_ANY_SSE4_FLAGS", + "CPU_ANY_SSE4_1_FLAGS|CpuSSE4a" }, { "CPU_ANY_AVX_FLAGS", "CPU_ANY_AVX2_FLAGS|CpuF16C|CpuFMA|CpuFMA4|CpuXOP|CpuAVX" }, { "CPU_ANY_AVX2_FLAGS", diff --git a/opcodes/i386-init.h b/opcodes/i386-init.h index 2c93158844..8ecf117196 100644 --- a/opcodes/i386-init.h +++ b/opcodes/i386-init.h @@ -1132,7 +1132,7 @@ #define CPU_ANY_SSE2_FL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