[llvm-commits] [llvm-gcc-4.2] r58580 - /llvm-gcc-4.2/trunk/gcc/config/arm/arm.h

Bill Wendling isanbard at gmail.com
Sun Nov 2 17:44:11 PST 2008


Author: void
Date: Sun Nov  2 19:44:11 2008
New Revision: 58580

URL: http://llvm.org/viewvc/llvm-project?rev=58580&view=rev
Log:
Define TARGET_COMPACT_SWITCH_TABLES

Modified:
    llvm-gcc-4.2/trunk/gcc/config/arm/arm.h

Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.h?rev=58580&r1=58579&r2=58580&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Sun Nov  2 19:44:11 2008
@@ -205,6 +205,12 @@
 #define TARGET_HARD_TP			(target_thread_pointer == TP_CP15)
 #define TARGET_SOFT_TP			(target_thread_pointer == TP_SOFT)
 
+/* APPLE LOCAL begin ARM compact switch tables */
+/* Use compact switch tables with libgcc handlers.  */
+#define TARGET_COMPACT_SWITCH_TABLES \
+  (TARGET_THUMB && !TARGET_LONG_CALLS)
+/* APPLE LOCAL end ARM compact switch tables */
+
 /* True iff the full BPABI is being used.  If TARGET_BPABI is true,
    then TARGET_AAPCS_BASED must be true -- but the converse does not
    hold.  TARGET_BPABI implies the use of the BPABI runtime library,
@@ -2094,6 +2100,7 @@
 
 #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY)	\
 (TARGET_ARM ? SImode						\
+ : !TARGET_COMPACT_SWITCH_TABLES ? SImode			\
  : (MIN_OFFSET) >= -256 && (MAX_OFFSET) <= 254			\
  ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode)	\
  : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 510			\
@@ -2134,7 +2141,7 @@
      in final_scan_insn. */						\
   targetm.asm_out.internal_label (file, "L", base_label_no);		\
   /* Default is not included in output count */				\
-  if (TARGET_THUMB)							\
+  if (TARGET_COMPACT_SWITCH_TABLES)					\
     asm_fprintf (file, "\t%s\t%d @ size\n", directive, vlen - 1);	\
   for (idx = 0; idx < vlen; idx++)					\
     {									\
@@ -2153,13 +2160,16 @@
       else if (!TARGET_THUMB)						\
 	asm_fprintf (file, "\tb\tL%d\n",				\
 			CODE_LABEL_NUMBER (target_label));		\
-      else								\
+      else if (TARGET_COMPACT_SWITCH_TABLES || flag_pic)		\
 	/* Let the assembler do the computation here; one case that	\
 	   uses is this is when there are asm's, which makes		\
 	   compile time computations unreliable. */			\
 	asm_fprintf (file, "\t%s\tL%d-L%d\n",				\
 	  directive,							\
 	  CODE_LABEL_NUMBER (target_label), base_label_no);		\
+      else								\
+	asm_fprintf (file, "\t%s\tL%d\n", directive,			\
+		     CODE_LABEL_NUMBER (target_label));			\
     }									\
   /* Pad to instruction boundary. */					\
   vlen = (vlen + 1/*count*/) * size;					\





More information about the llvm-commits mailing list