From 2b8d8989fb6f9c36baf166fc715182a1407ebadb Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sun, 28 Sep 2008 20:31:46 -0700 Subject: 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. --- src/mesa/x86-64/xform4.S | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src/mesa/x86-64/xform4.S') diff --git a/src/mesa/x86-64/xform4.S b/src/mesa/x86-64/xform4.S index 3f9c9d56ab..805969127d 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 */ -- cgit v1.2.3