David Edelsohn - Re: [RS6000 PATCH] Implement bswapsi2 intrinsic (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
- From: David Edelsohn
- To: "Roger Sayle"
- Cc: gcc-patches at gcc dot gnu dot org, Andrew Pinski
- Date: Thu, 15 Feb 2007 14:15:11 -0500
- Subject: Re: [RS6000 PATCH] Implement bswapsi2 intrinsic
- References: <4048.68.35.10.103.1171037429.squirrel@mail.eyesopen.com>
As Andrew Pinski mentioned, I think a more complete patch is
something like the following. I tested that this produces the correct results for the testcases, but have not bootstrapped it yet.
David
David Edelsohn <edelsohn@gnu.org>
Roger Sayle <roger@eyesopen.com>
* config/rs6000/rs6000.md (bswapsi2): New.
Index: rs6000.md
--- rs6000.md (revision 121912) +++ rs6000.md (working copy) @@ -2186,6 +2186,33 @@ DONE; })
+(define_insn "bswapsi2"
- [(set (match_operand:SI 0 "reg_or_mem_operand" "=r,Z,r")
- (bswap:SI (match_operand:SI 1 "reg_or_mem_operand" "Z,r,r")))]
- ""
- "@
- {lbrx|lwbrx} %0,%y1
- {stbrx|stwbrx} %1,%y0
- #"
- [(set_attr "length" "4,4,12")])
- +(define_split
- [(set (match_operand:SI 0 "gpc_reg_operand" "")
- (bswap:SI (match_operand:SI 1 "gpc_reg_operand" "")))]
- ""
- [(set (match_dup 0)
- (rotate:SI (match_dup 1) (const_int 8)))
- (set (zero_extract:SI (match_dup 0)
(const_int 8)
(const_int 0))
- (match_dup 1))
- (set (zero_extract:SI (match_dup 0)
(const_int 8)
(const_int 16))
- (rotate:SI (match_dup 1)
(const_int 16)))]
- "")
- (define_expand "mulsi3" [(use (match_operand:SI 0 "gpc_reg_operand" "")) (use (match_operand:SI 1 "gpc_reg_operand" ""))
- Follow-Ups:
- Re: [RS6000 PATCH] Implement bswapsi2 intrinsic
* From: Roger Sayle - Re: [RS6000 PATCH] Implement bswapsi2 intrinsic
* From: Richard Henderson
- Re: [RS6000 PATCH] Implement bswapsi2 intrinsic
- References:
- [RS6000 PATCH] Implement bswapsi2 intrinsic
* From: Roger Sayle
- [RS6000 PATCH] Implement bswapsi2 intrinsic
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |