public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* widen conditions to use vec_extract patterns
@ 2004-07-07 12:18 Jan Beulich
  2004-07-07 12:46 ` Jakub Jelinek
  2004-07-08 22:44 ` Richard Henderson
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2004-07-07 12:18 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2785 bytes --]

bootstrapped and tested on x86_64-unknown-linux-gnu.

2004-07-07 Jan Beulich <jbeulich@novell.com>

	* expmed.c (extract_bit_field): Correct condition to use
vec_extract
	patterns also on vector elements other than the first one.
	* config/i386/i386.md (vec_extractv2df, vec_extractv4sf): Add
missing
	break statements.

---
/home/jbeulich/src/gcc/mainline/2004-07-05.10.09/gcc/config/i386/i386.md	2004-07-02
15:20:47.000000000 +0200
+++ 2004-07-05.10.09/gcc/config/i386/i386.md	2004-07-06
17:35:17.226889864 +0200
@@ -4838,6 +4838,7 @@
         emit_insn (gen_sse_shufps (operands[0], operands[0], tmp,
                                    GEN_INT (1 + (0<<2) + (2<<4) +
(3<<6))));
       }
+      break;
     case 2:
       {
         rtx op1 = simplify_gen_subreg (V4SFmode, operands[1], SFmode,
0);
@@ -4886,6 +4887,7 @@
         emit_insn (gen_sse_shufps (op0, tmp, tmp,
                                    const1_rtx));
       }
+      break;
     case 2:
       {
 	rtx op0 = simplify_gen_subreg (V4SFmode, operands[1], SFmode,
0);
@@ -4894,6 +4896,7 @@
         emit_move_insn (tmp, operands[1]);
         emit_insn (gen_sse_unpckhps (op0, tmp, tmp));
       }
+      break;
     case 3:
       {
 	rtx op0 = simplify_gen_subreg (V4SFmode, operands[1], SFmode,
0);
@@ -4903,6 +4906,7 @@
         emit_insn (gen_sse_shufps (op0, tmp, tmp,
                                    GEN_INT (3)));
       }
+      break;
     default:
       abort ();
     }
---
/home/jbeulich/src/gcc/mainline/2004-07-05.10.09/gcc/expmed.c	2004-07-05
09:18:03.000000000 +0200
+++ 2004-07-05.10.09/gcc/expmed.c	2004-07-06 17:24:47.468627672
+0200
@@ -329,7 +329,7 @@
 
   value = protect_from_queue (value, 0);
 
-  /* Use vec_extract patterns for extracting parts of vectors
whenever
+  /* Use vec_set patterns for inserting parts of vectors whenever
      available.  */
   if (VECTOR_MODE_P (GET_MODE (op0))
       && !MEM_P (op0)
@@ -1102,13 +1102,13 @@
       && !MEM_P (op0)
       && (vec_extract_optab->handlers[GET_MODE (op0)].insn_code
 	  != CODE_FOR_nothing)
-      && ((bitsize + bitnum) / GET_MODE_BITSIZE (GET_MODE_INNER
(GET_MODE (op0)))
-	  == bitsize / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE
(op0)))))
+      && ((bitnum + bitsize - 1) / GET_MODE_BITSIZE (GET_MODE_INNER
(GET_MODE (op0)))
+	  == bitnum / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE
(op0)))))
     {
       enum machine_mode outermode = GET_MODE (op0);
       enum machine_mode innermode = GET_MODE_INNER (outermode);
       int icode = (int)
vec_extract_optab->handlers[outermode].insn_code;
-      int pos = bitnum / GET_MODE_BITSIZE (innermode);
+      unsigned HOST_WIDE_INT pos = bitnum / GET_MODE_BITSIZE
(innermode);
       rtx rtxpos = GEN_INT (pos);
       rtx src = op0;
       rtx dest = NULL, pat, seq;


[-- Attachment #2: gcc-mainline-vector-extract.patch --]
[-- Type: application/octet-stream, Size: 2730 bytes --]

2004-07-07 Jan Beulich <jbeulich@novell.com>

	* expmed.c (extract_bit_field): Correct condition to use vec_extract
	patterns also on vector elements other than the first one.
	* config/i386/i386.md (vec_extractv2df, vec_extractv4sf): Add missing
	break statements.

--- /home/jbeulich/src/gcc/mainline/2004-07-05.10.09/gcc/config/i386/i386.md	2004-07-02 15:20:47.000000000 +0200
+++ 2004-07-05.10.09/gcc/config/i386/i386.md	2004-07-06 17:35:17.226889864 +0200
@@ -4838,6 +4838,7 @@
         emit_insn (gen_sse_shufps (operands[0], operands[0], tmp,
                                    GEN_INT (1 + (0<<2) + (2<<4) + (3<<6))));
       }
+      break;
     case 2:
       {
         rtx op1 = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0);
@@ -4886,6 +4887,7 @@
         emit_insn (gen_sse_shufps (op0, tmp, tmp,
                                    const1_rtx));
       }
+      break;
     case 2:
       {
 	rtx op0 = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0);
@@ -4894,6 +4896,7 @@
         emit_move_insn (tmp, operands[1]);
         emit_insn (gen_sse_unpckhps (op0, tmp, tmp));
       }
