summaryrefslogtreecommitdiffstats
path: root/src/mesa/x86-64/xform4.S
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2008-09-28 20:31:46 -0700
committerIan Romanick <[email protected]>2008-09-28 20:32:05 -0700
commit2b8d8989fb6f9c36baf166fc715182a1407ebadb (patch)
tree430c8f0b6d57b8ebce7bb6e3915c7d4cb598c39e /src/mesa/x86-64/xform4.S
parentb5d59222ccbec9db23b6847737765a4dc0d8c47b (diff)
Use 3Dnow! x86-64 routines only on processors that support 3Dnow!
Added an x86-64 CPUID function and use it to detect 3Dnow! If 3Dnow! is available, use _mesa_3dnow_transform_points4_3d_no_rot, _mesa_3dnow_transform_points4_perspective, _mesa_3dnow_transform_points4_2d_no_rot, and _mesa_3dnow_transform_points4_2d. This fixes long standing bug #8724.
Diffstat (limited to 'src/mesa/x86-64/xform4.S')
-rw-r--r--src/mesa/x86-64/xform4.S31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/mesa/x86-64/xform4.S b/src/mesa/x86-64/xform4.S
index 3f9c9d56ab7..805969127db 100644
--- a/src/mesa/x86-64/xform4.S
+++ b/src/mesa/x86-64/xform4.S
@@ -29,7 +29,22 @@
.text
.align 16
+.globl _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
_mesa_x86_64_transform_points4_general:
/*
@@ -204,8 +219,8 @@ 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
+_mesa_3dnow_transform_points4_3d_no_rot:
movl V4F_COUNT(%rdx), %ecx /* count */
movzx V4F_STRIDE(%rdx), %eax /* stride */
@@ -268,8 +283,8 @@ 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
+_mesa_3dnow_transform_points4_perspective:
movl V4F_COUNT(%rdx), %ecx /* count */
movzx V4F_STRIDE(%rdx), %eax /* stride */
@@ -334,8 +349,8 @@ 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
+_mesa_3dnow_transform_points4_2d_no_rot:
movl V4F_COUNT(%rdx), %ecx /* count */
movzx V4F_STRIDE(%rdx), %eax /* stride */
@@ -389,8 +404,8 @@ 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
+_mesa_3dnow_transform_points4_2d:
movl V4F_COUNT(%rdx), %ecx /* count */
movzx V4F_STRIDE(%rdx), %eax /* stride */