* Missing documentation in regmove.c
@ 1998-05-11 2:01 Andreas Schwab
1998-05-11 18:12 ` Jim Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 1998-05-11 2:01 UTC (permalink / raw)
To: egcs
I'm trying to find out what the functions fixup_match_2, find_matches and
regmove_profitable in regmove.c are doing, but they have no usefull
documentation.
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
schwab@gnu.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Missing documentation in regmove.c
1998-05-11 2:01 Missing documentation in regmove.c Andreas Schwab
@ 1998-05-11 18:12 ` Jim Wilson
1998-05-13 1:47 ` Andreas Schwab
0 siblings, 1 reply; 3+ messages in thread
From: Jim Wilson @ 1998-05-11 18:12 UTC (permalink / raw)
To: Andreas Schwab; +Cc: amylaar, egcs
I added some comments which should help.
Index: regmove.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/regmove.c,v
retrieving revision 1.16
diff -p -r1.16 regmove.c
*** regmove.c 1998/04/18 15:42:46 1.16
--- regmove.c 1998/05/12 01:09:17
*************** reg_is_remote_constant_p (reg, insn, fir
*** 568,575 ****
--- 568,591 ----
return 0;
}
+ /* INSN is adding a CONST_INT to a REG. We search backwards looking for
+ another add immediate instruction with the same source and dest registers,
+ and if we find one, we change INSN to an increment, and return 1. If
+ no changes are made, we return 0.
+
+ This changes
+ (set (reg100) (plus reg1 offset1))
+ ...
+ (set (reg100) (plus reg1 offset2))
+ to
+ (set (reg100) (plus reg1 offset1))
+ ...
+ (set (reg100) (plus reg100 offset2-offset1)) */
+
+ /* ??? What does this comment mean? */
/* cse disrupts preincrement / postdecrement squences when it finds a
hard register as ultimate source, like the frame pointer. */
+
int
fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
rtx insn, dst, src, offset;
*************** regmove_optimize (f, nregs, regmove_dump
*** 1141,1147 ****
--- 1157,1168 ----
#endif /* REGISTER_CONSTRAINTS */
}
+ /* Returns the INSN_CODE for INSN if its pattern has matching constraints for
+ any operand. Returns -1 if INSN can't be recognized, or if the alternative
+ can't be determined.
+ Initialize the info in MATCHP based on the constraints. */
+
static int
find_matches (insn, matchp)
rtx insn;
*************** stable_but_for_p (x, src, dst)
*** 1708,1715 ****
return ! rtx_unstable_p (x);
}
}
- /* Test if regmove seems profitable for this target. */
int
regmove_profitable_p ()
{
--- 1729,1739 ----
return ! rtx_unstable_p (x);
}
}
+
+ /* Test if regmove seems profitable for this target. Regmove is useful only
+ if some common patterns are two address, i.e. require matching constraints,
+ so we check that condition here. */
int
regmove_profitable_p ()
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Missing documentation in regmove.c
1998-05-11 18:12 ` Jim Wilson
@ 1998-05-13 1:47 ` Andreas Schwab
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 1998-05-13 1:47 UTC (permalink / raw)
To: Jim Wilson; +Cc: amylaar, egcs
Jim Wilson <wilson@cygnus.com> writes:
|> I added some comments which should help.
Thanks.
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
schwab@gnu.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1998-05-13 1:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-11 2:01 Missing documentation in regmove.c Andreas Schwab
1998-05-11 18:12 ` Jim Wilson
1998-05-13 1:47 ` Andreas Schwab
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).