Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2019-05

[PATCH] Add support for Hygon Dhyana processor

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jinke Fan

Hi,
This patch adds vendor id detection for Hygon Dhyana CPUs. Could anyone help me with submit it?
More details can be found on:

---
fpcsrc/rtl/i386/mmx.pp | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fpcsrc/rtl/i386/mmx.pp b/fpcsrc/rtl/i386/mmx.pp index 46e18ada..59911f94 100644
--- a/fpcsrc/rtl/i386/mmx.pp
+++ b/fpcsrc/rtl/i386/mmx.pp
@@ -60,6 +60,7 @@ unit mmx;

   {$ASMMODE ATT}

{ return base type of processor: 0 - is Unknown, 10 - is AMD (AuthenticAMD), }
+ { 10 - is Hygon (HygonGenuine) } { 20 - is Intel (GenuineIntel) }

     function getdevel:byte;
@@ -79,6 +80,7 @@ unit mmx;
                 popl %ebx
             end;
             if ((_ebx=$68747541) and (_ecx=$444D4163) and (_edx=$69746E65)) then getdevel:=10;
+            if ((_ebx=$6f677948) and (_ecx=$656e6975) and (_edx=$6e65476e)) then getdevel:=10;
             if ((_ebx=$756E6547) and (_ecx=$6C65746E) and (_edx=$49656E69)) then getdevel:=20;
         end
     end;
2.17.1

Reply by email

Unknown author
to Jinke Fan
Jinke Fan wrote
{ return base type of processor: 0 - is Unknown, 10 - is AMD (AuthenticAMD), } + { 10 - is Hygon (HygonGenuine) }

is there a problem here? AMD and Hygon are both listed as 10...

{ 20 - is Intel (GenuineIntel) } function getdevel:byte;
NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list unless* *a signed and pre-paid contract is in effect with us.*

Reply by email

Ralf Quint
to Jinke Fan: This patch adds vendor id detection for Hygon Dhyana CPUs. Could anyone help me with…
Jinke Fan wrote 5 lines
Hi, This patch adds vendor id detection for Hygon Dhyana CPUs. Could anyone help me with submit it? More details can be found on:

Why would this be needed? I just had to look up what this actually is and it doesn't seem to be necessary to distinguish between that particular CPU (quote from Wikipedia):

Show quoted text 15 lines
The initial microprocessor created in 2018 is the Hygon Dhyana <https://en.wikipedia.org/wiki/AMD_Epyc#Chinese_variants> system on a chip <https://en.wikipedia.org/wiki/System_on_a_chip>.^[1] <https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_venture#cite_note-2018-toms-hardware-1> ^[2] <https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_venture#cite_note-2018-phoronix-2> It is noted to be a variant of the AMD EPYC <https://en.wikipedia.org/wiki/EPYC> and is so similar that "there is little to no differentiation between the chips".^[1] <https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_venture#cite_note-2018-toms-hardware-1> It has been noted that there is "less than 200 lines of new kernel code" for Linux <https://en.wikipedia.org/wiki/Linux> kernel support, and that the Dhyana is "mostly a re-branded Zen CPU for the Chinese server market".^[2] <https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_venture#cite_note-2018-phoronix-2>

^Are you aware of any specifics of that processor that it would require a distinction and direct support for that CPU version, beside the geek factor?

^Ralf

---
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

Jinke Fan
to Unknown author: is there a problem here? AMD and Hygon are both listed as 10... NOTE: No off-list…
Show quoted text 6 lines
On 5/23/19 5:10 AM, Jinke Fan wrote: >       { return base type of processor: 0 - is Unknown, 10 - is AMD > (AuthenticAMD), } > +    {                                10 - is Hygon (HygonGenuine) } is there a problem here? AMD and Hygon are both listed as 10...

Hygon CPU 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). So, Hygon CPU reuses the AMD's code path.

Thanks for your reply.

Best regards,
Jinke Fan

Show quoted text 7 lines
>       {                                20 - is Intel (GenuineIntel) } >       function getdevel:byte;

Reply by email

Jinke Fan
to Ralf Quint: Why would this be needed? I just had to look up what this actually is and it doesn't seem…
Ralf Quint wrote 30 lines
On 5/23/2019 2:10 AM, Jinke Fan wrote: > Hi, > This patch adds vendor id detection for Hygon Dhyana CPUs. > Could anyone help me with submit it? > More details can be found on: > Why would this be needed? I just had to look up what this actually is and it doesn't seem to be necessary to distinguish between that particular CPU (quote from Wikipedia): > The initial microprocessor created in 2018 is the Hygon Dhyana > <https://en.wikipedia.org/wiki/AMD_Epyc#Chinese_variants> system on a > chip <https://en.wikipedia.org/wiki/System_on_a_chip>.^[1] > <https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_venture#cite_note-2018-toms-hardware-1> > ^[2] > <https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_venture#cite_note-2018-phoronix-2> > It is noted to be a variant of the AMD EPYC > <https://en.wikipedia.org/wiki/EPYC> and is so similar that "there is > little to no differentiation between the chips".^[1] > <https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_venture#cite_note-2018-toms-hardware-1> > It has been noted that there is "less than 200 lines of new kernel > code" for Linux <https://en.wikipedia.org/wiki/Linux> kernel support, > and that the Dhyana is "mostly a re-branded Zen CPU for the Chinese > server market".^[2] > <https://en.wikipedia.org/wiki/AMD%E2%80%93Chinese_joint_venture#cite_note-2018-phoronix-2> ^Are you aware of any specifics of that processor that it would require a distinction and direct support for that CPU version, beside the geek factor?

Dhyana process was the first generation of Hygon. And, "there is little to no differentiation between the chips".

The spec refer to:
https://www.amd.com/system/files/TechDocs/54945_PPR_Family_17h_Models_00h-0Fh.pdf At the software level, code typically reuses AMD's code path as so far.

Best regards.
Jinke Fan

Show quoted text 15 lines

Reply by email