forked from FFTW/fftw3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[empty commit message]
- Loading branch information
Showing
11 changed files
with
439 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SUBDIRS = common sse2 avx | ||
SUBDIRS = common sse2 avx altivec | ||
EXTRA_DIST = n1b.h n1f.h n2b.h n2f.h n2s.h q1b.h q1f.h t1b.h t1bu.h \ | ||
t1f.h t1fu.h t2b.h t2f.h t3b.h t3f.h ts.h codlist.mk simd.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
AM_CFLAGS = $(ALTIVEC_CFLAGS) | ||
noinst_LTLIBRARIES = libdft_altivec_codelets.la | ||
SIMD_HEADER=simd-altivec.h | ||
|
||
include $(top_srcdir)/dft/simd/codlist.mk | ||
include $(top_srcdir)/dft/simd/simd.mk | ||
|
||
if HAVE_ALTIVEC | ||
BUILT_SOURCES = $(EXTRA_DIST) | ||
endif | ||
|
||
libdft_altivec_codelets_la_SOURCES = $(BUILT_SOURCES) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
SUBDIRS = common sse2 avx | ||
SUBDIRS = common sse2 avx altivec | ||
EXTRA_DIST = hc2cbv.h hc2cfv.h codlist.mk simd.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
AM_CFLAGS = $(ALTIVEC_CFLAGS) | ||
noinst_LTLIBRARIES = librdft_altivec_codelets.la | ||
SIMD_HEADER=simd-altivec.h | ||
|
||
include $(top_srcdir)/rdft/simd/codlist.mk | ||
include $(top_srcdir)/rdft/simd/simd.mk | ||
|
||
if HAVE_ALTIVEC | ||
BUILT_SOURCES = $(EXTRA_DIST) | ||
endif | ||
|
||
librdft_altivec_codelets_la_SOURCES = $(BUILT_SOURCES) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright (c) 2003, 2007-8 Matteo Frigo | ||
* Copyright (c) 2003, 2007-8 Massachusetts Institute of Technology | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
*/ | ||
|
||
|
||
#include "ifftw.h" | ||
|
||
#if HAVE_ALTIVEC | ||
|
||
#if HAVE_SYS_SYSCTL_H | ||
# include <sys/sysctl.h> | ||
#endif | ||
|
||
#if HAVE_SYS_SYSCTL_H && HAVE_SYSCTL && defined(CTL_HW) && defined(HW_VECTORUNIT) | ||
/* code for darwin */ | ||
static int really_have_altivec(void) | ||
{ | ||
int mib[2], altivecp; | ||
size_t len; | ||
mib[0] = CTL_HW; | ||
mib[1] = HW_VECTORUNIT; | ||
len = sizeof(altivecp); | ||
sysctl(mib, 2, &altivecp, &len, NULL, 0); | ||
return altivecp; | ||
} | ||
#else /* GNU/Linux and other non-Darwin systems (!HAVE_SYS_SYSCTL_H etc.) */ | ||
|
||
#include <signal.h> | ||
#include <setjmp.h> | ||
|
||
static jmp_buf jb; | ||
|
||
static void sighandler(int x) | ||
{ | ||
longjmp(jb, 1); | ||
} | ||
|
||
static int really_have_altivec(void) | ||
{ | ||
void (*oldsig)(int); | ||
oldsig = signal(SIGILL, sighandler); | ||
if (setjmp(jb)) { | ||
signal(SIGILL, oldsig); | ||
return 0; | ||
} else { | ||
__asm__ __volatile__ (".long 0x10000484"); /* vor 0,0,0 */ | ||
signal(SIGILL, oldsig); | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
#endif | ||
|
||
int X(have_simd_altivec)(void) | ||
{ | ||
static int init = 0, res; | ||
if (!init) { | ||
res = really_have_altivec(); | ||
init = 1; | ||
} | ||
return res; | ||
} | ||
|
||
#endif |
Oops, something went wrong.