about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-03-11 15:22:01 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-03-11 15:22:08 +0100
commit65404cba33073e6da019053babf20f246f8dbbc5 (patch)
tree6496a611fc0edd01b1e7949695f8294d5eb72ce4 /src
parentac0519a046e1517508051dbb13943a056123950a (diff)
downloadbox64-65404cba33073e6da019053babf20f246f8dbbc5.tar.gz
box64-65404cba33073e6da019053babf20f246f8dbbc5.zip
Do not expose FMA cpu extension, it's associated to AVX by some engines
Diffstat (limited to 'src')
-rw-r--r--src/tools/my_cpuid.c7
-rw-r--r--src/wrapped/wrappedlibc.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/tools/my_cpuid.c b/src/tools/my_cpuid.c
index 145f55f4..76bfd2da 100644
--- a/src/tools/my_cpuid.c
+++ b/src/tools/my_cpuid.c
@@ -247,7 +247,7 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u)
             R_ECX =   1<<0      // SSE3
                     | 1<<1      // PCLMULQDQ
                     | 1<<9      // SSSE3
-                    | 1<<12     // fma
+                    //| 1<<12     // fma    // some games treat FMA as AVX
                     | 1<<13     // cx16 (cmpxchg16)
                     | 1<<19     // SSE4_1
                     | 1<<20     // SSE4_2
@@ -311,10 +311,11 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u)
         case 0x7:   // extended bits...
             if(R_ECX==0) {
                 R_EAX = 0;
-                R_EBX = 0 |
+                R_EBX = 
                         //1<<3 |  // BMI1 
                         //1<<8 | //BMI2
-                        1<<29;  // SHA extension
+                        1<<29|  // SHA extension
+                        0;
             } else {R_EAX = R_ECX = R_EBX = R_EDX = 0;}
             break;
         case 0xB:   // Extended Topology Enumeration Leaf
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 6ff9bab7..cb143880 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -1627,7 +1627,7 @@ void CreateCPUInfoFile(int fd)
         P;
         sprintf(buff, "bogomips\t: %g\n", getBogoMips());
         P;
-        sprintf(buff, "flags\t\t: fpu cx8 sep ht cmov clflush mmx sse sse2 syscall tsc lahf_lm ssse3 ht tm lm fma fxsr cpuid pclmulqdq cx16 aes movbe pni sse4_1 sse4_2 lzcnt popcnt\n");
+        sprintf(buff, "flags\t\t: fpu cx8 sep ht cmov clflush mmx sse sse2 syscall tsc lahf_lm ssse3 ht tm lm fxsr cpuid pclmulqdq cx16 aes movbe pni sse4_1 sse4_2 lzcnt popcnt\n");
         P;
         sprintf(buff, "address sizes\t: 48 bits physical, 48 bits virtual\n");
         P;