aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-06-29 15:22:13 -0700
committerRichard Henderson <rth@gcc.gnu.org>2005-06-29 15:22:13 -0700
commit93b4080b3d02d47d9bd5e971b296430c5db567b1 (patch)
tree0abca352499e128169c91852fa76859b3be4a886 /gcc
parentf2a71bbcb28113d911c41f133a163f8f03fae04a (diff)
downloadgcc-93b4080b3d02d47d9bd5e971b296430c5db567b1.zip
gcc-93b4080b3d02d47d9bd5e971b296430c5db567b1.tar.gz
gcc-93b4080b3d02d47d9bd5e971b296430c5db567b1.tar.bz2
ia64.c (ia64_expand_vecint_minmax): Use us_minus and plus for V4HImode UMAX.
* config/ia64/ia64.c (ia64_expand_vecint_minmax): Use us_minus and plus for V4HImode UMAX. From-SVN: r101441
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/ia64/ia64.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 91e2631..ea8a5ae 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-29 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_expand_vecint_minmax): Use us_minus and
+ plus for V4HImode UMAX.
+
2005-06-29 Joseph S. Myers <joseph@codesourcery.com>
* c-tree.h (default_function_array_conversion): Take and return
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 85d0bd2..f8f3463 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -1689,6 +1689,18 @@ ia64_expand_vecint_minmax (enum rtx_code code, enum machine_mode mode,
if (mode == V4HImode && (code == SMIN || code == SMAX))
return false;
+ /* This combination can be implemented with only saturating subtraction. */
+ if (mode == V4HImode && code == UMAX)
+ {
+ rtx x, tmp = gen_reg_rtx (mode);
+
+ x = gen_rtx_US_MINUS (mode, operands[1], operands[2]);
+ emit_insn (gen_rtx_SET (VOIDmode, tmp, x));
+
+ emit_insn (gen_addv4hi3 (operands[0], tmp, operands[2]));
+ return true;
+ }
+
/* Everything else implemented via vector comparisons. */
xops[0] = operands[0];
xops[4] = xops[1] = operands[1];