diff src/video/SDL_blit_A.c @ 739:22dbf364c017

Added SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE() in SDL_cpuinfo.h
author Sam Lantinga <slouken@libsdl.org>
date Tue, 18 Nov 2003 01:27:06 +0000
parents f90d80d68071
children b8d311d90021
line wrap: on
line diff
--- a/src/video/SDL_blit_A.c	Fri Nov 14 20:21:22 2003 +0000
+++ b/src/video/SDL_blit_A.c	Tue Nov 18 01:27:06 2003 +0000
@@ -32,16 +32,9 @@
 #include "SDL_blit.h"
 
 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
+/* Function to check the CPU flags */
+#include "SDL_cpuinfo.h"
 #include "mmx.h"
-/* Function to check the CPU flags */
-#define MMX_CPU		0x800000
-#define TDNOW_CPU	0x80000000
-#define CPU_Flags()	Hermes_X86_CPU()
-#define X86_ASSEMBLER
-#define HermesConverterInterface	void
-#define HermesClearInterface		void
-#define STACKCALL
-#include "HeadX86.h"
 #endif
 
 /* Functions to perform alpha blended blitting */
@@ -1387,7 +1380,7 @@
 		    if(df->Gmask == 0x7e0)
 		    {
 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
-		if((CPU_Flags()&MMX_CPU)!=0)
+		if(SDL_HasMMX())
 			return Blit565to565SurfaceAlphaMMX;
 		else
 #endif
@@ -1396,7 +1389,7 @@
 		    else if(df->Gmask == 0x3e0)
 		    {
 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
-		if((CPU_Flags()&MMX_CPU)!=0)
+		if(SDL_HasMMX())
 			return Blit555to555SurfaceAlphaMMX;
 		else
 #endif
@@ -1413,7 +1406,7 @@
 		   && sf->BytesPerPixel == 4)
 		{
 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
-		if((CPU_Flags()&MMX_CPU)!=0)
+		if(SDL_HasMMX())
 		    return BlitRGBtoRGBSurfaceAlphaMMX;
 		else
 #endif
@@ -1453,12 +1446,10 @@
 	       && sf->BytesPerPixel == 4)
 	    {
 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
-		Uint32 f;
-		f=CPU_Flags();
-		if((f&(TDNOW_CPU|MMX_CPU))==(TDNOW_CPU|MMX_CPU))
+		if(SDL_Has3DNow())
 		    return BlitRGBtoRGBPixelAlphaMMX3DNOW;
 		else
-		if((f&MMX_CPU)!=0)
+		if(SDL_HasMMX())
 		    return BlitRGBtoRGBPixelAlphaMMX;
 		else
 #endif