From patchwork Wed May 15 09:34:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinke Fan X-Patchwork-Id: 32692 Received: (qmail 43830 invoked by alias); 15 May 2019 09:35:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 43820 invoked by uid 89); 15 May 2019 09:35:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=CoLtd, Co., Ltd, co., ltd, coltd X-HELO: m132-177.yeah.net Received: from m132-177.yeah.net (HELO m132-177.yeah.net) (123.58.177.132) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 May 2019 09:35:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yeah.net; s=s110527; h=From:Subject:Date:Message-Id; bh=ls3WJNJ9c95t5D8QuU D1MJDiowOOKYtcklNMwfon4hY=; b=GG1jM8BNHfjKjgqGP6G6u84s9vKKQWuzbC Yyjc6gU2bMfFK5qA1epoanndJVtQjkgpVZNgLsbXqaiguM744tsNZ2G0IeQahlbh qkvDYiuuAx0rLYUjtNTDHyufJ8F/jxwmifUxjS2KBc3yzrVoqcxPUzsYck1iqo/m CtULinXUo= Received: from bogon.hygon.cn (unknown [182.150.46.145]) by smtp2 (Coremail) with SMTP id C1UQrAC3veFJ3dtcJqF_Ew--.20856S2; Wed, 15 May 2019 17:35:06 +0800 (CST) From: Jinke Fan To: gdb-patches@sourceware.org Cc: Jinke Fan Subject: [RFC PATCH] Add Hygon Dhyana processor support Date: Wed, 15 May 2019 17:34:57 +0800 Message-Id: <20190515093457.35348-1-fanjinke51@yeah.net> X-IsSubscribed: yes Background: Chengdu Haiguang IC Design Co., Ltd (Hygon) is a Joint Venture between AMD and Haiguang Information Technology Co.,Ltd., aims at providing high performance x86 processor for China server market. Its first generation processor codename is Dhyana, which originates from AMD technology and shares most of the architecture with AMD's family 17h, but with different CPU Vendor ID("HygonGenuine")/Family series number(Family 18h). gdb/ChangeLog: * go32-nat.c (go32_sysinfo): Add hygon_p. The results of make check are no degradation: === binutils Summary === of expected passes 251 of unresolved testcases 1 of unsupported tests 1 Please let me know your comments. Thanks in advance. Signed-off-by: Jinke Fan --- gdb/go32-nat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index ea0872363d..a4d1a5c9af 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -1162,6 +1162,7 @@ go32_sysinfo (const char *arg, int from_tty) unsigned brand_idx; int intel_p = strcmp (cpuid_vendor, "GenuineIntel") == 0; int amd_p = strcmp (cpuid_vendor, "AuthenticAMD") == 0; + int hygon_p = strcmp (cpuid_vendor, "HygonGenuine") == 0; unsigned cpu_family, cpu_model; #if 0 @@ -1261,12 +1262,12 @@ go32_sysinfo (const char *arg, int from_tty) } } xsnprintf (cpu_string, sizeof (cpu_string), "%s%s Model %d Stepping %d", - intel_p ? "Pentium" : (amd_p ? "AMD" : "ix86"), + intel_p ? "Pentium" : (amd_p ? "AMD" : (hygon_p ? "Hygon" : "ix86")), cpu_brand, cpu_model, cpuid_eax & 0xf); printfi_filtered (31, "%s\n", cpu_string); if (((cpuid_edx & (6 | (0x0d << 23))) != 0) || ((cpuid_edx & 1) == 0) - || (amd_p && (cpuid_edx & (3 << 30)) != 0)) + || ((amd_p || hygon_p) && (cpuid_edx & (3 << 30)) != 0)) { puts_filtered ("CPU Features..................."); /* We only list features which might be useful in the DPMI @@ -1285,7 +1286,7 @@ go32_sysinfo (const char *arg, int from_tty) puts_filtered ("SSE "); if ((cpuid_edx & (1 << 26)) != 0) puts_filtered ("SSE2 "); - if (amd_p) + if (amd_p || hygon_p) { if ((cpuid_edx & (1 << 31)) != 0) puts_filtered ("3DNow! ");