This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [AArch64] Implement ADD in vector registers for 32-bit scalar values.
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: marcus dot shawcroft at arm dot com, kyrylo dot tkachov at arm dot com, pinskia at gmail dot com, richard dot earnshaw at arm dot com
- Date: Mon, 23 Jun 2014 17:06:15 +0100
- Subject: Re: [AArch64] Implement ADD in vector registers for 32-bit scalar values.
- Authentication-results: sourceware.org; auth=none
- References: <53A82348 dot 6010502 at arm dot com>
On Mon, Jun 23, 2014 at 01:53:28PM +0100, Kyrill Tkachov wrote:
> On 19/06/14 14:12, James Greenhalgh wrote:
> > diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
> > >index 266d7873a5a1b8dbb7f955c3f13cf370920a9c4a..7c5b5a566ebfd907b83b38eed2e214738e7e9bd4 100644
> > >--- a/gcc/config/aarch64/aarch64.md
> > >+++ b/gcc/config/aarch64/aarch64.md
> > >@@ -1068,16 +1068,17 @@ (define_expand "add<mode>3"
> > >
> > > (define_insn "*addsi3_aarch64"
> > > [(set
> > >- (match_operand:SI 0 "register_operand" "=rk,rk,rk")
> > >+ (match_operand:SI 0 "register_operand" "=rk,rk,w,rk")
> > > (plus:SI
> > >- (match_operand:SI 1 "register_operand" "%rk,rk,rk")
> > >- (match_operand:SI 2 "aarch64_plus_operand" "I,r,J")))]
> > >+ (match_operand:SI 1 "register_operand" "%rk,rk,w,rk")
> > >+ (match_operand:SI 2 "aarch64_plus_operand" "I,r,w,J")))]
> > > ""
> > > "@
> > > add\\t%w0, %w1, %2
> > > add\\t%w0, %w1, %w2
> > >+ add\\t%0.2s, %1.2s, %2.2s
> > > sub\\t%w0, %w1, #%n2"
> > >- [(set_attr "type" "alu_imm,alu_reg,alu_imm")]
> > >+ [(set_attr "type" "alu_imm,alu_reg,neon_add,alu_imm")]
> > > )
> > >
> Minor nit, you should set the "simd" attribute to yes for the added
> alternative to make sure it doesn't get selected when !TARGET_SIMD
Hi Kyrill,
Thanks, you are of course correct. I wouldn't call this a minor nit though,
if we were unlucky, it could easily break a kernel build in some subtle and
annoying way!
Good catch!
I've committed the attached as obvious as revision 211899 after testing
on aarch64-none-elf.
Thanks,
James
---
gcc/
2014-06-23 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64.md (addsi3_aarch64): Set "simd" attr to
"yes" where needed.
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 5f5b4ff..8705ee9 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -1167,7 +1167,8 @@
add\\t%w0, %w1, %w2
add\\t%0.2s, %1.2s, %2.2s
sub\\t%w0, %w1, #%n2"
- [(set_attr "type" "alu_imm,alu_reg,neon_add,alu_imm")]
+ [(set_attr "type" "alu_imm,alu_reg,neon_add,alu_imm")
+ (set_attr "simd" "*,*,yes,*")]
)
;; zero_extend version of above