Merge branch 'master' of git://anongit.freedesktop.org/mesa/mesa
[mesa.git] / src / mesa / x86-64 / xform4.S
index 622c3f0c25188a50c4fa15dd3c9439ecd4afb58a..5abd5a25de5c080a197d3cc8e87e4799a7ff929f 100644 (file)
@@ -1,10 +1,8 @@
-/* $Id: xform4.S,v 1.1 2005/05/07 16:59:59 brianp Exp $ */
-
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  7.1
  *
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 .text
 
 .align 16
+.globl _mesa_x86_64_cpuid
+.hidden _mesa_x86_64_cpuid
+_mesa_x86_64_cpuid:
+       pushq   %rbx
+       movl    (%rdi), %eax
+       movl    8(%rdi), %ecx
+
+       cpuid
+
+       movl    %ebx, 4(%rdi)
+       movl    %eax, (%rdi)
+       movl    %ecx, 8(%rdi)
+       movl    %edx, 12(%rdi)
+       popq    %rbx
+       ret
 
+.align 16
 .globl _mesa_x86_64_transform_points4_general
+.hidden _mesa_x86_64_transform_points4_general
 _mesa_x86_64_transform_points4_general:
 /*
  *     rdi = dest
@@ -40,7 +55,7 @@ _mesa_x86_64_transform_points4_general:
  *     rdx = source
  */
        movl V4F_COUNT(%rdx), %ecx      /* count */
-       movzx V4F_STRIDE(%rdx), %eax    /* stride */
+       movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
        movl %ecx, V4F_COUNT(%rdi)      /* set dest count */
        movl $4, V4F_SIZE(%rdi)         /* set dest size */
@@ -64,7 +79,7 @@ _mesa_x86_64_transform_points4_general:
 
 p4_general_loop:
 
-       movaps (%rdx), %xmm8            /* ox | oy | oz | ow */
+       movups (%rdx), %xmm8            /* ox | oy | oz | ow */
        prefetchw 16(%rdi)
 
        pshufd $0x00, %xmm8, %xmm0      /* ox | ox | ox | ox */
@@ -103,11 +118,12 @@ p4_constants:
 .byte  0x00, 0x00, 0x00, 0x00
 .byte  0x00, 0x00, 0x00, 0x00
 .byte  0x00, 0x00, 0x00, 0x00
-.float 0f+1.0
+.float 1.0
 
 .text
 .align 16
 .globl _mesa_x86_64_transform_points4_3d
+.hidden _mesa_x86_64_transform_points4_3d
 /*
  * this is slower than _mesa_x86_64_transform_points4_general
  * because it ensures that the last matrix row (or is it column?) is 0,0,0,1
@@ -122,7 +138,7 @@ _mesa_x86_64_transform_points4_3d:
        movaps 16(%rax), %xmm10
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
-       movzx V4F_STRIDE(%rdx), %eax    /* stride */
+       movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
        movl %ecx, V4F_COUNT(%rdi)      /* set dest count */
        movl $4, V4F_SIZE(%rdi)         /* set dest size */
@@ -149,7 +165,7 @@ _mesa_x86_64_transform_points4_3d:
 
 p4_3d_loop:
 
-       movaps (%rdx), %xmm8            /* ox | oy | oz | ow */
+       movups (%rdx), %xmm8            /* ox | oy | oz | ow */
        prefetchw 16(%rdi)
 
        pshufd $0x00, %xmm8, %xmm0      /* ox | ox | ox | ox */
@@ -179,10 +195,11 @@ p4_3d_done:
 
 .align 16
 .globl _mesa_x86_64_transform_points4_identity
+.hidden _mesa_x86_64_transform_points4_identity
 _mesa_x86_64_transform_points4_identity:
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
-       movzx V4F_STRIDE(%rdx), %eax    /* stride */
+       movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
        movl %ecx, V4F_COUNT(%rdi)      /* set dest count */
        movl $4, V4F_SIZE(%rdi)         /* set dest size */
@@ -206,11 +223,12 @@ p4_identity_done:
 
        
 .align 16
-.globl _mesa_x86_64_transform_points4_3d_no_rot
-_mesa_x86_64_transform_points4_3d_no_rot:
+.globl _mesa_3dnow_transform_points4_3d_no_rot
+.hidden _mesa_3dnow_transform_points4_3d_no_rot
+_mesa_3dnow_transform_points4_3d_no_rot:
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
-       movzx V4F_STRIDE(%rdx), %eax    /* stride */
+       movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
        movl %ecx, V4F_COUNT(%rdi)      /* set dest count */
        movl $4, V4F_SIZE(%rdi)         /* set dest size */
@@ -270,11 +288,12 @@ p4_3d_no_rot_done:
 
        
 .align 16
-.globl _mesa_x86_64_transform_points4_perspective
-_mesa_x86_64_transform_points4_perspective:
+.globl _mesa_3dnow_transform_points4_perspective
+.hidden _mesa_3dnow_transform_points4_perspective
+_mesa_3dnow_transform_points4_perspective:
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
-       movzx V4F_STRIDE(%rdx), %eax    /* stride */
+       movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
        movl %ecx, V4F_COUNT(%rdi)      /* set dest count */
        movl $4, V4F_SIZE(%rdi)         /* set dest size */
@@ -336,11 +355,12 @@ p4_perspective_done:
        ret
 
 .align 16
-.globl _mesa_x86_64_transform_points4_2d_no_rot
-_mesa_x86_64_transform_points4_2d_no_rot:
+.globl _mesa_3dnow_transform_points4_2d_no_rot
+.hidden _mesa_3dnow_transform_points4_2d_no_rot
+_mesa_3dnow_transform_points4_2d_no_rot:
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
-       movzx V4F_STRIDE(%rdx), %eax    /* stride */
+       movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
        movl %ecx, V4F_COUNT(%rdi)      /* set dest count */
        movl $4, V4F_SIZE(%rdi)         /* set dest size */
@@ -391,11 +411,12 @@ p4_2d_no_rot_done:
 
        
 .align 16
-.globl _mesa_x86_64_transform_points4_2d
-_mesa_x86_64_transform_points4_2d:
+.globl _mesa_3dnow_transform_points4_2d
+.hidden _mesa_3dnow_transform_points4_2d
+_mesa_3dnow_transform_points4_2d:
 
        movl V4F_COUNT(%rdx), %ecx      /* count */
-       movzx V4F_STRIDE(%rdx), %eax    /* stride */
+       movzbl V4F_STRIDE(%rdx), %eax   /* stride */
 
        movl %ecx, V4F_COUNT(%rdi)      /* set dest count */
        movl $4, V4F_SIZE(%rdi)         /* set dest size */
@@ -456,3 +477,7 @@ p4_2d_done:
        ret
                        
 #endif
+       
+#if defined (__ELF__) && defined (__linux__)
+       .section .note.GNU-stack,"",%progbits
+#endif