[PD-cvs] pd/src m_simd_sse_gcc.h,1.1.2.4,1.1.2.5 m_simd_sse_gcc.c,1.1.2.2,1.1.2.3 m_simd_ve_gcc.h,1.1.2.3,1.1.2.4 m_simd_sse_vc.c,1.1.2.1,1.1.2.2 m_simd_sse_vc.h,1.1.2.3,1.1.2.4 m_simd_def.h,1.1.2.3,1.1.2.4 m_simd.h,1.1.2.4,1.1.2.5

Tim Blechmann timblech at users.sourceforge.net
Mon Aug 30 21:56:33 CEST 2004


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11133

Modified Files:
      Tag: devel_0_37
	m_simd_sse_gcc.h m_simd_sse_gcc.c m_simd_ve_gcc.h 
	m_simd_sse_vc.c m_simd_sse_vc.h m_simd_def.h m_simd.h 
Log Message:
simd runtime check

Index: m_simd_sse_vc.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_sse_vc.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** m_simd_sse_vc.c	23 Dec 2003 01:15:39 -0000	1.1.2.1
--- m_simd_sse_vc.c	30 Aug 2004 19:56:30 -0000	1.1.2.2
***************
*** 725,727 ****
--- 725,740 ----
  }
  
+ /* TB: runtime check */
+ t_int simd_runtime_check()
+ {
+     unsigned int edx;
+     __asm
+ 	{
+ 	    cpuid
+ 	    mov [edx],edx     
+ 	}
+     return (0x2000000 & edx);
+ }
+ 
  #endif
+ 

Index: m_simd_sse_gcc.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_sse_gcc.h,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** m_simd_sse_gcc.h	10 Jul 2004 19:57:21 -0000	1.1.2.4
--- m_simd_sse_gcc.h	30 Aug 2004 19:56:30 -0000	1.1.2.5
***************
*** 62,64 ****
--- 62,67 ----
  #define sigrsqrt_perf_simd      sigrsqrt_perform /* SIMD not implemented */
  
+ /* TB: runtime check */
+ t_int simd_runtime_check(void);
+ 
  #endif /* __M_SIMD_SSE_GCC_H */

Index: m_simd_sse_vc.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_sse_vc.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** m_simd_sse_vc.h	29 Dec 2003 02:01:57 -0000	1.1.2.3
--- m_simd_sse_vc.h	30 Aug 2004 19:56:30 -0000	1.1.2.4
***************
*** 62,64 ****
--- 62,73 ----
  #define sigrsqrt_perf_simd      sigrsqrt_perform /* SIMD not implemented */
  
+ /* TB: runtime check */
+ t_int simd_runtime_check()
+ {
+     unsigned int eax, edx;
+     __asm__("cpuid" : "=a"(eax),"=d"(edx) : "a" (1): "bx", "cx");
+     return (0x2000000 & edx);
+ }
+ 
+ 
  #endif /* __M_SIMD_SSE_VC_H */

Index: m_simd_def.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_def.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** m_simd_def.h	29 Dec 2003 02:01:57 -0000	1.1.2.3
--- m_simd_def.h	30 Aug 2004 19:56:30 -0000	1.1.2.4
***************
*** 42,44 ****
--- 42,48 ----
  #define sigrsqrt_perf_simd      sigrsqrt_perform /* SIMD not implemented */
  
+ /* TB: runtime check */
+ #define simd_runtime_check()    0
+ 
+ 
  #endif /* __M_SIMD_DEF_H */

Index: m_simd_sse_gcc.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_sse_gcc.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** m_simd_sse_gcc.c	10 Jul 2004 19:57:20 -0000	1.1.2.2
--- m_simd_sse_gcc.c	30 Aug 2004 19:56:30 -0000	1.1.2.3
***************
*** 993,996 ****
--- 993,1011 ----
      );
  
+ /* TB: runtime check */
+ t_int simd_runtime_check()
+ {
+     unsigned int eax, edx;
+     __asm__("cpuid" : "=a"(eax),"=d"(edx) : "a" (1): "bx", "cx");
+     return (0x2000000 & edx);
+ }
+ int simd_runtime_check()
+ {
+     unsigned int eax, edx;
+     __asm__("cpuid" : "=a"(eax),"=d"(edx) : "a" (1): "bx", "cx");
+     return (0x2000000 & edx);
+ }
+ 
+ 
  
  #endif

Index: m_simd.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd.h,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** m_simd.h	28 Dec 2003 12:32:03 -0000	1.1.2.4
--- m_simd.h	30 Aug 2004 19:56:30 -0000	1.1.2.5
***************
*** 56,64 ****
  
  /* check n and 1 pointer at once */
! #define SIMD_CHECK1(n,ptr1) ( SIMD_CHKCNT(n) && SIMD_CHKALIGN(ptr1) )
  /* check n and 2 pointers at once */
! #define SIMD_CHECK2(n,ptr1,ptr2) ( SIMD_CHKCNT(n) && SIMD_CHKALIGN(ptr1) && SIMD_CHKALIGN(ptr2) )
  /* check n and 3 pointers at once */
! #define SIMD_CHECK3(n,ptr1,ptr2,ptr3) ( SIMD_CHKCNT(n) && SIMD_CHKALIGN(ptr1) && SIMD_CHKALIGN(ptr2) && SIMD_CHKALIGN(ptr3) )
  
  
--- 56,64 ----
  
  /* check n and 1 pointer at once */
! #define SIMD_CHECK1(n,ptr1) ( SIMD_CHKCNT(n) && SIMD_CHKALIGN(ptr1) && simd_runtime_check())
  /* check n and 2 pointers at once */
! #define SIMD_CHECK2(n,ptr1,ptr2) ( SIMD_CHKCNT(n) && SIMD_CHKALIGN(ptr1) && SIMD_CHKALIGN(ptr2) && simd_runtime_check() )
  /* check n and 3 pointers at once */
! #define SIMD_CHECK3(n,ptr1,ptr2,ptr3) ( SIMD_CHKCNT(n) && SIMD_CHKALIGN(ptr1) && SIMD_CHKALIGN(ptr2) && SIMD_CHKALIGN(ptr3) && simd_runtime_check() )
  
  

Index: m_simd_ve_gcc.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/m_simd_ve_gcc.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** m_simd_ve_gcc.h	29 Dec 2003 02:01:57 -0000	1.1.2.3
--- m_simd_ve_gcc.h	30 Aug 2004 19:56:30 -0000	1.1.2.4
***************
*** 62,64 ****
--- 62,67 ----
  #define sigrsqrt_perf_simd      sigrsqrt_perf_ve_gcc
  
+ /* TB: runtime check */
+ #define simd_runtime_check()    1
+ 
  #endif /* __M_SIMD_VE_GCC_H */





More information about the Pd-cvs mailing list