diff mbox

[3/6] rs6000: Don't use zero_extract in the bswap:HI splitter

Message ID fbf9b323d96e5b07c356c3f21bb20d6e859a7891.1431268135.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool May 10, 2015, 4:13 p.m. UTC
The next patch removes the zero_extract insn this splits to.  Write
it as (and (lshiftrt ... instead.

Okay for trunk?


Segher


2015-05-10  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (define_split for bswaphi): Don't use
	zero_extract.

---
 gcc/config/rs6000/rs6000.md | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

David Edelsohn May 11, 2015, 3:28 p.m. UTC | #1
On Sun, May 10, 2015 at 12:13 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> The next patch removes the zero_extract insn this splits to.  Write
> it as (and (lshiftrt ... instead.
>
> Okay for trunk?
>
>
> Segher
>
>
> 2015-05-10  Segher Boessenkool  <segher@kernel.crashing.org>
>
>         * config/rs6000/rs6000.md (define_split for bswaphi): Don't use
>         zero_extract.

Okay.

Thanks, David
diff mbox

Patch

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index acf890c..4bd16ee 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -2184,17 +2184,15 @@  (define_insn "bswaphi2_internal"
   [(set_attr "length" "4,4,12")
    (set_attr "type" "load,store,*")])
 
-;; We are always BITS_BIG_ENDIAN, so the (const_int 16) below is
-;; correct for -mlittle as well as -mbig.
 (define_split
   [(set (match_operand:HI 0 "gpc_reg_operand" "")
 	(bswap:HI (match_operand:HI 1 "gpc_reg_operand" "")))
    (clobber (match_operand:SI 2 "gpc_reg_operand" ""))]
   "reload_completed"
   [(set (match_dup 3)
-	(zero_extract:SI (match_dup 4)
-			 (const_int 8)
-			 (const_int 16)))
+	(and:SI (lshiftrt:SI (match_dup 4)
+			     (const_int 8))
+		(const_int 255)))
    (set (match_dup 2)
 	(and:SI (ashift:SI (match_dup 4)
 			   (const_int 8))