Mercurial > sdl-ios-xcode
comparison src/video/SDL_blit.c @ 882:9301b429c99f
Date: Sun, 11 Apr 2004 13:09:44 +0200
From: Stephane Marchesin
Subject: [SDL] [Patch] inlining memcpy functions
I (finally) did some benchmarking of the misc mmx & sse blitting
functions, and found a little bottleneck in the memcpy ones : you get
~10% more performance on small surface blitting if you inline them.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 11 Apr 2004 19:52:58 +0000 |
parents | 9ef41050100c |
children | 68f607298ca9 |
comparison
equal
deleted
inserted
replaced
881:9eb85a211abd | 882:9301b429c99f |
---|---|
114 /* Blit is done! */ | 114 /* Blit is done! */ |
115 return(okay ? 0 : -1); | 115 return(okay ? 0 : -1); |
116 } | 116 } |
117 | 117 |
118 #ifdef MMX_ASMBLIT | 118 #ifdef MMX_ASMBLIT |
119 void SDL_memcpyMMX(char* to,char* from,int len) | 119 static __inline__ void SDL_memcpyMMX(char* to,char* from,int len) |
120 { | 120 { |
121 int i; | 121 int i; |
122 | 122 |
123 for(i=0; i<len/8; i++) { | 123 for(i=0; i<len/8; i++) { |
124 __asm__ __volatile__ ( | 124 __asm__ __volatile__ ( |
130 } | 130 } |
131 if (len&7) | 131 if (len&7) |
132 SDL_memcpy(to, from, len&7); | 132 SDL_memcpy(to, from, len&7); |
133 } | 133 } |
134 | 134 |
135 void SDL_memcpySSE(char* to,char* from,int len) | 135 static __inline__ void SDL_memcpySSE(char* to,char* from,int len) |
136 { | 136 { |
137 int i; | 137 int i; |
138 | 138 |
139 __asm__ __volatile__ ( | 139 __asm__ __volatile__ ( |
140 " prefetchnta (%0)\n" | 140 " prefetchnta (%0)\n" |