[Bug target/43350] New: sparcv9 mode does not seem to produce LDX/STX insns
jengelh at medozas dot de
gcc-bugzilla@gcc.gnu.org
Fri Mar 12 20:23:00 GMT 2010
Glibc is perhaps the only file on a typical Linux sparcv9 system (read: ELF32)
that makes use of 64-bit instructions like LDX/STX, and probably does so by
using assembler.
How come gcc is not emitting the *X family of instructions when dealing with,
for example, operating on uint64_t? The appended piece of sample code will make
use of LDX, but only when compiled in ELF64 mode (-m64). With -m32 -mcpu=v9, it
still uses the V8 doubleword mechanism and the LDD instruction. The SPARCV9
manual reads:
"LDD is provided for compatibility with SPARC-V8. It may execute slowly on
SPARC-V9 machines because of data path and register-access difficulties. In
some systems it may trap to emulation code. It is suggested that programmers
and compilers avoid using these instructions."
$ gcc -v
Using built-in specs.
Target: sparc64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java --enable-checking=release
--with-gxx-include-dir=/usr/include/c++/4.4 --enable-ssp --disable-libssp
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.4
--enable-linux-futex --without-system-libunwind --with-cpu=v8
--with-long-double-128 --build=sparc64-suse-linux
Thread model: posix
gcc version 4.4.1 [gcc-4_4-branch revision 150839] (SUSE Linux)
$ gcc-4.5 -v
Using built-in specs.
COLLECT_GCC=gcc-4.5
COLLECT_LTO_WRAPPER=/usr/lib/gcc/sparc64-suse-linux/4.5/lto-wrapper
Target: sparc64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,obj-c++,java --enable-checking=release
--with-gxx-include-dir=/usr/include/c++/4.5 --enable-ssp --disable-libssp
--disable-plugin --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap
--with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.5
--enable-linux-futex --without-system-libunwind --enable-gold
--with-plugin-ld=/usr/bin/gold --with-cpu=v8 --with-long-double-128
--build=sparc64-suse-linux
Thread model: posix
gcc version 4.5.0 20100209 (experimental) [trunk revision 156621] (SUSE Linux)
#include <stdlib.h>
#include <stdint.h>
extern long long y;
long long y = 0x123;
uint32_t foo(long long i)
{
long long x = y+i;
return x<<2;
}
--
Summary: sparcv9 mode does not seem to produce LDX/STX insns
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jengelh at medozas dot de
GCC build triplet: sparc64-suse-linux-gnu
GCC host triplet: sparc64-suse-linux-gnu
GCC target triplet: sparc64-suse-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43350
More information about the Gcc-bugs
mailing list