This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/64946] [AArch64] gcc.target/aarch64/vect-abs-compile.c - "abs" vectorization fails for char/short types
- From: "shiva0217 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Jun 2016 05:44:03 +0000
- Subject: [Bug tree-optimization/64946] [AArch64] gcc.target/aarch64/vect-abs-compile.c - "abs" vectorization fails for char/short types
- Auto-submitted: auto-generated
- References: <bug-64946-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64946
--- Comment #17 from Shiva Chen <shiva0217 at gmail dot com> ---
Hi, Richard
Thanks for the explanation :)
So the transformation (short)abs((int)short_var) -> abs (short_var)
should guard by TYPE_OVERFLOW_WRAPS
because when TYPE_OVERFLOW_WRAPS is true, signed operation could wrap
around.(ABS_EXPR in gimple could wrap around and rtl abs already modulo)
Therefore, the transformation is valid when TYPE_OVERFLOW_WRAPS is true.
It seems the last update of Matthew's patch in
https://gcc.gnu.org/ml/gcc-patches/2016-01/msg00433.html
still make sense.
Why would it be dropped, or there're still something we should consider ?
If we implement ABSU_EXPR, when should transfer
ABS_EXPR (x) -> (type of x) ABSU_EXPR (x) ?
Could we define like if (!TYPE_OVERFLOW_WRAPS) then transfer ABS_EXPR (x) ->
(type of x) ABSU_EXPR (x) in match.pd ?
How to expand (type of x) ABSU_EXPR (x) to rtl ?
Do we have to add a new naming pattern absu ?