mirror of https://github.com/PCSX2/pcsx2.git
Linux: Make some of the assembly look a bit better. Change the PCSX2_ALIGNED_EXTERN defs a bit.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@820 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
c5b366095a
commit
382431ebcb
|
@ -146,8 +146,8 @@ typedef union _LARGE_INTEGER
|
|||
// fixme - is this needed for recent versions of GCC? Or can we just use the macros
|
||||
// above instead for both definitions (implementations) and declarations (includes)? -- air
|
||||
|
||||
#define PCSX2_ALIGNED_EXTERN(alig,x) extern x
|
||||
#define PCSX2_ALIGNED16_EXTERN(x) extern x
|
||||
#define PCSX2_ALIGNED_EXTERN(alig,x) extern x __attribute((aligned(alig)))
|
||||
#define PCSX2_ALIGNED16_EXTERN(x) extern x __attribute((aligned(16)))
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ default: \
|
|||
// Note: building the 'extern' into PCSX2_ALIGNED16_DECL fixes Visual Assist X's intellisense.
|
||||
|
||||
#define PCSX2_ALIGNED(alig,x) __declspec(align(alig)) x
|
||||
#define PCSX2_ALIGNED_EXTERN(alig,x) __declspec(align(alig)) x
|
||||
#define PCSX2_ALIGNED_EXTERN(alig,x) extern __declspec(align(alig)) x
|
||||
#define PCSX2_ALIGNED16(x) __declspec(align(16)) x
|
||||
#define PCSX2_ALIGNED16_EXTERN(x) extern __declspec(align(16)) x
|
||||
|
||||
|
@ -85,8 +85,8 @@ default: \
|
|||
// instead for both definitions (implementations) and declarations (includes)? -- air
|
||||
#define PCSX2_ALIGNED(alig,x) x __attribute((aligned(alig)))
|
||||
#define PCSX2_ALIGNED16(x) x __attribute((aligned(16)))
|
||||
#define PCSX2_ALIGNED_EXTERN(alig,x) extern x
|
||||
#define PCSX2_ALIGNED16_EXTERN(x) extern x
|
||||
#define PCSX2_ALIGNED_EXTERN(alig,x) extern x __attribute((aligned(alig)))
|
||||
#define PCSX2_ALIGNED16_EXTERN(x) extern x __attribute((aligned(16)))
|
||||
|
||||
#define __naked // GCC lacks the naked specifier
|
||||
#define CALLBACK // CALLBACK is a win32-specific mess
|
||||
|
|
|
@ -215,7 +215,7 @@ ihatemsvc:
|
|||
jne tworows
|
||||
}
|
||||
#elif defined(__GNUC__)
|
||||
asm(
|
||||
__asm__(
|
||||
".intel_syntax noprefix\n"
|
||||
"mov eax, 1\n"
|
||||
"xor esi, esi\n"
|
||||
|
|
|
@ -109,14 +109,14 @@ static __forceinline void memset_8( void *dest )
|
|||
(
|
||||
".intel_syntax noprefix\n"
|
||||
"cld\n"
|
||||
// "mov edi, %0\n"
|
||||
// "mov eax, %1\n"
|
||||
// "mov edi, %[dest]\n"
|
||||
// "mov eax, %[data32]\n"
|
||||
"stosd\n"
|
||||
"stosd\n"
|
||||
"stosd\n"
|
||||
".att_syntax\n"
|
||||
:
|
||||
: "D"(dest), "a"(data32)
|
||||
: [dest]"D"(dest), [data32]"a"(data32)
|
||||
// D - edi, a -- eax, c ecx
|
||||
:
|
||||
);
|
||||
|
@ -127,15 +127,15 @@ static __forceinline void memset_8( void *dest )
|
|||
(
|
||||
".intel_syntax noprefix\n"
|
||||
"cld\n"
|
||||
// "mov edi, %0\n"
|
||||
// "mov eax, %1\n"
|
||||
// "mov edi, %[dest]\n"
|
||||
// "mov eax, %[data32]\n"
|
||||
"stosd\n"
|
||||
"stosd\n"
|
||||
"stosd\n"
|
||||
"stosd\n"
|
||||
".att_syntax\n"
|
||||
:
|
||||
: "D"(dest), "a"(data32)
|
||||
: [dest]"D"(dest), [data32]"a"(data32)
|
||||
:
|
||||
|
||||
);
|
||||
|
@ -146,8 +146,8 @@ static __forceinline void memset_8( void *dest )
|
|||
(
|
||||
".intel_syntax noprefix\n"
|
||||
"cld\n"
|
||||
// "mov edi, %0\n"
|
||||
// "mov eax, %1\n"
|
||||
// "mov edi, %[dest]\n"
|
||||
// "mov eax, %[data32]\n"
|
||||
"stosd\n"
|
||||
"stosd\n"
|
||||
"stosd\n"
|
||||
|
@ -155,7 +155,7 @@ static __forceinline void memset_8( void *dest )
|
|||
"stosd\n"
|
||||
".att_syntax\n"
|
||||
:
|
||||
: "D"(dest), "a"(data32)
|
||||
: [dest]"D"(dest), [data32]"a"(data32)
|
||||
:
|
||||
|
||||
);
|
||||
|
@ -166,13 +166,13 @@ static __forceinline void memset_8( void *dest )
|
|||
(
|
||||
".intel_syntax noprefix\n"
|
||||
"cld\n"
|
||||
// "mov ecx, %0\n"
|
||||
// "mov edi, %1\n"
|
||||
// "mov eax, %2\n"
|
||||
// "mov ecx, %[remdat]\n"
|
||||
// "mov edi, %[dest]\n"
|
||||
// "mov eax, %\[data32]n"
|
||||
"rep stosd\n"
|
||||
".att_syntax\n"
|
||||
:
|
||||
: "c"(remdat), "D"(dest), "a"(data32)
|
||||
: [remdat]"c"(remdat), [dest]"D"(dest), [data32]"a"(data32)
|
||||
:
|
||||
);
|
||||
return;
|
||||
|
|
|
@ -505,15 +505,15 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma
|
|||
#else
|
||||
if( VIFdmanum ) {
|
||||
__asm__(".intel_syntax noprefix\n"
|
||||
"movaps xmm6, xmmword ptr [%0]\n"
|
||||
"movaps xmm7, xmmword ptr [%1]\n"
|
||||
".att_syntax\n" : :"r"(g_vifRow1), "r"(g_vifCol1) );
|
||||
"movaps xmm6, xmmword ptr [%[g_vifRow1]]\n"
|
||||
"movaps xmm7, xmmword ptr [%[g_vifCol1]]\n"
|
||||
".att_syntax\n" : :[g_vifRow1]"r"(g_vifRow1), [g_vifCol1]"r"(g_vifCol1) );
|
||||
}
|
||||
else {
|
||||
__asm__(".intel_syntax noprefix\n"
|
||||
"movaps xmm6, xmmword ptr [%0]\n"
|
||||
"movaps xmm7, xmmword ptr [%1]\n"
|
||||
".att_syntax\n" : : "r"(g_vifRow0), "r"(g_vifCol0) );
|
||||
"movaps xmm6, xmmword ptr [%[g_vifRow0]]\n"
|
||||
"movaps xmm7, xmmword ptr [%[g_vifCol0]]\n"
|
||||
".att_syntax\n" : : [g_vifRow0]"r"(g_vifRow0), [g_vifCol0]"r"(g_vifCol0) );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -845,7 +845,7 @@ static void checkcodefn()
|
|||
#ifdef _MSC_VER
|
||||
__asm mov pctemp, eax;
|
||||
#else
|
||||
__asm__("movl %%eax, %0" : : "m"(pctemp) );
|
||||
__asm__("movl %%eax, %[pctemp]" : : [pctemp]"m"(pctemp) );
|
||||
#endif
|
||||
SysPrintf("iop code changed! %x\n", pctemp);
|
||||
}
|
||||
|
|
|
@ -1165,7 +1165,7 @@ static void checkcodefn()
|
|||
#ifdef _MSC_VER
|
||||
__asm mov pctemp, eax;
|
||||
#else
|
||||
__asm__("movl %%eax, %0" : "=m"(pctemp) );
|
||||
__asm__("movl %%eax, %[pctemp]" : [pctemp]"=m"(pctemp) );
|
||||
#endif
|
||||
|
||||
Console::Error("code changed! %x", params pctemp);
|
||||
|
|
|
@ -115,7 +115,7 @@ extern s32 iCpuId( u32 cmd, u32 *regs )
|
|||
"pushf\n"
|
||||
"pop %%eax\n"
|
||||
"xor %%edx, %%eax\n"
|
||||
"mov %%eax, %0\n"
|
||||
"mov %%eax, %[flag]\n"
|
||||
"add $0x18, %%esp\n"
|
||||
"cmpl $0x0,%%eax\n"
|
||||
"jne 1f\n"
|
||||
|
@ -123,7 +123,7 @@ extern s32 iCpuId( u32 cmd, u32 *regs )
|
|||
"leave\n"
|
||||
"ret\n"
|
||||
"1:\n"
|
||||
: "=r"(flag) :
|
||||
: [flag]"=r"(flag) :
|
||||
);
|
||||
|
||||
cpuid(cmd, regs[0], regs[1], regs[2], regs[3]);
|
||||
|
|
|
@ -61,7 +61,7 @@ void SetCPUState(u32 sseMXCSR, u32 sseVUMXCSR)
|
|||
#ifdef _MSC_VER
|
||||
__asm ldmxcsr g_sseMXCSR; // set the new sse control
|
||||
#else
|
||||
__asm__("ldmxcsr %0" : : "m"(g_sseMXCSR) );
|
||||
__asm__("ldmxcsr %[g_sseMXCSR]" : : [g_sseMXCSR]"m"(g_sseMXCSR) );
|
||||
#endif
|
||||
//g_sseVUMXCSR = g_sseMXCSR|0x6000;
|
||||
}
|
||||
|
@ -108,16 +108,16 @@ __forceinline void FreezeMMXRegs_(int save)
|
|||
#else
|
||||
__asm__(
|
||||
".intel_syntax noprefix\n"
|
||||
"movq [%0+0x00], mm0\n"
|
||||
"movq [%0+0x08], mm1\n"
|
||||
"movq [%0+0x10], mm2\n"
|
||||
"movq [%0+0x18], mm3\n"
|
||||
"movq [%0+0x20], mm4\n"
|
||||
"movq [%0+0x28], mm5\n"
|
||||
"movq [%0+0x30], mm6\n"
|
||||
"movq [%0+0x38], mm7\n"
|
||||
"movq [%[g_globalMMXData]+0x00], mm0\n"
|
||||
"movq [%[g_globalMMXData]+0x08], mm1\n"
|
||||
"movq [%[g_globalMMXData]+0x10], mm2\n"
|
||||
"movq [%[g_globalMMXData]+0x18], mm3\n"
|
||||
"movq [%[g_globalMMXData]+0x20], mm4\n"
|
||||
"movq [%[g_globalMMXData]+0x28], mm5\n"
|
||||
"movq [%[g_globalMMXData]+0x30], mm6\n"
|
||||
"movq [%[g_globalMMXData]+0x38], mm7\n"
|
||||
"emms\n"
|
||||
".att_syntax\n" : : "r"(g_globalMMXData)
|
||||
".att_syntax\n" : : [g_globalMMXData]"r"(g_globalMMXData)
|
||||
);
|
||||
#endif
|
||||
|
||||
|
@ -148,16 +148,16 @@ __forceinline void FreezeMMXRegs_(int save)
|
|||
#else
|
||||
__asm__(
|
||||
".intel_syntax noprefix\n"
|
||||
"movq mm0, [%0+0x00]\n"
|
||||
"movq mm1, [%0+0x08]\n"
|
||||
"movq mm2, [%0+0x10]\n"
|
||||
"movq mm3, [%0+0x18]\n"
|
||||
"movq mm4, [%0+0x20]\n"
|
||||
"movq mm5, [%0+0x28]\n"
|
||||
"movq mm6, [%0+0x30]\n"
|
||||
"movq mm7, [%0+0x38]\n"
|
||||
"movq mm0, [%[g_globalMMXData]+0x00]\n"
|
||||
"movq mm1, [%[g_globalMMXData]+0x08]\n"
|
||||
"movq mm2, [%[g_globalMMXData]+0x10]\n"
|
||||
"movq mm3, [%[g_globalMMXData]+0x18]\n"
|
||||
"movq mm4, [%[g_globalMMXData]+0x20]\n"
|
||||
"movq mm5, [%[g_globalMMXData]+0x28]\n"
|
||||
"movq mm6, [%[g_globalMMXData]+0x30]\n"
|
||||
"movq mm7, [%[g_globalMMXData]+0x38]\n"
|
||||
"emms\n"
|
||||
".att_syntax\n" : : "r"(g_globalMMXData)
|
||||
".att_syntax\n" : : [g_globalMMXData]"r"(g_globalMMXData)
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
@ -195,15 +195,15 @@ __forceinline void FreezeXMMRegs_(int save)
|
|||
#else
|
||||
__asm__(
|
||||
".intel_syntax noprefix\n"
|
||||
"movaps [%0+0x00], xmm0\n"
|
||||
"movaps [%0+0x10], xmm1\n"
|
||||
"movaps [%0+0x20], xmm2\n"
|
||||
"movaps [%0+0x30], xmm3\n"
|
||||
"movaps [%0+0x40], xmm4\n"
|
||||
"movaps [%0+0x50], xmm5\n"
|
||||
"movaps [%0+0x60], xmm6\n"
|
||||
"movaps [%0+0x70], xmm7\n"
|
||||
".att_syntax\n" : : "r"(g_globalXMMData)
|
||||
"movaps [%[g_globalXMMData]+0x00], xmm0\n"
|
||||
"movaps [%[g_globalXMMData]+0x10], xmm1\n"
|
||||
"movaps [%[g_globalXMMData]+0x20], xmm2\n"
|
||||
"movaps [%[g_globalXMMData]+0x30], xmm3\n"
|
||||
"movaps [%[g_globalXMMData]+0x40], xmm4\n"
|
||||
"movaps [%[g_globalXMMData]+0x50], xmm5\n"
|
||||
"movaps [%[g_globalXMMData]+0x60], xmm6\n"
|
||||
"movaps [%[g_globalXMMData]+0x70], xmm7\n"
|
||||
".att_syntax\n" : : [g_globalXMMData]"r"(g_globalXMMData)
|
||||
);
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
@ -237,15 +237,15 @@ __forceinline void FreezeXMMRegs_(int save)
|
|||
#else
|
||||
__asm__(
|
||||
".intel_syntax noprefix\n"
|
||||
"movaps xmm0, [%0+0x00]\n"
|
||||
"movaps xmm1, [%0+0x10]\n"
|
||||
"movaps xmm2, [%0+0x20]\n"
|
||||
"movaps xmm3, [%0+0x30]\n"
|
||||
"movaps xmm4, [%0+0x40]\n"
|
||||
"movaps xmm5, [%0+0x50]\n"
|
||||
"movaps xmm6, [%0+0x60]\n"
|
||||
"movaps xmm7, [%0+0x70]\n"
|
||||
".att_syntax\n" : : "r"(g_globalXMMData)
|
||||
"movaps xmm0, [%[g_globalXMMData]+0x00]\n"
|
||||
"movaps xmm1, [%[g_globalXMMData]+0x10]\n"
|
||||
"movaps xmm2, [%[g_globalXMMData]+0x20]\n"
|
||||
"movaps xmm3, [%[g_globalXMMData]+0x30]\n"
|
||||
"movaps xmm4, [%[g_globalXMMData]+0x40]\n"
|
||||
"movaps xmm5, [%[g_globalXMMData]+0x50]\n"
|
||||
"movaps xmm6, [%[g_globalXMMData]+0x60]\n"
|
||||
"movaps xmm7, [%[g_globalXMMData]+0x70]\n"
|
||||
".att_syntax\n" : : [g_globalXMMData]"r"(g_globalXMMData)
|
||||
);
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
|
Loading…
Reference in New Issue