svn commit: r194754 - in vendor/llvm/dist: . autoconf cmake/modules
include/llvm include/llvm/Config include/llvm/MC
include/llvm/Support include/llvm/System include/llvm/Target
lib/ExecutionEngine...
Ed Schouten
ed at FreeBSD.org
Tue Jun 23 19:32:00 UTC 2009
Author: ed
Date: Tue Jun 23 19:31:59 2009
New Revision: 194754
URL: http://svn.freebsd.org/changeset/base/194754
Log:
Import LLVM r73984.
It seems I keep importing sources at very unlucky moments. Let's see
what this revision of LLVM does.
Added:
vendor/llvm/dist/include/llvm/MC/MCImm.h
vendor/llvm/dist/test/FrontendC/2009-02-13-zerosize-union-field-ppc.c
vendor/llvm/dist/tools/llvm-mc/MC-X86Specific.cpp
Deleted:
vendor/llvm/dist/cmake/modules/AddPartiallyLinkedObject.cmake
Modified:
vendor/llvm/dist/CMakeLists.txt
vendor/llvm/dist/CREDITS.TXT
vendor/llvm/dist/autoconf/configure.ac
vendor/llvm/dist/cmake/modules/AddLLVM.cmake
vendor/llvm/dist/cmake/modules/LLVMConfig.cmake
vendor/llvm/dist/configure
vendor/llvm/dist/include/llvm/Config/config.h.cmake
vendor/llvm/dist/include/llvm/MC/MCInst.h
vendor/llvm/dist/include/llvm/Support/Timer.h
vendor/llvm/dist/include/llvm/System/Atomic.h
vendor/llvm/dist/include/llvm/Target/TargetSelect.h
vendor/llvm/dist/include/llvm/Type.h
vendor/llvm/dist/lib/ExecutionEngine/CMakeLists.txt
vendor/llvm/dist/lib/ExecutionEngine/Interpreter/CMakeLists.txt
vendor/llvm/dist/lib/ExecutionEngine/JIT/CMakeLists.txt
vendor/llvm/dist/lib/Support/Timer.cpp
vendor/llvm/dist/lib/System/Atomic.cpp
vendor/llvm/dist/lib/Target/ARM/ARMAddressingModes.h
vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp
vendor/llvm/dist/lib/Target/ARM/ARMInstrFormats.td
vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td
vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td
vendor/llvm/dist/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
vendor/llvm/dist/lib/Target/ARM/AsmPrinter/CMakeLists.txt
vendor/llvm/dist/lib/Target/Alpha/AsmPrinter/CMakeLists.txt
vendor/llvm/dist/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt
vendor/llvm/dist/lib/Target/IA64/AsmPrinter/CMakeLists.txt
vendor/llvm/dist/lib/Target/Mips/AsmPrinter/CMakeLists.txt
vendor/llvm/dist/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt
vendor/llvm/dist/lib/Target/Sparc/AsmPrinter/CMakeLists.txt
vendor/llvm/dist/lib/Target/X86/AsmPrinter/CMakeLists.txt
vendor/llvm/dist/lib/VMCore/Mangler.cpp
vendor/llvm/dist/test/FrontendC/2007-05-07-PaddingElements.c
vendor/llvm/dist/test/FrontendC/2008-03-24-BitField-And-Alloca.c
vendor/llvm/dist/test/FrontendC/2009-02-13-zerosize-union-field.c
vendor/llvm/dist/tools/CMakeLists.txt
vendor/llvm/dist/tools/llvm-mc/AsmParser.cpp
vendor/llvm/dist/tools/llvm-mc/AsmParser.h
vendor/llvm/dist/tools/llvm-mc/CMakeLists.txt
Modified: vendor/llvm/dist/CMakeLists.txt
==============================================================================
--- vendor/llvm/dist/CMakeLists.txt Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/CMakeLists.txt Tue Jun 23 19:31:59 2009 (r194754)
@@ -100,24 +100,6 @@ configure_file(
set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm)
-# The USE_EXPLICIT_DEPENDENCIES variable will be TRUE to indicate that
-# we should use the library dependencies explicitly specified in the
-# CMakeLists.txt files rather than those determined by
-# llvm-config. This value must be true for non-make and IDE
-# generators.
-if (MSVC_IDE)
- set(DEFAULT_USE_EXPLICIT_DEPENDENCIES ON)
-elseif (XCODE)
- set(DEFAULT_USE_EXPLICIT_DEPENDENCIES ON)
-else ()
- set(DEFAULT_USE_EXPLICIT_DEPENDENCIES OFF)
-endif ()
-
-option(USE_EXPLICIT_DEPENDENCIES
- "Use explicit dependencies instead of llvm-config"
- ${DEFAULT_USE_EXPLICIT_DEPENDENCIES})
-mark_as_advanced(USE_EXPLICIT_DEPENDENCIES)
-
# Add path for custom modules
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
@@ -180,9 +162,6 @@ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LL
add_llvm_definitions( -D__STDC_LIMIT_MACROS )
add_llvm_definitions( -D__STDC_CONSTANT_MACROS )
-set(LLVM_PLO_FLAGS "" CACHE
- STRING "Flags for creating partially linked objects.")
-
if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
# TODO: support other platforms and toolchains.
option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF)
@@ -221,7 +200,6 @@ endif( MSVC )
include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR})
include(AddLLVM)
-include(AddPartiallyLinkedObject)
include(TableGen)
add_subdirectory(lib/Support)
Modified: vendor/llvm/dist/CREDITS.TXT
==============================================================================
--- vendor/llvm/dist/CREDITS.TXT Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/CREDITS.TXT Tue Jun 23 19:31:59 2009 (r194754)
@@ -302,3 +302,7 @@ D: Thread Local Storage implementation
N: Bill Wendling
E: isanbard at gmail.com
D: Bunches of stuff
+
+N: Bob Wilson
+E: bob.wilson at acm.org
+D: Advanced SIMD (NEON) support in the ARM backend
Modified: vendor/llvm/dist/autoconf/configure.ac
==============================================================================
--- vendor/llvm/dist/autoconf/configure.ac Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/autoconf/configure.ac Tue Jun 23 19:31:59 2009 (r194754)
@@ -447,7 +447,8 @@ AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BU
# If so, define LLVM_NATIVE_ARCH to that LLVM target.
for a_target in $TARGETS_TO_BUILD; do
if test "$a_target" = "$LLVM_NATIVE_ARCH"; then
- AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCH,
+ LLVM_NATIVE_ARCHTARGET="${LLVM_NATIVE_ARCH}Target"
+ AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCHTARGET,
[LLVM architecture name for the native architecture, if available])
fi
done
Modified: vendor/llvm/dist/cmake/modules/AddLLVM.cmake
==============================================================================
--- vendor/llvm/dist/cmake/modules/AddLLVM.cmake Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/cmake/modules/AddLLVM.cmake Tue Jun 23 19:31:59 2009 (r194754)
@@ -26,11 +26,7 @@ macro(add_llvm_executable name)
if( LLVM_LINK_COMPONENTS )
llvm_config(${name} ${LLVM_LINK_COMPONENTS})
endif( LLVM_LINK_COMPONENTS )
- if( USE_EXPLICIT_DEPENDENCIES )
- target_link_libraries(${name} ${llvm_libs})
- else( )
- add_dependencies(${name} llvm-config.target)
- endif( )
+ target_link_libraries(${name} ${llvm_libs})
get_system_libs(llvm_system_libs)
if( llvm_system_libs )
target_link_libraries(${name} ${llvm_system_libs})
@@ -61,8 +57,5 @@ macro(add_llvm_target target_name)
add_dependencies(${target_name}Table_gen ${LLVM_COMMON_DEPENDS})
endif( TABLEGEN_OUTPUT )
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
- add_partially_linked_object(LLVM${target_name} ${ARGN})
- if( TABLEGEN_OUTPUT )
- add_dependencies(LLVM${target_name} ${target_name}Table_gen)
- endif( TABLEGEN_OUTPUT )
+ add_llvm_library(LLVM${target_name} ${ARGN} ${TABLEGEN_OUTPUT})
endmacro(add_llvm_target)
Modified: vendor/llvm/dist/cmake/modules/LLVMConfig.cmake
==============================================================================
--- vendor/llvm/dist/cmake/modules/LLVMConfig.cmake Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/cmake/modules/LLVMConfig.cmake Tue Jun 23 19:31:59 2009 (r194754)
@@ -20,12 +20,7 @@ endfunction(get_system_libs)
macro(llvm_config executable)
- # extra args is the list of link components.
- if( USE_EXPLICIT_DEPENDENCIES )
- explicit_llvm_config(${executable} ${ARGN})
- else( )
- nix_llvm_config(${executable} ${ARGN})
- endif( )
+ explicit_llvm_config(${executable} ${ARGN})
endmacro(llvm_config)
@@ -127,44 +122,7 @@ function(explicit_map_components_to_libr
set(${out_libs} ${result} PARENT_SCOPE)
endfunction(explicit_map_components_to_libraries)
-
-macro(nix_llvm_config executable)
- set(lc "")
- foreach(c ${ARGN})
- set(lc "${lc} ${c}")
- endforeach(c)
- if( NOT HAVE_LLVM_CONFIG )
- target_link_libraries(${executable}
- "`${LLVM_TOOLS_BINARY_DIR}/llvm-config --libs ${lc}`")
- else( NOT HAVE_LLVM_CONFIG )
- # tbi: Error handling.
- if( NOT PERL_EXECUTABLE )
- message(FATAL_ERROR "Perl required but not found!")
- endif( NOT PERL_EXECUTABLE )
- execute_process(
- COMMAND sh -c "${PERL_EXECUTABLE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/llvm-config --libs ${lc}"
- RESULT_VARIABLE rv
- OUTPUT_VARIABLE libs
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR "llvm-config failed for executable ${executable}")
- endif(NOT rv EQUAL 0)
- string(REPLACE " " ";" libs ${libs})
- foreach(c ${libs})
- if(c MATCHES ".*\\.o")
- get_filename_component(fn ${c} NAME)
- target_link_libraries(${executable}
- ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${fn})
- else(c MATCHES ".*\\.o")
- string(REPLACE "-l" "" fn ${c})
- target_link_libraries(${executable} ${fn})
- endif(c MATCHES ".*\\.o")
- endforeach(c)
- endif( NOT HAVE_LLVM_CONFIG )
-endmacro(nix_llvm_config)
-
-
-# This data is used on MSVC for stablishing executable/library
+# This data is used to establish executable/library
# dependencies. Comes from the llvm-config script, which is built and
# installed on the bin directory for MinGW or Linux. At the end of the
# script, you'll see lines like this:
Modified: vendor/llvm/dist/configure
==============================================================================
--- vendor/llvm/dist/configure Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/configure Tue Jun 23 19:31:59 2009 (r194754)
@@ -4972,9 +4972,10 @@ TARGETS_TO_BUILD=$TARGETS_TO_BUILD
# If so, define LLVM_NATIVE_ARCH to that LLVM target.
for a_target in $TARGETS_TO_BUILD; do
if test "$a_target" = "$LLVM_NATIVE_ARCH"; then
+ LLVM_NATIVE_ARCHTARGET="${LLVM_NATIVE_ARCH}Target"
cat >>confdefs.h <<_ACEOF
-#define LLVM_NATIVE_ARCH $LLVM_NATIVE_ARCH
+#define LLVM_NATIVE_ARCH $LLVM_NATIVE_ARCHTARGET
_ACEOF
fi
@@ -10628,7 +10629,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10631 "configure"
+#line 10632 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12772,7 +12773,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 12775 "configure"' > conftest.$ac_ext
+ echo '#line 12776 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -14490,11 +14491,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14493: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14494: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14497: \$? = $ac_status" >&5
+ echo "$as_me:14498: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14758,11 +14759,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14761: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14762: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14765: \$? = $ac_status" >&5
+ echo "$as_me:14766: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14862,11 +14863,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14865: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14866: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14869: \$? = $ac_status" >&5
+ echo "$as_me:14870: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17314,7 +17315,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 17317 "configure"
+#line 17318 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17414,7 +17415,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 17417 "configure"
+#line 17418 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19782,11 +19783,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19785: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19786: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:19789: \$? = $ac_status" >&5
+ echo "$as_me:19790: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -19886,11 +19887,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:19889: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:19890: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:19893: \$? = $ac_status" >&5
+ echo "$as_me:19894: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -21456,11 +21457,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21459: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21460: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:21463: \$? = $ac_status" >&5
+ echo "$as_me:21464: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -21560,11 +21561,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:21563: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:21564: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:21567: \$? = $ac_status" >&5
+ echo "$as_me:21568: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -23795,11 +23796,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:23798: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:23799: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:23802: \$? = $ac_status" >&5
+ echo "$as_me:23803: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -24063,11 +24064,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:24066: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:24067: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:24070: \$? = $ac_status" >&5
+ echo "$as_me:24071: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -24167,11 +24168,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:24170: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:24171: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:24174: \$? = $ac_status" >&5
+ echo "$as_me:24175: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
Modified: vendor/llvm/dist/include/llvm/Config/config.h.cmake
==============================================================================
--- vendor/llvm/dist/include/llvm/Config/config.h.cmake Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/include/llvm/Config/config.h.cmake Tue Jun 23 19:31:59 2009 (r194754)
@@ -582,4 +582,4 @@
#cmakedefine strdup ${strdup}
/* Native LLVM architecture */
-#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}
+#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}Target
Added: vendor/llvm/dist/include/llvm/MC/MCImm.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/llvm/dist/include/llvm/MC/MCImm.h Tue Jun 23 19:31:59 2009 (r194754)
@@ -0,0 +1,55 @@
+//===-- llvm/MC/MCImm.h - MCImm class ---------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the declaration of the MCInst and MCOperand classes, which
+// is the basic representation used to represent low-level machine code
+// instructions.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_MC_MCIMM_H
+#define LLVM_MC_MCIMM_H
+
+namespace llvm {
+class MCSymbol;
+
+/// MCImm - This represents an "assembler immediate". In its most general form,
+/// this can hold "SymbolA - SymbolB + imm64". Not all targets supports
+/// relocations of this general form, but we need to represent this anyway.
+class MCImm {
+ MCSymbol *SymA, *SymB;
+ int64_t Cst;
+public:
+
+ int64_t getCst() const { return Cst; }
+ MCSymbol *getSymA() const { return SymA; }
+ MCSymbol *getSymB() const { return SymB; }
+
+
+ static MCImm get(MCSymbol *SymA, MCSymbol *SymB = 0, int64_t Val = 0) {
+ MCImm R;
+ R.Cst = Val;
+ R.SymA = SymA;
+ R.SymB = SymB;
+ return R;
+ }
+
+ static MCImm get(int64_t Val) {
+ MCImm R;
+ R.Cst = Val;
+ R.SymA = 0;
+ R.SymB = 0;
+ return R;
+ }
+
+};
+
+} // end namespace llvm
+
+#endif
Modified: vendor/llvm/dist/include/llvm/MC/MCInst.h
==============================================================================
--- vendor/llvm/dist/include/llvm/MC/MCInst.h Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/include/llvm/MC/MCInst.h Tue Jun 23 19:31:59 2009 (r194754)
@@ -13,10 +13,10 @@
//
//===----------------------------------------------------------------------===//
-
#ifndef LLVM_MC_MCINST_H
#define LLVM_MC_MCINST_H
+#include "llvm/MC/MCImm.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/DebugLoc.h"
@@ -30,13 +30,15 @@ class MCOperand {
kInvalid, ///< Uninitialized.
kRegister, ///< Register operand.
kImmediate, ///< Immediate operand.
- kMBBLabel ///< Basic block label.
+ kMBBLabel, ///< Basic block label.
+ kMCImm
};
unsigned char Kind;
union {
unsigned RegVal;
int64_t ImmVal;
+ MCImm MCImmVal;
struct {
unsigned FunctionNo;
unsigned BlockNo;
@@ -112,6 +114,7 @@ public:
const MCOperand &getOperand(unsigned i) const { return Operands[i]; }
MCOperand &getOperand(unsigned i) { return Operands[i]; }
+ unsigned getNumOperands() const { return Operands.size(); }
void addOperand(const MCOperand &Op) {
Operands.push_back(Op);
Modified: vendor/llvm/dist/include/llvm/Support/Timer.h
==============================================================================
--- vendor/llvm/dist/include/llvm/Support/Timer.h Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/include/llvm/Support/Timer.h Tue Jun 23 19:31:59 2009 (r194754)
@@ -34,12 +34,12 @@ class TimerGroup;
/// if they are never started.
///
class Timer {
- double Elapsed; // Wall clock time elapsed in seconds
- double UserTime; // User time elapsed
- double SystemTime; // System time elapsed
- ssize_t MemUsed; // Memory allocated (in bytes)
- size_t PeakMem; // Peak memory used
- size_t PeakMemBase; // Temporary for peak calculation...
+ int64_t Elapsed; // Wall clock time elapsed in seconds
+ int64_t UserTime; // User time elapsed
+ int64_t SystemTime; // System time elapsed
+ int64_t MemUsed; // Memory allocated (in bytes)
+ int64_t PeakMem; // Peak memory used
+ int64_t PeakMemBase; // Temporary for peak calculation...
std::string Name; // The name of this time variable
bool Started; // Has this time variable ever been started?
TimerGroup *TG; // The TimerGroup this Timer is in.
@@ -49,10 +49,10 @@ public:
Timer(const Timer &T);
~Timer();
- double getProcessTime() const { return UserTime+SystemTime; }
- double getWallTime() const { return Elapsed; }
- ssize_t getMemUsed() const { return MemUsed; }
- size_t getPeakMem() const { return PeakMem; }
+ int64_t getProcessTime() const { return UserTime+SystemTime; }
+ int64_t getWallTime() const { return Elapsed; }
+ int64_t getMemUsed() const { return MemUsed; }
+ int64_t getPeakMem() const { return PeakMem; }
std::string getName() const { return Name; }
const Timer &operator=(const Timer &T) {
@@ -152,7 +152,6 @@ class TimerGroup {
unsigned NumTimers;
std::vector<Timer> TimersToPrint;
public:
- TimerGroup() : Name("Miscellaneous Ungrouped Timers"), NumTimers(0) {}
explicit TimerGroup(const std::string &name) : Name(name), NumTimers(0) {}
~TimerGroup() {
assert(NumTimers == 0 &&
Modified: vendor/llvm/dist/include/llvm/System/Atomic.h
==============================================================================
--- vendor/llvm/dist/include/llvm/System/Atomic.h Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/include/llvm/System/Atomic.h Tue Jun 23 19:31:59 2009 (r194754)
@@ -20,12 +20,14 @@ namespace llvm {
namespace sys {
void MemoryFence();
- typedef uint32_t cas_flag;
- cas_flag CompareAndSwap(volatile cas_flag* ptr,
- cas_flag new_value,
- cas_flag old_value);
- cas_flag AtomicIncrement(volatile cas_flag* ptr);
- cas_flag AtomicDecrement(volatile cas_flag* ptr);
+ uint32_t CompareAndSwap32(volatile uint32_t* ptr,
+ uint32_t new_value,
+ uint32_t old_value);
+ int32_t AtomicIncrement32(volatile int32_t* ptr);
+ int32_t AtomicDecrement32(volatile int32_t* ptr);
+ int32_t AtomicAdd32(volatile int32_t* ptr, int32_t val);
+
+ int64_t AtomicAdd64(volatile int64_t* ptr, int64_t val);
}
}
Modified: vendor/llvm/dist/include/llvm/Target/TargetSelect.h
==============================================================================
--- vendor/llvm/dist/include/llvm/Target/TargetSelect.h Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/include/llvm/Target/TargetSelect.h Tue Jun 23 19:31:59 2009 (r194754)
@@ -50,9 +50,9 @@ namespace llvm {
inline bool InitializeNativeTarget() {
// If we have a native target, initialize it to ensure it is linked in.
#ifdef LLVM_NATIVE_ARCH
-#define DoInit2(TARG, MOD) llvm::Initialize ## TARG ## MOD()
-#define DoInit(T, M) DoInit2(T, M)
- DoInit(LLVM_NATIVE_ARCH, Target);
+#define DoInit2(TARG) llvm::Initialize ## TARG ()
+#define DoInit(T) DoInit2(T)
+ DoInit(LLVM_NATIVE_ARCH);
return false;
#undef DoInit
#undef DoInit2
Modified: vendor/llvm/dist/include/llvm/Type.h
==============================================================================
--- vendor/llvm/dist/include/llvm/Type.h Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/include/llvm/Type.h Tue Jun 23 19:31:59 2009 (r194754)
@@ -103,7 +103,7 @@ private:
/// has no AbstractTypeUsers, the type is deleted. This is only sensical for
/// derived types.
///
- mutable sys::cas_flag RefCount;
+ mutable int32_t RefCount;
const Type *getForwardedTypeInternal() const;
@@ -338,7 +338,7 @@ public:
void addRef() const {
assert(isAbstract() && "Cannot add a reference to a non-abstract type!");
- sys::AtomicIncrement(&RefCount);
+ sys::AtomicIncrement32(&RefCount);
}
void dropRef() const {
@@ -347,8 +347,8 @@ public:
// If this is the last PATypeHolder using this object, and there are no
// PATypeHandles using it, the type is dead, delete it now.
- sys::cas_flag OldCount = sys::AtomicDecrement(&RefCount);
- if (OldCount == 0 && AbstractTypeUsers.empty())
+ int32_t Count = sys::AtomicDecrement32(&RefCount);
+ if (Count == 0 && AbstractTypeUsers.empty())
this->destroy();
}
Modified: vendor/llvm/dist/lib/ExecutionEngine/CMakeLists.txt
==============================================================================
--- vendor/llvm/dist/lib/ExecutionEngine/CMakeLists.txt Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/lib/ExecutionEngine/CMakeLists.txt Tue Jun 23 19:31:59 2009 (r194754)
@@ -1,4 +1,4 @@
-add_partially_linked_object(LLVMExecutionEngine
+add_llvm_library(LLVMExecutionEngine
ExecutionEngine.cpp
ExecutionEngineBindings.cpp
)
Modified: vendor/llvm/dist/lib/ExecutionEngine/Interpreter/CMakeLists.txt
==============================================================================
--- vendor/llvm/dist/lib/ExecutionEngine/Interpreter/CMakeLists.txt Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/lib/ExecutionEngine/Interpreter/CMakeLists.txt Tue Jun 23 19:31:59 2009 (r194754)
@@ -1,4 +1,4 @@
-add_partially_linked_object(LLVMInterpreter
+add_llvm_library(LLVMInterpreter
Execution.cpp
ExternalFunctions.cpp
Interpreter.cpp
Modified: vendor/llvm/dist/lib/ExecutionEngine/JIT/CMakeLists.txt
==============================================================================
--- vendor/llvm/dist/lib/ExecutionEngine/JIT/CMakeLists.txt Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/lib/ExecutionEngine/JIT/CMakeLists.txt Tue Jun 23 19:31:59 2009 (r194754)
@@ -1,7 +1,7 @@
# TODO: Support other architectures. See Makefile.
add_definitions(-DENABLE_X86_JIT)
-add_partially_linked_object(LLVMJIT
+add_llvm_library(LLVMJIT
Intercept.cpp
JIT.cpp
JITDwarfEmitter.cpp
Modified: vendor/llvm/dist/lib/Support/Timer.cpp
==============================================================================
--- vendor/llvm/dist/lib/Support/Timer.cpp Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/lib/Support/Timer.cpp Tue Jun 23 19:31:59 2009 (r194754)
@@ -15,7 +15,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Streams.h"
-#include "llvm/System/Mutex.h"
#include "llvm/System/Process.h"
#include <algorithm>
#include <fstream>
@@ -51,28 +50,37 @@ namespace {
cl::Hidden, cl::location(getLibSupportInfoOutputFilename()));
}
-static ManagedStatic<sys::SmartMutex<true> > TimerLock;
-static ManagedStatic<TimerGroup> DefaultTimerGroup;
+static TimerGroup *DefaultTimerGroup = 0;
static TimerGroup *getDefaultTimerGroup() {
- return &*DefaultTimerGroup;
+ TimerGroup* tmp = DefaultTimerGroup;
+ sys::MemoryFence();
+ if (!tmp) {
+ llvm_acquire_global_lock();
+ tmp = DefaultTimerGroup;
+ if (!tmp) {
+ tmp = new TimerGroup("Miscellaneous Ungrouped Timers");
+ sys::MemoryFence();
+ DefaultTimerGroup = tmp;
+ }
+ llvm_release_global_lock();
+ }
+
+ return tmp;
}
Timer::Timer(const std::string &N)
: Elapsed(0), UserTime(0), SystemTime(0), MemUsed(0), PeakMem(0), Name(N),
Started(false), TG(getDefaultTimerGroup()) {
- sys::SmartScopedLock<true> Lock(&*TimerLock);
TG->addTimer();
}
Timer::Timer(const std::string &N, TimerGroup &tg)
: Elapsed(0), UserTime(0), SystemTime(0), MemUsed(0), PeakMem(0), Name(N),
Started(false), TG(&tg) {
- sys::SmartScopedLock<true> Lock(&*TimerLock);
TG->addTimer();
}
Timer::Timer(const Timer &T) {
- sys::SmartScopedLock<true> Lock(&*TimerLock);
TG = T.TG;
if (TG) TG->addTimer();
operator=(T);
@@ -81,7 +89,6 @@ Timer::Timer(const Timer &T) {
// Copy ctor, initialize with no TG member.
Timer::Timer(bool, const Timer &T) {
- sys::SmartScopedLock<true> Lock(&*TimerLock);
TG = T.TG; // Avoid assertion in operator=
operator=(T); // Copy contents
TG = 0;
@@ -89,7 +96,6 @@ Timer::Timer(bool, const Timer &T) {
Timer::~Timer() {
- sys::SmartScopedLock<true> Lock(&*TimerLock);
if (TG) {
if (Started) {
Started = false;
@@ -106,8 +112,7 @@ static inline size_t getMemUsage() {
}
struct TimeRecord {
- double Elapsed, UserTime, SystemTime;
- ssize_t MemUsed;
+ int64_t Elapsed, UserTime, SystemTime, MemUsed;
};
static TimeRecord getTimeRecord(bool Start) {
@@ -117,7 +122,7 @@ static TimeRecord getTimeRecord(bool Sta
sys::TimeValue user(0,0);
sys::TimeValue sys(0,0);
- ssize_t MemUsed = 0;
+ int64_t MemUsed = 0;
if (Start) {
MemUsed = getMemUsage();
sys::Process::GetTimeUsage(now,user,sys);
@@ -126,19 +131,17 @@ static TimeRecord getTimeRecord(bool Sta
MemUsed = getMemUsage();
}
- Result.Elapsed = now.seconds() + now.microseconds() / 1000000.0;
- Result.UserTime = user.seconds() + user.microseconds() / 1000000.0;
- Result.SystemTime = sys.seconds() + sys.microseconds() / 1000000.0;
+ Result.Elapsed = now.seconds() * 1000000 + now.microseconds();
+ Result.UserTime = user.seconds() * 1000000 + user.microseconds();
+ Result.SystemTime = sys.seconds() * 1000000 + sys.microseconds();
Result.MemUsed = MemUsed;
return Result;
}
static ManagedStatic<std::vector<Timer*> > ActiveTimers;
-static ManagedStatic<sys::SmartMutex<true> > ActiveTimerLock;
void Timer::startTimer() {
- sys::SmartScopedLock<true> Lock(&*ActiveTimerLock);
Started = true;
ActiveTimers->push_back(this);
TimeRecord TR = getTimeRecord(true);
@@ -150,7 +153,6 @@ void Timer::startTimer() {
}
void Timer::stopTimer() {
- sys::SmartScopedLock<true> Lock(&*ActiveTimerLock);
TimeRecord TR = getTimeRecord(false);
Elapsed += TR.Elapsed;
UserTime += TR.UserTime;
@@ -180,7 +182,6 @@ void Timer::sum(const Timer &T) {
/// currently active timers, which will be printed when the timer group prints
///
void Timer::addPeakMemoryMeasurement() {
- sys::SmartScopedLock<true> Lock(&*ActiveTimerLock);
size_t MemUsed = getMemUsage();
for (std::vector<Timer*>::iterator I = ActiveTimers->begin(),
@@ -203,10 +204,7 @@ static ManagedStatic<Name2Timer> NamedTi
static ManagedStatic<Name2Pair> NamedGroupedTimers;
-static ManagedStatic<sys::SmartMutex<true> > NamedTimerLock;
-
static Timer &getNamedRegionTimer(const std::string &Name) {
- sys::SmartScopedLock<true> Lock(&*NamedTimerLock);
Name2Timer::iterator I = NamedTimers->find(Name);
if (I != NamedTimers->end())
return I->second;
@@ -216,7 +214,6 @@ static Timer &getNamedRegionTimer(const
static Timer &getNamedRegionTimer(const std::string &Name,
const std::string &GroupName) {
- sys::SmartScopedLock<true> Lock(&*NamedTimerLock);
Name2Pair::iterator I = NamedGroupedTimers->find(GroupName);
if (I == NamedGroupedTimers->end()) {
@@ -279,12 +276,13 @@ static void printVal(double Val, double
void Timer::print(const Timer &Total, std::ostream &OS) {
if (Total.UserTime)
- printVal(UserTime, Total.UserTime, OS);
+ printVal(UserTime / 1000000.0, Total.UserTime / 1000000.0, OS);
if (Total.SystemTime)
- printVal(SystemTime, Total.SystemTime, OS);
+ printVal(SystemTime / 1000000.0, Total.SystemTime / 1000000.0, OS);
if (Total.getProcessTime())
- printVal(getProcessTime(), Total.getProcessTime(), OS);
- printVal(Elapsed, Total.Elapsed, OS);
+ printVal(getProcessTime() / 1000000.0,
+ Total.getProcessTime() / 1000000.0, OS);
+ printVal(Elapsed / 1000000.0, Total.Elapsed / 1000000.0, OS);
OS << " ";
@@ -354,26 +352,26 @@ void TimerGroup::removeTimer() {
// If this is not an collection of ungrouped times, print the total time.
// Ungrouped timers don't really make sense to add up. We still print the
// TOTAL line to make the percentages make sense.
- if (this != &*DefaultTimerGroup) {
+ if (this != DefaultTimerGroup) {
*OutStream << " Total Execution Time: ";
- printAlignedFP(Total.getProcessTime(), 4, 5, *OutStream);
+ printAlignedFP(Total.getProcessTime() / 1000000.0, 4, 5, *OutStream);
*OutStream << " seconds (";
- printAlignedFP(Total.getWallTime(), 4, 5, *OutStream);
+ printAlignedFP(Total.getWallTime() / 1000000.0, 4, 5, *OutStream);
*OutStream << " wall clock)\n";
}
*OutStream << "\n";
- if (Total.UserTime)
+ if (Total.UserTime / 1000000.0)
*OutStream << " ---User Time---";
- if (Total.SystemTime)
+ if (Total.SystemTime / 1000000.0)
*OutStream << " --System Time--";
- if (Total.getProcessTime())
+ if (Total.getProcessTime() / 1000000.0)
*OutStream << " --User+System--";
*OutStream << " ---Wall Time---";
- if (Total.getMemUsed())
+ if (Total.getMemUsed() / 1000000.0)
*OutStream << " ---Mem---";
- if (Total.getPeakMem())
+ if (Total.getPeakMem() / 1000000.0)
*OutStream << " -PeakMem-";
*OutStream << " --- Name ---\n";
Modified: vendor/llvm/dist/lib/System/Atomic.cpp
==============================================================================
--- vendor/llvm/dist/lib/System/Atomic.cpp Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/lib/System/Atomic.cpp Tue Jun 23 19:31:59 2009 (r194754)
@@ -35,11 +35,11 @@ void sys::MemoryFence() {
#endif
}
-sys::cas_flag sys::CompareAndSwap(volatile sys::cas_flag* ptr,
- sys::cas_flag new_value,
- sys::cas_flag old_value) {
+uint32_t sys::CompareAndSwap32(volatile uint32_t* ptr,
+ uint32_t new_value,
+ uint32_t old_value) {
#if LLVM_MULTITHREADED==0
- sys::cas_flag result = *ptr;
+ uint32_t result = *ptr;
if (result == old_value)
*ptr = new_value;
return result;
@@ -52,7 +52,7 @@ sys::cas_flag sys::CompareAndSwap(volati
#endif
}
-sys::cas_flag sys::AtomicIncrement(volatile sys::cas_flag* ptr) {
+int32_t sys::AtomicIncrement32(volatile int32_t* ptr) {
#if LLVM_MULTITHREADED==0
++(*ptr);
return *ptr;
@@ -65,7 +65,7 @@ sys::cas_flag sys::AtomicIncrement(volat
#endif
}
-sys::cas_flag sys::AtomicDecrement(volatile sys::cas_flag* ptr) {
+int32_t sys::AtomicDecrement32(volatile int32_t* ptr) {
#if LLVM_MULTITHREADED==0
--(*ptr);
return *ptr;
@@ -78,4 +78,29 @@ sys::cas_flag sys::AtomicDecrement(volat
#endif
}
+int32_t sys::AtomicAdd32(volatile int32_t* ptr, int32_t val) {
+#if LLVM_MULTITHREADED==0
+ *ptr += val;
+ return *ptr;
+#elif defined(__GNUC__)
+ return __sync_add_and_fetch(ptr, val);
+#elif defined(_MSC_VER)
+ return InterlockedAdd(ptr, val);
+#else
+# error No atomic add implementation for your platform!
+#endif
+}
+
+int64_t sys::AtomicAdd64(volatile int64_t* ptr, int64_t val) {
+#if LLVM_MULTITHREADED==0
+ *ptr += val;
+ return *ptr;
+#elif defined(__GNUC__)
+ return __sync_add_and_fetch(ptr, val);
+#elif defined(_MSC_VER)
+ return InterlockedAdd64(ptr, val);
+#else
+# error No atomic add implementation for your platform!
+#endif
+}
Modified: vendor/llvm/dist/lib/Target/ARM/ARMAddressingModes.h
==============================================================================
--- vendor/llvm/dist/lib/Target/ARM/ARMAddressingModes.h Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/lib/Target/ARM/ARMAddressingModes.h Tue Jun 23 19:31:59 2009 (r194754)
@@ -248,12 +248,122 @@ namespace ARM_AM {
return V == 0;
}
+ /// getThumbImm16ValShift - Try to handle Imm with a 16-bit immediate followed
+ /// by a left shift. Returns the shift amount to use.
+ static inline unsigned getThumbImm16ValShift(unsigned Imm) {
+ // 16-bit (or less) immediates are trivially immediate operand with a shift
+ // of zero.
+ if ((Imm & ~65535U) == 0) return 0;
+
+ // Use CTZ to compute the shift amount.
+ return CountTrailingZeros_32(Imm);
+ }
+
+ /// isThumbImm16ShiftedVal - Return true if the specified value can be
+ /// obtained by left shifting a 16-bit immediate.
+ static inline bool isThumbImm16ShiftedVal(unsigned V) {
+ // If this can be handled with
+ V = (~65535U << getThumbImm16ValShift(V)) & V;
+ return V == 0;
+ }
+
/// getThumbImmNonShiftedVal - If V is a value that satisfies
/// isThumbImmShiftedVal, return the non-shiftd value.
static inline unsigned getThumbImmNonShiftedVal(unsigned V) {
return V >> getThumbImmValShift(V);
}
+ /// getT2SOImmValDecode - Given a 12-bit encoded Thumb-2 modified immediate,
+ /// return the corresponding 32-bit immediate value.
+ /// See ARM Reference Manual A6.3.2.
+ static inline unsigned getT2SOImmValDecode(unsigned Imm) {
+ unsigned Base = Imm & 0xff;
+ switch ((Imm >> 8) & 0xf) {
+ case 0:
+ return Base;
+ case 1:
+ return Base | (Base << 16);
+ case 2:
+ return (Base << 8) | (Base << 24);
+ case 3:
+ return Base | (Base << 8) | (Base << 16) | (Base << 24);
+ default:
+ break;
+ }
+
+ // shifted immediate
+ unsigned RotAmount = ((Imm >> 7) & 0x1f) - 8;
+ return (Base | 0x80) << (24 - RotAmount);
+ }
+
+ /// getT2SOImmValSplat - Return the 12-bit encoded representation
+ /// if the specified value can be obtained by splatting the low 8 bits
+ /// into every other byte or every byte of a 32-bit value. i.e.,
+ /// 00000000 00000000 00000000 abcdefgh control = 0
+ /// 00000000 abcdefgh 00000000 abcdefgh control = 1
+ /// abcdefgh 00000000 abcdefgh 00000000 control = 2
+ /// abcdefgh abcdefgh abcdefgh abcdefgh control = 3
+ /// Return -1 if none of the above apply.
+ /// See ARM Reference Manual A6.3.2.
+ static inline int getT2SOImmValSplat (unsigned V) {
+ unsigned u, Vs, Imm;
+ // control = 0
+ if ((V & 0xffffff00) == 0)
+ return V;
+
+ // If the value is zeroes in the first byte, just shift those off
+ Vs = ((V & 0xff) == 0) ? V >> 8 : V;
+ // Any passing value only has 8 bits of payload, splatted across the word
+ Imm = Vs & 0xff;
+ // Likewise, any passing values have the payload splatted into the 3rd byte
+ u = Imm | (Imm << 16);
+
+ // control = 1 or 2
+ if (Vs == u)
+ return (((Vs == V) ? 1 : 2) << 8) | Imm;
+
+ // control = 3
+ if (Vs == (u | (u << 8)))
+ return (3 << 8) | Imm;
+
+ return -1;
+ }
+
+ /// getT2SOImmValRotate - Return the 12-bit encoded representation if the
+ /// specified value is a rotated 8-bit value. Return -1 if no rotation
+ /// encoding is possible.
+ /// See ARM Reference Manual A6.3.2.
+ static inline int getT2SOImmValRotate (unsigned V) {
+ unsigned RotAmt = CountLeadingZeros_32(V);
+ if (RotAmt >= 24)
+ return -1;
+
+ // If 'Arg' can be handled with a single shifter_op return the value.
+ if ((rotr32(0xff000000U, RotAmt) & V) == V)
+ return (rotr32(V, 24 - RotAmt) & 0x7f) | ((RotAmt + 8) << 7);
+
+ return -1;
+ }
+
+ /// getT2SOImmVal - Given a 32-bit immediate, if it is something that can fit
+ /// into a Thumb-2 shifter_operand immediate operand, return the 12-bit
+ /// encoding for it. If not, return -1.
+ /// See ARM Reference Manual A6.3.2.
+ static inline int getT2SOImmVal(unsigned Arg) {
+ // If 'Arg' is an 8-bit splat, then get the encoded value.
+ int Splat = getT2SOImmValSplat(Arg);
+ if (Splat != -1)
+ return Splat;
+
+ // If 'Arg' can be handled with a single shifter_op return the value.
+ int Rot = getT2SOImmValRotate(Arg);
+ if (Rot != -1)
+ return Rot;
+
+ return -1;
+ }
+
+
//===--------------------------------------------------------------------===//
// Addressing Mode #2
//===--------------------------------------------------------------------===//
Modified: vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp
==============================================================================
--- vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jun 23 19:29:23 2009 (r194753)
+++ vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jun 23 19:31:59 2009 (r194754)
@@ -92,8 +92,8 @@ public:
bool SelectThumbAddrModeSP(SDValue Op, SDValue N, SDValue &Base,
SDValue &OffImm);
- bool SelectShifterOperand(SDValue Op, SDValue N,
- SDValue &BaseReg, SDValue &Opc);
+ bool SelectThumb2ShifterOperandReg(SDValue Op, SDValue N,
+ SDValue &BaseReg, SDValue &Opc);
bool SelectShifterOperandReg(SDValue Op, SDValue N, SDValue &A,
SDValue &B, SDValue &C);
@@ -520,10 +520,10 @@ bool ARMDAGToDAGISel::SelectThumbAddrMod
return false;
}
-bool ARMDAGToDAGISel::SelectShifterOperand(SDValue Op,
- SDValue N,
- SDValue &BaseReg,
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-all
mailing list