configure.in (HAVE_AS_LTOFFX_LDXMOV_RELOCS): New ia64 test.
authorRichard Henderson <rth@redhat.com>
Sun, 2 Mar 2003 22:15:51 +0000 (14:15 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 2 Mar 2003 22:15:51 +0000 (14:15 -0800)
        * configure.in (HAVE_AS_LTOFFX_LDXMOV_RELOCS): New ia64 test.
        * config.in, configure: Rebuild.
        * config/ia64/ia64.c (ia64_ld_address_bypass_p): Accept lo_sum.
        * config/ia64/ia64.md (load_symptr): Use high/lo_sum for the
        paired ldtoffx and ldxmov annotations.
        (load_symptr_internal1): Remove.
        (load_symptr_high, load_symptr_low): New.

From-SVN: r63696

gcc/ChangeLog
gcc/config.in
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.md
gcc/configure
gcc/configure.in

index 60e8c3ece7a65d18b82029a3d0b79288389e167b..bdb2192f5b103fbc32dc97acb8e7bdc6f00eb407 100644 (file)
@@ -1,3 +1,13 @@
+2003-03-02  Richard Henderson  <rth@redhat.com>
+
+       * configure.in (HAVE_AS_LTOFFX_LDXMOV_RELOCS): New ia64 test.
+       * config.in, configure: Rebuild.
+       * config/ia64/ia64.c (ia64_ld_address_bypass_p): Accept lo_sum.
+       * config/ia64/ia64.md (load_symptr): Use high/lo_sum for the 
+       paired ldtoffx and ldxmov annotations.
+       (load_symptr_internal1): Remove.
+       (load_symptr_high, load_symptr_low): New.
+
 2003-03-02  Neil Booth  <neil@daikokuya.co.uk>
 
        * c-incpath.c (add_path): Fix sysp assignment.
index 90cf3adff0f0af29e9c887a9ea711b13283c1202..86f4e2ca3aa38e049f27f032b0bcd7659e1817ea 100644 (file)
@@ -1,4 +1,4 @@
-/* config.in.  Generated automatically from configure.in by autoheader 2.13.  */
+/* config.in.  Generated automatically from configure.in by autoheader.  */
 
 /* Define if using alloca.c.  */
 #undef C_ALLOCA
 /* Define true if the assembler supports '.long foo@GOTOFF'. */
 #undef HAVE_AS_GOTOFF_IN_DATA
 
+/* Define if your assembler supports ltoffx and ldxmov relocations. */
+#undef HAVE_AS_LTOFFX_LDXMOV_RELOCS
+
 /* Define if your assembler supports dwarf2 .file/.loc directives,
    and preserves file table indices exactly as given. */
 #undef HAVE_AS_DWARF2_DEBUG_LINE
index 67d005abcdceabc391b30094377d1b0eccdfa48a..6c61c72751972fd1f78f8aacbb2bd31b04fbf078 100644 (file)
@@ -7012,8 +7012,11 @@ ia64_ld_address_bypass_p (producer, consumer)
     mem = XVECEXP (mem, 0, 0);
   while (GET_CODE (mem) == SUBREG || GET_CODE (mem) == ZERO_EXTEND)
     mem = XEXP (mem, 0);
-  if (GET_CODE (mem) != MEM)
+
+  /* Note that LO_SUM is used for GOT loads.  */
+  if (GET_CODE (mem) != LO_SUM && GET_CODE (mem) != MEM)
     abort ();
+
   return reg_mentioned_p (reg, mem);
 }
 
index 77f7f34830fc71a9e8d7c70af981c2b14fa66919..db48f3b8ee8fb4f0f4f94c925c22786a14219756 100644 (file)
 
 (define_expand "load_symptr"
   [(set (match_operand:DI 2 "register_operand" "")
-       (plus:DI (match_dup 4) (match_operand:DI 1 "got_symbolic_operand" "")))
-   (set (match_operand:DI 0 "register_operand" "") (match_dup 3))]
+       (plus:DI (high:DI (match_operand:DI 1 "got_symbolic_operand" ""))
+                (match_dup 3)))
+   (set (match_operand:DI 0 "register_operand" "")
+       (lo_sum:DI (match_dup 2) (match_dup 1)))]
   ""
 {
-  operands[3] = gen_rtx_MEM (DImode, operands[2]);
-  operands[4] = pic_offset_table_rtx;
-  RTX_UNCHANGING_P (operands[3]) = 1;
+  operands[3] = pic_offset_table_rtx;
 })
 