+      break;
     case 3:
       {
 	rtx op0 = simplify_gen_subreg (V4SFmode, operands[1], SFmode, 0);
@@ -4903,6 +4906,7 @@
         emit_insn (gen_sse_shufps (op0, tmp, tmp,
                                    GEN_INT (3)));
       }
+      break;
     default:
       abort ();
     }
--- /home/jbeulich/src/gcc/mainline/2004-07-05.10.09/gcc/expmed.c	2004-07-05 09:18:03.000000000 +0200
+++ 2004-07-05.10.09/gcc/expmed.c	2004-07-06 17:24:47.468627672 +0200
@@ -329,7 +329,7 @@
 
   value = protect_from_queue (value, 0);
 
-  /* Use vec_extract patterns for extracting parts of vectors whenever
+  /* Use vec_set patterns for inserting parts of vectors whenever
      available.  */
   if (VECTOR_MODE_P (GET_MODE (op0))
       && !MEM_P (op0)
@@ -1102,13 +1102,13 @@
       && !MEM_P (op0)
       && (vec_extract_optab->handlers[GET_MODE (op0)].insn_code
 	  != CODE_FOR_nothing)
-      && ((bitsize + bitnum) / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))
-	  == bitsize / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))))
+      && ((bitnum + bitsize - 1) / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))
+	  == bitnum / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))))
     {
       enum machine_mode outermode = GET_MODE (op0);
       enum machine_mode innermode = GET_MODE_INNER (outermode);
       int icode = (int) vec_extract_optab->handlers[outermode].insn_code;
-      int pos = bitnum / GET_MODE_BITSIZE (innermode);
+      unsigned HOST_WIDE_INT pos = bitnum / GET_MODE_BITSIZE (innermode);
       rtx rtxpos = GEN_INT (pos);
       rtx src = op0;
       rtx dest = NULL, pat, seq;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: widen conditions to use vec_extract patterns
  2004-07-07 12:18 widen conditions to use vec_extract patterns Jan Beulich
@ 2004-07-07 12:46 ` Jakub Jelinek
  2004-07-08 22:44 ` Richard Henderson
  1 sibling, 0 replies; 4+ messages in thread
From: Jakub Jelinek @ 2004-07-07 12:46 UTC (permalink / raw)
  To: Jan Beulich; +Cc: gcc-patches

On Wed, Jul 07, 2004 at 02:12:53PM +0200, Jan Beulich wrote:
> bootstrapped and tested on x86_64-unknown-linux-gnu.
> 
> 2004-07-07 Jan Beulich <jbeulich@novell.com>
> 
> 	* expmed.c (extract_bit_field): Correct condition to use
> vec_extract
> 	patterns also on vector elements other than the first one.
> 	* config/i386/i386.md (vec_extractv2df, vec_extractv4sf): Add
> missing
> 	break statements.

The wrapped up patches aren't IMHO very readable and having every patch
in each mail twice is not very useful either.
Please either fix your mailer so that it doesn't wrap lines (then
you can post the patches inline and not as attachments), or send them
as attachments only.

	Jakub

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: widen conditions to use vec_extract patterns
  2004-07-07 12:18 widen conditions to use vec_extract patterns Jan Beulich
  2004-07-07 12:46 ` Jakub Jelinek
@ 2004-07-08 22:44 ` Richard Henderson
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2004-07-08 22:44 UTC (permalink / raw)
  To: Jan Beulich; +Cc: gcc-patches

On Wed, Jul 07, 2004 at 02:12:53PM +0200, Jan Beulich wrote:
> 	* expmed.c (extract_bit_field): Correct condition to use vec_extract
> 	patterns also on vector elements other than the first one.
> 	* config/i386/i386.md (vec_extractv2df, vec_extractv4sf): Add missing
> 	break statements.

Applied.


r~

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: widen conditions to use vec_extract patterns
@ 2004-07-07 13:48 Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2004-07-07 13:48 UTC (permalink / raw)
  To: jakub; +Cc: gcc-patches

I tried to get the wrapping addressed, but our IS&T folks denied such a
possibility. Thus I decided (and I was previously asked) to attach them
along with including them inline (since again, supposedly that same
mailer also doesn't show the attachments as plain text files, which
again the same IS&T guys denied changing). I don't think, given these
restrictions, I can please everyone. Nor can I play democracy and ask
everyone to vote to please at least the larger part. Sorry, Jan

>>> Jakub Jelinek <jakub@redhat.com> 07.07.04 14:18:21 >>>
On Wed, Jul 07, 2004 at 02:12:53PM +0200, Jan Beulich wrote:
> bootstrapped and tested on x86_64-unknown-linux-gnu.
> 
> 2004-07-07 Jan Beulich <jbeulich@novell.com>
> 
> 	* expmed.c (extract_bit_field): Correct condition to use
> vec_extract
> 	patterns also on vector elements other than the first one.
> 	* config/i386/i386.md (vec_extractv2df, vec_extractv4sf): Add
> missing
> 	break statements.

The wrapped up patches aren't IMHO very readable and having every
patch
in each mail twice is not very useful either.
Please either fix your mailer so that it doesn't wrap lines (then
you can post the patches inline and not as attachments), or send them
as attachments only.

	Jakub

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-07-08 21:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-07 12:18 widen conditions to use vec_extract patterns Jan Beulich
2004-07-07 12:46 ` Jakub Jelinek
2004-07-08 22:44 ` Richard Henderson
2004-07-07 13:48 Jan Beulich

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).