On 2021-07-15 02:04, Segher Boessenkool wrote:
Hi!
On Wed, Jul 14, 2021 at 06:26:28PM +0800, guojiufu wrote:
PR target/61837
Wrong PR number?
There is a patch optimize "add -1; zero_ext; add +1" to "zero_ext"
already.
Having this patch would help to avoid the left 'zero_ext', so, I reuse
this
PR number.
+@deftypefn {Target Hook} machine_mode TARGET_PREFERRED_DOLOOP_MODE
(machine_mode @var{mode})
+This hook takes a @var{mode} which is the original mode of doloop IV.
+And if the target prefers other mode for doloop IV, this hook returns
the
+preferred mode.
+For example, on 64bit target, DImode may be preferred than SImode.
+This hook could return the original mode itself if the target prefer
to
+keep the original mode.
+The origianl mode and return mode should be MODE_INT.
+@end deftypefn
(Typo, "original"). That has all the right contents, but needs someone
who is better at English than me to look at it / improve it.
+/* { dg-final {scan-rtl-dump-not "zero_extend.*doloop"
"loop2_doloop"}
} */
+/* { dg-final {scan-rtl-dump-not "reg:SI.*doloop" "loop2_doloop" {
target lp64 } } } */
(Don't use format=flowed in your mails, or certainly not in those
containing patches -- it was rewrapped).
Oh, thanks for point out this!
If you use .* in scan REs, you should be aware that "." matches
newlines
by default, so you can match "reg:SI" on one line and "doloop" on a
later one, in that second one.
You can write
/* { dg-final {scan-rtl-dump-not {(?p)reg:SI.*doloop} "loop2_doloop" {
target lp64 } } } */
(note: {} are much more convenient around most REs, you need a lot of
escaping without it) to get "partial newline-sensitive matching", which
is usually what you want (see "man re_syntax" for the details).
Thanks so much! This helps me a lot about writing test cases,
especially
on how to scan-xxx re in test case!
The generic changes look fine to me (but what do I know about Gimple!)
The rs6000 changes are fine if the rest is approved (and see the
testcase comments). Thanks!
Thanks again!
BR,
Jiufu
Segher