Add SPE extensions support for PowerPC (after a work by Thomas JOURDAN).
Add a PowerPC sample that supports SPE extensions.
/trunk/arch/powerpc/functions | 13 13 0 0 +
/trunk/arch/powerpc/config.in | 8 8 0 0 +
/trunk/patches/gcc/4.3.1/340-make-mno-spe-work-as-expected.patch | 90 90 0 0 ++++
/trunk/samples/powerpc-unknown-linux-gnuspe/crosstool.config | 309 309 0 0 ++++++++++++++
4 files changed, 420 insertions(+)
1.1 --- a/arch/powerpc/config.in Tue Aug 12 09:54:42 2008 +0000
1.2 +++ b/arch/powerpc/config.in Tue Aug 12 09:56:19 2008 +0000
1.3 @@ -7,3 +7,11 @@
1.4 help
1.5 The PowerPC architecture, as defined by:
1.6 http://www.ibm.com/developerworks/eserver/articles/archguide.html
1.7 +
1.8 +config ARCH_POWERPC_SPE
1.9 + bool
1.10 + prompt "Enable SPE support (EXPERIMENTAL)"
1.11 + depends on EXPERIMENTAL
1.12 + default n
1.13 + help
1.14 + Add support for the Signal Processing Engine.
2.1 --- a/arch/powerpc/functions Tue Aug 12 09:54:42 2008 +0000
2.2 +++ b/arch/powerpc/functions Tue Aug 12 09:56:19 2008 +0000
2.3 @@ -6,4 +6,17 @@
2.4
2.5 # The kernel ARCH:
2.6 CT_KERNEL_ARCH=powerpc
2.7 +
2.8 + # Add spe in the tuplet if needed
2.9 + case "${CT_LIBC},${CT_ARCH_POWERPC_SPE}" in
2.10 + glibc,|eglibc,) CT_TARGET_SYS=gnu;;
2.11 + glibc,y|eglibc,y) CT_TARGET_SYS=gnuspe;;
2.12 + esac
2.13 +
2.14 + # Add extra flags for SPE if needed
2.15 + if [ "${CT_ARCH_POWERPC_SPE}" = "y" ]; then
2.16 + CT_ARCH_TARGET_CFLAGS="-mabi=spe -mspe"
2.17 + CT_ARCH_CC_CORE_EXTRA_CONFIG="--enable-e500_double"
2.18 + CT_ARCH_CC_EXTRA_CONFIG="--enable-e500_double"
2.19 + fi
2.20 }
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/patches/eglibc/trunk/100-powerpc-private_futex.patch Tue Aug 12 09:56:19 2008 +0000
3.3 @@ -0,0 +1,15 @@
3.4 +2008-04-28 Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
3.5 +
3.6 + [BZ 6740]
3.7 + nptl/sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET):
3.8 + Guard sym definition with #ifndef __ASSUME_PRIVATE_FUTEX.
3.9 +
3.10 +--- a/nptl/sysdeps/powerpc/tcb-offsets.sym
3.11 ++++ b/nptl/sysdeps/powerpc/tcb-offsets.sym
3.12 +@@ -15,4 +15,6 @@
3.13 + PID thread_offsetof (pid)
3.14 + TID thread_offsetof (tid)
3.15 + POINTER_GUARD (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
3.16 ++#ifndef __ASSUME_PRIVATE_FUTEX
3.17 + PRIVATE_FUTEX_OFFSET thread_offsetof (header.private_futex)
3.18 ++#endif
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/patches/gcc/4.3.1/340-make-mno-spe-work-as-expected.patch Tue Aug 12 09:56:19 2008 +0000
4.3 @@ -0,0 +1,90 @@
4.4 +2008-04-03 Nathan Froyd <froydnj@codesourcery.com>
4.5 + Nathan Sidwell <nathan@codesourcery.com>
4.6 +
4.7 + * config/rs6000/rs6000.opt (mspe): Remove Var property.
4.8 + (misel): Likewise.
4.9 + * config/rs6000/rs6000.h (rs6000_spe): Declare.
4.10 + (rs6000_isel): Likewise.
4.11 + * config/rs6000/rs6000.c (rs6000_spe): New variable.
4.12 + (rs6000_isel): New variable.
4.13 + (rs6000_handle_option): Handle OPT_mspe and OPT_misel.
4.14 +
4.15 +Index: gcc/config/rs6000/rs6000.c
4.16 +===================================================================
4.17 +--- a/gcc/config/rs6000/rs6000.c (revision 134642)
4.18 ++++ b/gcc/config/rs6000/rs6000.c (working copy)
4.19 +@@ -174,9 +174,15 @@ int rs6000_ieeequad;
4.20 + /* Nonzero to use AltiVec ABI. */
4.21 + int rs6000_altivec_abi;
4.22 +
4.23 ++/* Nonzero if we want SPE SIMD instructions. */
4.24 ++int rs6000_spe;
4.25 ++
4.26 + /* Nonzero if we want SPE ABI extensions. */
4.27 + int rs6000_spe_abi;
4.28 +
4.29 ++/* Nonzero to use isel instructions. */
4.30 ++int rs6000_isel;
4.31 ++
4.32 + /* Nonzero if floating point operations are done in the GPRs. */
4.33 + int rs6000_float_gprs = 0;
4.34 +
4.35 +@@ -2177,11 +2183,21 @@ rs6000_handle_option (size_t code, const
4.36 + rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE));
4.37 + break;
4.38 +
4.39 ++ case OPT_misel:
4.40 ++ rs6000_explicit_options.isel = true;
4.41 ++ rs6000_isel = value;
4.42 ++ break;
4.43 ++
4.44 + case OPT_misel_:
4.45 + rs6000_explicit_options.isel = true;
4.46 + rs6000_parse_yes_no_option ("isel", arg, &(rs6000_isel));
4.47 + break;
4.48 +
4.49 ++ case OPT_mspe:
4.50 ++ rs6000_explicit_options.spe = true;
4.51 ++ rs6000_spe = value;
4.52 ++ break;
4.53 ++
4.54 + case OPT_mspe_:
4.55 + rs6000_explicit_options.spe = true;
4.56 + rs6000_parse_yes_no_option ("spe", arg, &(rs6000_spe));
4.57 +Index: gcc/config/rs6000/rs6000.opt
4.58 +===================================================================
4.59 +--- a/gcc/config/rs6000/rs6000.opt (revision 134642)
4.60 ++++ b/gcc/config/rs6000/rs6000.opt (working copy)
4.61 +@@ -190,7 +190,7 @@ Target RejectNegative Joined
4.62 + -mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead
4.63 +
4.64 + misel
4.65 +-Target Var(rs6000_isel)
4.66 ++Target
4.67 + Generate isel instructions
4.68 +
4.69 + misel=
4.70 +@@ -198,7 +198,7 @@ Target RejectNegative Joined
4.71 + -misel=yes/no Deprecated option. Use -misel/-mno-isel instead
4.72 +
4.73 + mspe
4.74 +-Target Var(rs6000_spe)
4.75 ++Target
4.76 + Generate SPE SIMD instructions on E500
4.77 +
4.78 + mpaired
4.79 +Index: gcc/config/rs6000/rs6000.h
4.80 +===================================================================
4.81 +--- a/gcc/config/rs6000/rs6000.h (revision 134642)
4.82 ++++ b/gcc/config/rs6000/rs6000.h (working copy)
4.83 +@@ -367,6 +367,8 @@ extern int rs6000_long_double_type_size;
4.84 + extern int rs6000_ieeequad;
4.85 + extern int rs6000_altivec_abi;
4.86 + extern int rs6000_spe_abi;
4.87 ++extern int rs6000_spe;
4.88 ++extern int rs6000_isel;
4.89 + extern int rs6000_float_gprs;
4.90 + extern int rs6000_alignment_flags;
4.91 + extern const char *rs6000_sched_insert_nops_str;
4.92 +
4.93 +
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/samples/powerpc-unknown-linux-gnuspe/crosstool.config Tue Aug 12 09:56:19 2008 +0000
5.3 @@ -0,0 +1,309 @@
5.4 +#
5.5 +# Automatically generated make config: don't edit
5.6 +# crosstool-NG version: 1.2.0+svn_trunk@939M
5.7 +# Tue Aug 12 10:25:48 2008
5.8 +#
5.9 +
5.10 +#
5.11 +# Paths and misc options
5.12 +#
5.13 +
5.14 +#
5.15 +# crosstool-NG behavior
5.16 +#
5.17 +# CT_OBSOLETE is not set
5.18 +CT_EXPERIMENTAL=y
5.19 +# CT_BROKEN is not set
5.20 +# CT_DEBUG_CT is not set
5.21 +
5.22 +#
5.23 +# Paths
5.24 +#
5.25 +CT_LOCAL_TARBALLS_DIR="${HOME}/src"
5.26 +CT_SAVE_TARBALLS=y
5.27 +CT_WORK_DIR="${CT_TOP_DIR}/targets"
5.28 +CT_PREFIX_DIR="${HOME}/x-tools/${CT_TARGET}"
5.29 +CT_INSTALL_DIR="${CT_PREFIX_DIR}"
5.30 +# CT_CUSTOM_PATCH is not set
5.31 +CT_REMOVE_DOCS=y
5.32 +CT_INSTALL_DIR_RO=y
5.33 +
5.34 +#
5.35 +# Downloading
5.36 +#
5.37 +# CT_FORCE_DOWNLOAD is not set
5.38 +CT_USE_PROXY=y
5.39 +# CT_PROXY_TYPE_HTTP is not set
5.40 +CT_PROXY_TYPE_SOCKS=y
5.41 +CT_PROXY_TYPE_SOCKS_SYS=y
5.42 +# CT_PROXY_TYPE_SOCKS_AUTO is not set
5.43 +# CT_PROXY_TYPE_SOCKS_4 is not set
5.44 +# CT_PROXY_TYPE_SOCKS_5 is not set
5.45 +CT_PROXY_TYPE="sockssys"
5.46 +# CT_USE_LAN_MIRROR is not set
5.47 +CT_CONNECT_TIMEOUT=10
5.48 +# CT_ONLY_DOWNLOAD is not set
5.49 +
5.50 +#
5.51 +# Extracting
5.52 +#
5.53 +# CT_FORCE_EXTRACT is not set
5.54 +CT_OVERIDE_CONFIG_GUESS_SUB=y
5.55 +# CT_ONLY_EXTRACT is not set
5.56 +
5.57 +#
5.58 +# Build behavior
5.59 +#
5.60 +CT_PARALLEL_JOBS=1
5.61 +CT_LOAD=0
5.62 +CT_NICE=0
5.63 +CT_USE_PIPES=y
5.64 +
5.65 +#
5.66 +# Logging
5.67 +#
5.68 +# CT_LOG_ERROR is not set
5.69 +# CT_LOG_WARN is not set
5.70 +# CT_LOG_INFO is not set
5.71 +CT_LOG_EXTRA=y
5.72 +# CT_LOG_DEBUG is not set
5.73 +# CT_LOG_ALL is not set
5.74 +CT_LOG_LEVEL_MAX="EXTRA"
5.75 +# CT_LOG_SEE_TOOLS_WARN is not set
5.76 +CT_LOG_PROGRESS_BAR=y
5.77 +CT_LOG_TO_FILE=y
5.78 +CT_LOG_FILE_COMPRESS=y
5.79 +
5.80 +#
5.81 +# Target options
5.82 +#
5.83 +CT_ARCH="powerpc"
5.84 +# CT_ARCH_SUPPORT_ARCH is not set
5.85 +CT_ARCH_SUPPORT_ABI=y
5.86 +CT_ARCH_SUPPORT_CPU=y
5.87 +CT_ARCH_SUPPORT_TUNE=y
5.88 +# CT_ARCH_SUPPORT_FPU is not set
5.89 +# CT_ARCH_SUPPORTS_BOTH_ENDIAN is not set
5.90 +# CT_ARCH_DEFAULT_BE is not set
5.91 +# CT_ARCH_DEFAULT_LE is not set
5.92 +CT_ARCH_ABI=""
5.93 +CT_ARCH_CPU="8548"
5.94 +CT_ARCH_TUNE="8548"
5.95 +CT_ARCH_FLOAT_HW=y
5.96 +# CT_ARCH_FLOAT_SW is not set
5.97 +CT_TARGET_CFLAGS=""
5.98 +CT_TARGET_LDFLAGS=""
5.99 +
5.100 +#
5.101 +# General target options
5.102 +#
5.103 +# CT_ARCH_alpha is not set
5.104 +# CT_ARCH_arm is not set
5.105 +# CT_ARCH_ia64 is not set
5.106 +# CT_ARCH_mips is not set
5.107 +CT_ARCH_powerpc=y
5.108 +CT_ARCH_POWERPC_SPE=y
5.109 +# CT_ARCH_sh is not set
5.110 +# CT_ARCH_x86 is not set
5.111 +# CT_ARCH_x86_64 is not set
5.112 +
5.113 +#
5.114 +# Target optimisations
5.115 +#
5.116 +
5.117 +#
5.118 +# Toolchain options
5.119 +#
5.120 +
5.121 +#
5.122 +# General toolchain options
5.123 +#
5.124 +CT_USE_SYSROOT=y
5.125 +CT_SHARED_LIBS=y
5.126 +CT_THREADS_NPTL=y
5.127 +# CT_THREADS_LINUXTHREADS is not set
5.128 +# CT_THREADS_NONE is not set
5.129 +CT_THREADS="nptl"
5.130 +CT_TARGET_VENDOR="unknown"
5.131 +CT_TARGET_ALIAS_SED_EXPR=""
5.132 +CT_TARGET_ALIAS=""
5.133 +
5.134 +#
5.135 +# Toolchain type
5.136 +#
5.137 +# CT_NATIVE is not set
5.138 +CT_CROSS=y
5.139 +# CT_CROSS_NATIVE is not set
5.140 +# CT_CANADIAN is not set
5.141 +CT_TOOLCHAIN_TYPE="cross"
5.142 +CT_BUILD=""
5.143 +CT_CC_NATIVE="gcc"
5.144 +
5.145 +#
5.146 +# Kernel
5.147 +#
5.148 +CT_KERNEL_LINUX=y
5.149 +CT_KERNEL_VERSION="2.6.26.2"
5.150 +CT_KERNEL_LINUX_HEADERS_INSTALL=y
5.151 +# CT_KERNEL_LINUX_HEADERS_SANITISED is not set
5.152 +# CT_KERNEL_LINUX_HEADERS_COPY is not set
5.153 +# CT_KERNEL_LINUX_HEADERS_USE_CUSTOM_DIR is not set
5.154 +CT_KERNEL="linux"
5.155 +CT_KERNEL_VERSION_SEE_EXTRAVERSION=y
5.156 +# CT_KERNEL_INSTALL_V_2_6_18_8 is not set
5.157 +# CT_KERNEL_INSTALL_V_2_6_19_7 is not set
5.158 +# CT_KERNEL_INSTALL_V_2_6_20_21 is not set
5.159 +# CT_KERNEL_INSTALL_V_2_6_21_7 is not set
5.160 +# CT_KERNEL_INSTALL_V_2_6_22_19 is not set
5.161 +# CT_KERNEL_INSTALL_V_2_6_23_17 is not set
5.162 +# CT_KERNEL_INSTALL_V_2_6_24 is not set
5.163 +# CT_KERNEL_INSTALL_V_2_6_24_1 is not set
5.164 +# CT_KERNEL_INSTALL_V_2_6_24_2 is not set
5.165 +# CT_KERNEL_INSTALL_V_2_6_24_3 is not set
5.166 +# CT_KERNEL_INSTALL_V_2_6_24_4 is not set
5.167 +# CT_KERNEL_INSTALL_V_2_6_24_5 is not set
5.168 +# CT_KERNEL_INSTALL_V_2_6_24_6 is not set
5.169 +# CT_KERNEL_INSTALL_V_2_6_24_7 is not set
5.170 +# CT_KERNEL_INSTALL_V_2_6_25 is not set
5.171 +# CT_KERNEL_INSTALL_V_2_6_25_1 is not set
5.172 +# CT_KERNEL_INSTALL_V_2_6_25_2 is not set
5.173 +# CT_KERNEL_INSTALL_V_2_6_25_3 is not set
5.174 +# CT_KERNEL_INSTALL_V_2_6_25_4 is not set
5.175 +# CT_KERNEL_INSTALL_V_2_6_25_5 is not set
5.176 +# CT_KERNEL_INSTALL_V_2_6_25_6 is not set
5.177 +# CT_KERNEL_INSTALL_V_2_6_25_7 is not set
5.178 +# CT_KERNEL_INSTALL_V_2_6_25_8 is not set
5.179 +# CT_KERNEL_INSTALL_V_2_6_25_9 is not set
5.180 +# CT_KERNEL_INSTALL_V_2_6_25_10 is not set
5.181 +# CT_KERNEL_INSTALL_V_2_6_25_11 is not set
5.182 +# CT_KERNEL_INSTALL_V_2_6_25_12 is not set
5.183 +# CT_KERNEL_INSTALL_V_2_6_25_13 is not set
5.184 +# CT_KERNEL_INSTALL_V_2_6_25_14 is not set
5.185 +# CT_KERNEL_INSTALL_V_2_6_25_15 is not set
5.186 +# CT_KERNEL_INSTALL_V_2_6_26 is not set
5.187 +# CT_KERNEL_INSTALL_V_2_6_26_1 is not set
5.188 +CT_KERNEL_INSTALL_V_2_6_26_2=y
5.189 +CT_KERNEL_LINUX_HEADERS_INSTALL_CHECK=y
5.190 +CT_KERNEL_LINUX_VERBOSITY_0=y
5.191 +# CT_KERNEL_LINUX_VERBOSITY_1 is not set
5.192 +# CT_KERNEL_LINUX_VERBOSITY_2 is not set
5.193 +CT_KERNEL_LINUX_VERBOSE_LEVEL=0
5.194 +# CT_KERNEL_LINUX_NEEDS_CONFIG is not set
5.195 +
5.196 +#
5.197 +# GMP and MPFR
5.198 +#
5.199 +CT_GMP_MPFR=y
5.200 +CT_GMP_MPFR_TARGET=y
5.201 +CT_GMP_V_4_2_2=y
5.202 +CT_GMP_VERSION="4.2.2"
5.203 +CT_GMP_CHECK=y
5.204 +CT_MPFR_V_2_3_1=y
5.205 +CT_MPFR_VERSION="2.3.1"
5.206 +CT_MPFR_CHECK=y
5.207 +
5.208 +#
5.209 +# binutils
5.210 +#
5.211 +CT_BINUTILS_VERSION="2.18.50.0.8"
5.212 +# CT_BINUTILS_V_2_14 is not set
5.213 +# CT_BINUTILS_V_2_15 is not set
5.214 +# CT_BINUTILS_V_2_16_1 is not set
5.215 +# CT_BINUTILS_V_2_17 is not set
5.216 +# CT_BINUTILS_V_2_18 is not set
5.217 +# CT_BINUTILS_V_2_18_50_0_4 is not set
5.218 +# CT_BINUTILS_V_2_18_50_0_6 is not set
5.219 +# CT_BINUTILS_V_2_18_50_0_7 is not set
5.220 +CT_BINUTILS_V_2_18_50_0_8=y
5.221 +CT_BINUTILS_EXTRA_CONFIG=""
5.222 +CT_BINUTILS_FOR_TARGET=y
5.223 +CT_BINUTILS_FOR_TARGET_IBERTY=y
5.224 +CT_BINUTILS_FOR_TARGET_BFD=y
5.225 +
5.226 +#
5.227 +# C compiler
5.228 +#
5.229 +CT_CC_GCC=y
5.230 +CT_CC_VERSION="4.3.1"
5.231 +CT_CC="gcc"
5.232 +# CT_CC_V_2_95_3 is not set
5.233 +# CT_CC_V_3_2_3 is not set
5.234 +# CT_CC_V_3_3_6 is not set
5.235 +# CT_CC_V_3_4_6 is not set
5.236 +# CT_CC_V_4_0_0 is not set
5.237 +# CT_CC_V_4_0_1 is not set
5.238 +# CT_CC_V_4_0_2 is not set
5.239 +# CT_CC_V_4_0_3 is not set
5.240 +# CT_CC_V_4_0_4 is not set
5.241 +# CT_CC_V_4_1_0 is not set
5.242 +# CT_CC_V_4_1_1 is not set
5.243 +# CT_CC_V_4_1_2 is not set
5.244 +# CT_CC_V_4_2_0 is not set
5.245 +# CT_CC_V_4_2_1 is not set
5.246 +# CT_CC_V_4_2_2 is not set
5.247 +# CT_CC_V_4_2_3 is not set
5.248 +# CT_CC_V_4_2_4 is not set
5.249 +# CT_CC_V_4_3_0 is not set
5.250 +CT_CC_V_4_3_1=y
5.251 +CT_CC_GCC_4_3_or_later=y
5.252 +CT_CC_CXA_ATEXIT=y
5.253 +CT_CC_SJLJ_EXCEPTIONS_CONFIGURE=y
5.254 +# CT_CC_SJLJ_EXCEPTIONS_USE is not set
5.255 +# CT_CC_SJLJ_EXCEPTIONS_DONT_USE is not set
5.256 +CT_CC_CORE_EXTRA_CONFIG=""
5.257 +CT_CC_EXTRA_CONFIG=""
5.258 +CT_CC_PKGVERSION="crosstool-NG-${CT_VERSION}"
5.259 +CT_CC_BUGURL=""
5.260 +CT_CC_SUPPORT_CXX=y
5.261 +CT_CC_SUPPORT_FORTRAN=y
5.262 +CT_CC_SUPPORT_JAVA=y
5.263 +CT_CC_SUPPORT_ADA=y
5.264 +CT_CC_SUPPORT_OBJC=y
5.265 +CT_CC_SUPPORT_OBJCXX=y
5.266 +
5.267 +#
5.268 +# Additional supported languages:
5.269 +#
5.270 +CT_CC_LANG_CXX=y
5.271 +# CT_CC_LANG_FORTRAN is not set
5.272 +# CT_CC_LANG_JAVA is not set
5.273 +# CT_CC_LANG_ADA is not set
5.274 +# CT_CC_LANG_OBJC is not set
5.275 +# CT_CC_LANG_OBJCXX is not set
5.276 +CT_CC_LANG_OTHERS=""
5.277 +
5.278 +#
5.279 +# C-library
5.280 +#
5.281 +# CT_LIBC_GLIBC is not set
5.282 +CT_LIBC_EGLIBC=y
5.283 +# CT_LIBC_UCLIBC is not set
5.284 +CT_LIBC_VERSION="trunk"
5.285 +CT_LIBC="eglibc"
5.286 +CT_LIBC_SUPPORT_NPTL=y
5.287 +CT_LIBC_SUPPORT_LINUXTHREADS=y
5.288 +CT_LIBC_EXTRA_CC_ARGS=""
5.289 +# CT_LIBC_ADDONS is not set
5.290 +CT_EGLIBC_V_TRUNK=y
5.291 +# CT_EGLIBC_V_2_5 is not set
5.292 +# CT_EGLIBC_V_2_6 is not set
5.293 +# CT_EGLIBC_V_2_7 is not set
5.294 +# CT_EGLIBC_V_2_8 is not set
5.295 +CT_EGLIBC_REVISION="HEAD"
5.296 +CT_EGLIBC_CHECKOUT=y
5.297 +CT_LIBC_EGLIBC_EXTRA_CONFIG=""
5.298 +CT_LIBC_EGLIBC_EXTRA_CFLAGS=""
5.299 +CT_LIBC_EGLIBC_USE_PORTS=y
5.300 +
5.301 +#
5.302 +# Tools facilities
5.303 +#
5.304 +# CT_SSTRIP is not set
5.305 +
5.306 +#
5.307 +# Debug facilities
5.308 +#
5.309 +# CT_DMALLOC is not set
5.310 +# CT_DUMA is not set
5.311 +# CT_GDB is not set
5.312 +# CT_STRACE is not set