-(define_insn "*load_symptr_internal1"
+(define_insn "*load_symptr_high"
   [(set (match_operand:DI 0 "register_operand" "=r")
-       (plus:DI (reg:DI 1) (match_operand 1 "got_symbolic_operand" "s")))]
+       (plus:DI (high:DI (match_operand 1 "got_symbolic_operand" "s"))
+                (match_operand:DI 2 "register_operand" "a")))]
   ""
-  "addl %0 = @ltoff(%1), gp"
+{
+  if (HAVE_AS_LTOFFX_LDXMOV_RELOCS)
+    return "%,addl %0 = @ltoffx(%1), %2";
+  else
+    return "%,addl %0 = @ltoff(%1), %2";
+}
   [(set_attr "itanium_class" "ialu")])
 
+(define_insn "*load_symptr_low"
+  [(set (match_operand:DI 0 "register_operand" "=r")
+       (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+                  (match_operand 2 "got_symbolic_operand" "s")))]
+  ""
+{
+  if (HAVE_AS_LTOFFX_LDXMOV_RELOCS)
+    return "%,ld8.mov %0 = [%1], %2";
+  else
+    return "%,ld8 %0 = [%1]";
+}
+  [(set_attr "itanium_class" "ld")])
+
 (define_insn "load_ltoff_dtpmod"
   [(set (match_operand:DI 0 "register_operand" "=r")
        (plus:DI (reg:DI 1)
index 9c65b28937b008b50a42d178b629bb0560a3ecc1..6d5b8f614127e59472b1284df1a54a2f0bf3817d 100755 (executable)
@@ -8291,10 +8291,52 @@ EOF
 
     echo "$ac_t""$gcc_cv_as_gotoff_in_data" 1>&6
     ;;
+
+  ia64*-*-*)
+    echo $ac_n "checking assembler supports ltoffx and ldxmov""... $ac_c" 1>&6
+echo "configure:8298: checking assembler supports ltoffx and ldxmov" >&5
+if eval "test \"`echo '$''{'gcc_cv_as_ltoffx_ldxmov_relocs'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+       gcc_cv_as_ltoffx_ldxmov_relocs=unknown
+       if test x$gcc_cv_gas_major_version != x \
+               -a x$gcc_cv_gas_minor_version != x
+       then
+          if test "$gcc_cv_gas_major_version" -eq 2 \
+                  -a "$gcc_cv_gas_minor_version" -ge 14 \
+                  -o "$gcc_cv_gas_major_version" -gt 2; then
+             gcc_cv_as_ltoffx_ldxmov_relocs=yes
+          fi
+       elif test x$gcc_cv_as != x; then
+           cat > conftest.s << 'EOF'
+       .text
+       addl r15 = @ltoffx(x#), gp
+       ;;
+       ld8.mov r16 = [r15], x#
+EOF
+           if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+               gcc_cv_as_ltoffx_ldxmov_relocs=yes
+           else
+               gcc_cv_as_ltoffx_ldxmov_relocs=no
+           fi
+           rm -f conftest.s conftest.o
+       fi
+    
+fi
+
+echo "$ac_t""$gcc_cv_as_ltoffx_ldxmov_relocs" 1>&6
+    if test "x$gcc_cv_as_ltoffx_ldxmov_relocs" = xyes; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_AS_LTOFFX_LDXMOV_RELOCS 1
+EOF
+
+    fi
+    ;;
 esac
 
 echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
-echo "configure:8298: checking assembler dwarf2 debug_line support" >&5
+echo "configure:8340: checking assembler dwarf2 debug_line support" >&5
 gcc_cv_as_dwarf2_debug_line=no
 # ??? Not all targets support dwarf2 debug_line, even within a version
 # of gas.  Moreover, we need to emit a valid instruction to trigger any
@@ -8351,7 +8393,7 @@ fi
 echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
 
 echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
-echo "configure:8355: checking assembler --gdwarf2 support" >&5
+echo "configure:8397: checking assembler --gdwarf2 support" >&5
 gcc_cv_as_gdwarf2_flag=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
 then
@@ -8380,7 +8422,7 @@ fi
 echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
 
 echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
-echo "configure:8384: checking assembler --gstabs support" >&5
+echo "configure:8426: checking assembler --gstabs support" >&5
 gcc_cv_as_gstabs_flag=no
 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
 then
@@ -8408,7 +8450,7 @@ fi
 echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
 
 echo $ac_n "checking linker read-only and read-write section mixing""... $ac_c" 1>&6
-echo "configure:8412: checking linker read-only and read-write section mixing" >&5
+echo "configure:8454: checking linker read-only and read-write section mixing" >&5
 gcc_cv_ld_ro_rw_mix=unknown
 if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
   if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
@@ -8446,7 +8488,7 @@ fi
 echo "$ac_t""$gcc_cv_ld_ro_rw_mix" 1>&6
 
 echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
-echo "configure:8450: checking linker PT_GNU_EH_FRAME support" >&5
+echo "configure:8492: checking linker PT_GNU_EH_FRAME support" >&5
 gcc_cv_ld_eh_frame_hdr=no
 if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
   if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
@@ -8470,7 +8512,7 @@ echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6
 case "$target" in
   mips*-*-*)
     echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6
-echo "configure:8474: checking whether libgloss uses STARTUP directives consistently" >&5
+echo "configure:8516: checking whether libgloss uses STARTUP directives consistently" >&5
     gcc_cv_mips_libgloss_startup=no
     gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
     if test "x$exec_prefix" = xNONE; then
@@ -8675,7 +8717,7 @@ fi
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:8679: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:8721: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
index 14fd66e3b5946c105765082a3660b523ca5aa1b9..fd9df77efc47e793c4f341eeca7c3f00297be756 100644 (file)
@@ -2233,6 +2233,41 @@ EOF
       [Define true if the assembler supports '.long foo@GOTOFF'.])
     AC_MSG_RESULT($gcc_cv_as_gotoff_in_data)
     ;;
+
+  ia64*-*-*)
+    AC_CACHE_CHECK([assembler supports ltoffx and ldxmov],
+       gcc_cv_as_ltoffx_ldxmov_relocs, [
+       gcc_cv_as_ltoffx_ldxmov_relocs=unknown
+       if test x$gcc_cv_gas_major_version != x \
+               -a x$gcc_cv_gas_minor_version != x
+       then
+          if test "$gcc_cv_gas_major_version" -eq 2 \
+                  -a "$gcc_cv_gas_minor_version" -ge 14 \
+                  -o "$gcc_cv_gas_major_version" -gt 2; then
+             gcc_cv_as_ltoffx_ldxmov_relocs=yes
+          fi
+       elif test x$gcc_cv_as != x; then
+           cat > conftest.s << 'EOF'
+changequote(,)dnl
+       .text
+       addl r15 = @ltoffx(x#), gp
+       ;;
+       ld8.mov r16 = [r15], x#
+EOF
+changequote([,])dnl
+           if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+               gcc_cv_as_ltoffx_ldxmov_relocs=yes
+           else
+               gcc_cv_as_ltoffx_ldxmov_relocs=no
+           fi
+           rm -f conftest.s conftest.o
+       fi
+    ])
+    if test "x$gcc_cv_as_ltoffx_ldxmov_relocs" = xyes; then
+       AC_DEFINE(HAVE_AS_LTOFFX_LDXMOV_RELOCS, 1,
+         [Define if your assembler supports ltoffx and ldxmov relocations.])
+    fi
+    ;;
 esac
 
 AC_MSG_CHECKING(assembler dwarf2 debug_line support)