Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 64200 Details for
Bug 85220
games-emulation/openmsx-0.5.0 x86 fails to build (non pic aware cpuid asm/c++ code)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix asm (cpuid and mmx usage) for PIC compliance
openmsx-x86-pic-cpuidmmx.patch (text/plain), 2.08 KB, created by
Kevin F. Quinn (RETIRED)
on 2005-07-24 06:00:04 UTC
(
hide
)
Description:
Patch to fix asm (cpuid and mmx usage) for PIC compliance
Filename:
MIME Type:
Creator:
Kevin F. Quinn (RETIRED)
Created:
2005-07-24 06:00:04 UTC
Size:
2.08 KB
patch
obsolete
>--- src/HostCPU.cc.orig 2005-07-24 13:56:56.000000000 +0200 >+++ src/HostCPU.cc 2005-07-24 14:00:19.000000000 +0200 >@@ -23,7 +23,7 @@ > "pushfl;" > "popl %%eax;" > // Save current value. >- "movl %%eax,%%ebx;" >+ "movl %%eax,%%ecx;" > // Toggle bit 21. > "xorl $0x200000, %%eax;" > // Load EAX into EFLAGS. >@@ -33,29 +33,33 @@ > "pushfl;" > "popl %%eax;" > // Did bit 21 change? >- "xor %%ebx, %%eax;" >+ "xor %%ecx, %%eax;" > "andl $0x200000, %%eax;" > : "=a" (hasCPUID) // 0 > : // no input >- : "ebx" >+ : "ecx" // use ecx not ebx to avoid PIC abi clobber > ); > if (hasCPUID) { > // Which CPUID calls are supported? > unsigned highest; > asm ( >+ "pushl %%ebx;" > "cpuid;" >+ "popl %%ebx;" > : "=a" (highest) // 0 > : "0" (0) // 1: function >- : "ebx", "ecx", "edx" >+ : "ecx", "edx" // ebx save/restored to avoid PIC abi clobber > ); > if (highest >= 1) { > // Get features flags. > unsigned features; > asm ( >+ "pushl %%ebx;" > "cpuid;" >+ "pushl %%ebx;" > : "=d" (features) // 0 > : "a" (1) // 1: function >- : "ebx", "ecx" >+ : "ecx" // ebx save/restored to avoid PIC abi clobber > ); > PRT_DEBUG("CPU flags: " << std::hex << std::setw(8) << std::setfill('0') << std::uppercase << features); > mmxFlag = features & 0x800000; >--- src/video/SimpleScaler.cc.orig 2005-07-24 14:35:13.000000000 +0200 >+++ src/video/SimpleScaler.cc 2005-07-24 14:43:01.000000000 +0200 >@@ -684,6 +684,7 @@ > "paddw %%mm4, %%mm0;" > "paddw %%mm5, %%mm1;" > >+ "movd %%eax, %%mm6;" // save eax > "pextrw $0, %%mm0, %%eax;" > "movw (%2,%%eax,2), %%ax;" > "pinsrw $0, %%eax, %%mm0;" >@@ -711,6 +712,7 @@ > "pextrw $3, %%mm1, %%eax;" > "movw (%2,%%eax,2), %%ax;" > "pinsrw $3, %%eax, %%mm1;" >+ "movd %%mm6, %%eax;" // restore eax > > "movntq %%mm0, (%3,%%ecx,2);" > "movntq %%mm1, 8(%3,%%ecx,2);" >@@ -726,7 +728,7 @@ > , "r" (dst) // 3 > , "m" (mask) // 4 > : "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm7" >- , "eax", "ecx" >+ , "ecx" // eax save/restored so available for 'r' > ); > return; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 85220
:
53487
|
64200
|
64201