public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kamil Iskra <kamil@dwd.interkom.pl>
To: Jim Wilson <wilson@cygnus.com>
Cc: egcs@cygnus.com
Subject: Re: Loop optimizer misses simple optimisation?
Date: Sat, 02 May 1998 06:13:00 -0000	[thread overview]
Message-ID: <Pine.LNX.3.96.980502143213.581F-100000@jinks.home> (raw)
In-Reply-To: <199804292128.OAA01108@rtl.cygnus.com>

On Wed, 29 Apr 1998, Jim Wilson wrote:

> The single_set checks means that insns that compute two values are never
> considered for loop-invariant-code-motion, hence we won't move a m68k
> divide out of a loop.

I see. But please have a look at udivmodsi4 in m68k.md:

(define_insn "udivmodsi4"
  [(set (match_operand:SI 0 "general_operand" "=d")
	(udiv:SI (match_operand:SI 1 "general_operand" "0")
		 (match_operand:SI 2 "general_operand" "dmsK")))
   (set (match_operand:SI 3 "general_operand" "=d")
	(umod:SI (match_dup 1) (match_dup 2)))]
  "TARGET_68020 && !TARGET_5200"
  "*
{
  if (find_reg_note (insn, REG_UNUSED, operands[3]))
    return \"divu%.l %2,%0\";
  else
    return \"divul%.l %2,%3:%0\";
}")

I don't know enough about division instructions available in m68020+, but
it looks to me from the above that there is an instruction that doesn't
generate the reminder, and that it is actually generated when the reminder
is not needed. Wouldn't it be better to move it to a separate, new udivsi3
pattern, instead of relying on REG_UNUSED, which is only available when
optimising, I suppose? This would allow the LICM code to do a better job,
wouldn't it?

/ Kamil Iskra    AmigaOS  Linux/i386  Linux/m68k               \
| GeekGadgets GCC maintainer   UNIX system administrator       |
| iskra@student.uci.agh.edu.pl  kiskra@ernie.icslab.agh.edu.pl |
\ kamil@dwd.interkom.pl   http://student.uci.agh.edu.pl/~iskra /


  reply	other threads:[~1998-05-02  6:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-28  7:23 Kamil Iskra
1998-04-28 19:14 ` Richard Henderson
1998-04-29 14:48   ` PÃ¥l-Kristian Engstad
1998-04-29 16:08     ` Richard Henderson
1998-04-28 19:49 ` Michael Meissner
1998-04-29 15:21 ` Jim Wilson
1998-05-02  6:13   ` Kamil Iskra [this message]
1998-05-03 14:15     ` Jeffrey A Law
1998-05-03 15:32       ` Jim Wilson
1998-05-03 20:10         ` Jeffrey A Law
1998-05-06  7:42           ` Was: " John Vickers
1998-05-06  9:19             ` Jeffrey A Law
1998-05-06 11:36             ` Joern Rennecke
1998-05-07  5:15               ` John Vickers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.3.96.980502143213.581F-100000@jinks.home \
    --to=kamil@dwd.interkom.pl \
    --cc=egcs@cygnus.com \
    --cc=wilson@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).