Merge remote branch 'origin/opengl-es-v2'
[mesa.git] / src / mesa / x86 / mmx_blend.S
index 9fe3e7179619502f5e567a6892d32da7cf075f16..eeaf43ea9370e9cd91558942877b746df4ff154d 100644 (file)
@@ -1,9 +1,12 @@
+       ;
 /*
- * Written by José Fonseca <j_r_fonseca@yahoo.co.uk>
+ * Written by Jos Fonseca <j_r_fonseca@yahoo.co.uk>
  */
 
-#include "matypes.h"
 
+#ifdef USE_MMX_ASM
+#include "assyntax.h"
+#include "matypes.h"
 
 /* integer multiplication - alpha plus one
  *
@@ -238,7 +241,9 @@ TWO(PUNPCKHDQ  ( MA2, MA2 ))                    /*    pa2    |    pa2    |    pa
 ONE(MOVD       ( MSS, REGIND(rgba) ))          /*     |     |     |     | sa1 | sb1 | sg1 | sr1 */     ;\
 TWO(MOVQ       ( MSS, REGIND(rgba) ))          /* sa2 | sb2 | sg2 | sr2 | sa1 | sb1 | sg1 | sr1 */
 
-
+/* Kevin F. Quinn <kevquinn@gentoo.org> 2 July 2006
+ * Replace data segment constants with text-segment
+ * constants (via pushl/movq)
     SEG_DATA
 
 ALIGNDATA8
@@ -247,6 +252,11 @@ const_0080:
 
 const_80:
     D_LONG 0x80808080, 0x80808080
+*/
+#define const_0080_l 0x00800080
+#define const_0080_h 0x00800080
+#define const_80_l 0x80808080
+#define const_80_h 0x80808080
 
     SEG_TEXT
 
@@ -254,7 +264,8 @@ const_80:
 /* Blend transparency function
  */
 
-#define TAG(x) x##_transparency
+#define TAG(x) CONCAT(x,_transparency)
+#define LLTAG(x) LLBL2(x,_transparency)
 
 #define INIT \
     PXOR       ( MM0, MM0 )                    /*   0x0000  |   0x0000  |   0x0000  |   0x0000  */
@@ -275,7 +286,8 @@ const_80:
  * FIXME: Add some loop unrolling here...
  */
 
-#define TAG(x) x##_add
+#define TAG(x) CONCAT(x,_add)
+#define LLTAG(x) LLBL2(x,_add)
 
 #define INIT
 
@@ -295,10 +307,19 @@ TWO(MOVQ       ( MM1, REGIND(rgba) ))
 /* Blend min function
  */
 
-#define TAG(x) x##_min
+#define TAG(x) CONCAT(x,_min)
+#define LLTAG(x) LLBL2(x,_min)
 
+/* Kevin F. Quinn 2nd July 2006
+ * Replace data segment constants with text-segment instructions
+#define INIT \
+    MOVQ       ( CONTENT(const_80), MM7 )
+ */
 #define INIT \
-    MOVQ       ( CONTENT(const_80), MM7 )      /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/
+    PUSH_L     ( CONST(const_80_h) )           /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/     ;\
+    PUSH_L     ( CONST(const_80_l) )                                                                   ;\
+    MOVQ       ( REGIND(ESP), MM7 )                                                                    ;\
+    ADD_L      ( CONST(8), ESP)
 
 #define MAIN( rgba, dest ) \
     GMB_LOAD( rgba, dest, MM1, MM2 )                                                                   ;\
@@ -318,10 +339,19 @@ TWO(MOVQ       ( MM1, REGIND(rgba) ))
 /* Blend max function
  */
 
-#define TAG(x) x##_max
+#define TAG(x) CONCAT(x,_max)
+#define LLTAG(x) LLBL2(x,_max)
 
+/* Kevin F. Quinn 2nd July 2006
+ * Replace data segment constants with text-segment instructions
 #define INIT \
-    MOVQ       ( CONTENT(const_80), MM7 )      /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/
+    MOVQ       ( CONTENT(const_80), MM7 )
+ */
+#define INIT \
+    PUSH_L     ( CONST(const_80_l) )           /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/     ;\
+    PUSH_L     ( CONST(const_80_h) )                                                                   ;\
+    MOVQ       ( REGIND(ESP), MM7 )                                                                    ;\
+    ADD_L      ( CONST(8), ESP)
 
 #define MAIN( rgba, dest ) \
     GMB_LOAD( rgba, dest, MM1, MM2 )                                                                   ;\
@@ -341,11 +371,20 @@ TWO(MOVQ       ( MM1, REGIND(rgba) ))
 /* Blend modulate function
  */
 
-#define TAG(x) x##_modulate
+#define TAG(x) CONCAT(x,_modulate)
+#define LLTAG(x) LLBL2(x,_modulate)
 
+/* Kevin F. Quinn 2nd July 2006
+ * Replace data segment constants with text-segment instructions
+#define INIT \
+    MOVQ       ( CONTENT(const_0080), MM7 )
+ */
 #define INIT \
     PXOR       ( MM0, MM0 )                    /*   0x0000  |   0x0000  |   0x0000  |   0x0000  */     ;\
-    MOVQ       ( CONTENT(const_0080), MM7 )    /*   0x0080  |   0x0080  |   0x0080  |   0x0080  */
+    PUSH_L     ( CONST(const_0080_l) )         /*   0x0080  |   0x0080  |   0x0080  |   0x0080  */     ;\
+    PUSH_L     ( CONST(const_0080_h) )                                                                 ;\
+    MOVQ       ( REGIND(ESP), MM7 )                                                                    ;\
+    ADD_L      ( CONST(8), ESP)
 
 #define MAIN( rgba, dest ) \
     GMB_LOAD( rgba, dest, MM1, MM2 )                                                                   ;\
@@ -356,3 +395,8 @@ TWO(MOVQ       ( MM1, REGIND(rgba) ))
 
 #include "mmx_blendtmp.h"
 
+#endif
+       
+#if defined (__ELF__) && defined (__linux__)
+       .section .note.GNU-stack,"",%progbits
+#endif