[fpc-devel] [PATCH] Add support for Hygon Dhyana processor

Jinke Fan fanjinke51 at yeah.net
Thu May 23 11:10:55 CEST 2019


Hi,
  This patch adds vendor id detection for Hygon Dhyana CPUs.
  Could anyone help me with submit it?
More details can be found on:
http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn
---
 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




More information about the fpc-devel mailing list