public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/41665]  New: Typo in addsi_1_zext?
@ 2009-10-10 18:11 hjl dot tools at gmail dot com
  2009-10-10 18:29 ` [Bug target/41665] " hjl dot tools at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-10-10 18:11 UTC (permalink / raw)
  To: gcc-bugs

There are

(define_insn "addsi_1_zext"
  [(set (match_operand:DI 0 "register_operand" "=r,r")
        (zero_extend:DI
          (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r")
                   (match_operand:SI 2 "general_operand" "g,li"))))
   (clobber (reg:CC FLAGS_REG))]
  "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)"
{
  switch (get_attr_type (insn))
    {
    case TYPE_LEA:
      operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
      return "lea{l}\t{%a2, %k0|%k0, %a2}";

    case TYPE_INCDEC:
      if (operands[2] == const1_rtx)
        return "inc{l}\t%k0";
      else
        {
          gcc_assert (operands[2] == constm1_rtx);
          return "dec{l}\t%k0";
        }

    default:
      /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
         Exceptions: -128 encodes smaller than 128, so swap sign and op.  */
      if (CONST_INT_P (operands[2])
          && (INTVAL (operands[2]) == 128
              || (INTVAL (operands[2]) < 0
                  && INTVAL (operands[2]) != -128)))
        {
          operands[2] = GEN_INT (-INTVAL (operands[2]));
          return "sub{l}\t{%2, %k0|%k0, %2}";
        }
      return "add{l}\t{%2, %k0|%k0, %2}";
    }
}

Shouldn't it be

(plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")

Am I missing something?


-- 
           Summary: Typo in addsi_1_zext?
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com
GCC target triplet: x86_64-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41665


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-10-15 14:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-10 18:11 [Bug target/41665] New: Typo in addsi_1_zext? hjl dot tools at gmail dot com
2009-10-10 18:29 ` [Bug target/41665] " hjl dot tools at gmail dot com
2009-10-10 18:31 ` ubizjak at gmail dot com
2009-10-10 18:57 ` hjl dot tools at gmail dot com
2009-10-11 12:13 ` ubizjak at gmail dot com
2009-10-11 14:28 ` hjl dot tools at gmail dot com
2009-10-11 19:43 ` hjl at gcc dot gnu dot org
2009-10-15 14:01 ` hjl at gcc dot gnu dot org
2009-10-15 14:06 ` hjl dot tools at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).