OSDN Git Service

* config/ia64/ia64.md (divsi3): Fix algorithm.
authorsje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Mar 2004 00:26:31 +0000 (00:26 +0000)
committersje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Mar 2004 00:26:31 +0000 (00:26 +0000)
  (udivsi3): Ditto.
  (setf_exp_xf): Remove '*' from name.
* testsuite/gcc.dg/20040309-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79217 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/ia64/ia64.md
gcc/testsuite/gcc.dg/20040309-1.c [new file with mode: 0644]

index 4593d9f..65b91f7 100644 (file)
@@ -1,3 +1,10 @@
+2004-03-09  Steve Ellcey  <sje@cup.hp.com>
+
+       * config/ia64/ia64.md (divsi3): Fix algorithm.
+         (udivsi3): Ditto.
+         (setf_exp_xf): Remove '*' from name.
+       * testsuite/gcc.dg/20040309-1.c: New test.
+
 2004-03-09  Ian Lance Taylor  <ian@wasabisystems.com>
 
        * system.h (SUNOS4_SHARED_LIBRARIES): Poison.
index 1c0cc12..c12c8f3 100644 (file)
                (match_operand:SI 2 "general_operand" "")))]
   "TARGET_INLINE_INT_DIV"
 {
-  rtx op1_xf, op2_xf, op0_xf, op0_di, twon34;
+  rtx op1_xf, op2_xf, op0_xf, op0_di, twon34, twon34_exp;
   REAL_VALUE_TYPE twon34_r;
 
   op0_xf = gen_reg_rtx (XFmode);
   expand_float (op2_xf, operands[2], 0);
 
   /* 2^-34 */
-  real_2expN (&twon34_r, -34);
-  twon34 = CONST_DOUBLE_FROM_REAL_VALUE (twon34_r, XFmode);
-  twon34 = force_reg (XFmode, twon34);
+  twon34_exp = gen_reg_rtx (DImode);
+  emit_move_insn (twon34_exp, GEN_INT (65501));
+  twon34 = gen_reg_rtx (XFmode);
+  emit_insn (gen_setf_exp_xf (twon34, twon34_exp));
 
   emit_insn (gen_divsi3_internal (op0_xf, op1_xf, op2_xf, twon34));
 
                 (match_operand:SI 2 "general_operand" "")))]
   "TARGET_INLINE_INT_DIV"
 {
-  rtx op1_xf, op2_xf, op0_xf, op0_di, twon34;
+  rtx op1_xf, op2_xf, op0_xf, op0_di, twon34, twon34_exp;
   REAL_VALUE_TYPE twon34_r;
 
   op0_xf = gen_reg_rtx (XFmode);
   expand_float (op2_xf, operands[2], 1);
 
   /* 2^-34 */
-  real_2expN (&twon34_r, -34);
-  twon34 = CONST_DOUBLE_FROM_REAL_VALUE (twon34_r, XFmode);
-  twon34 = force_reg (XFmode, twon34);
+  twon34_exp = gen_reg_rtx (DImode);
+  emit_move_insn (twon34_exp, GEN_INT (65501));
+  twon34 = gen_reg_rtx (XFmode);
+  emit_insn (gen_setf_exp_xf (twon34, twon34_exp));
 
   emit_insn (gen_divsi3_internal (op0_xf, op1_xf, op2_xf, twon34));
 
   [(set_attr "itanium_class" "fmisc")
    (set_attr "predicable" "no")])
 
-(define_insn "*setf_exp_xf"
+(define_insn "setf_exp_xf"
   [(set (match_operand:XF 0 "fr_register_operand" "=f")
         (unspec:XF [(match_operand:DI 1 "register_operand" "r")]
                   UNSPEC_SETF_EXP))]
diff --git a/gcc/testsuite/gcc.dg/20040309-1.c b/gcc/testsuite/gcc.dg/20040309-1.c
new file mode 100644 (file)
index 0000000..7361507
--- /dev/null
@@ -0,0 +1,17 @@
+/* Test integer mod on ia64.  There was a bug in the inline integer
+   division code. */
+
+/* { dg-do run } */
+/* { dg-options "-minline-int-divide-max-throughput" { target ia64-*-* } } */
+
+extern void abort (void);
+
+volatile int i = 10;
+volatile int j = 10;
+
+int main()
+{
+        int k = i % j;
+        if (k != 0) abort();
+       return 0;
+}