Patchwork [RFA/ARM] : Fix NEG_POOL_RANGE

login
register
mail settings
Submitter Sameera Deshpande
Date Nov. 17, 2011, 3:16 p.m.
Message ID <1321543014.28518.215.camel@e102549-lin.cambridge.arm.com>
Download mbox | patch
Permalink /patch/126251/
State New
Headers show

Comments

Sameera Deshpande - Nov. 17, 2011, 3:16 p.m.
Hi!

Please find attached the patch updating NEG_POOL_RANGE from 1008 to
1020 -(8 + <data size>).

Tested with check-gcc with no regression.

The test-case failing for patch 'STRD generation instead of PUSH in A15
ARM prologue' (http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01158.html)
passes with this fix.

gcc/ChangeLog entry:

2011-11-17  Sameera Deshpande  <sameera.deshpande@arm.com>

       * config/arm/arm.md (arm_movdi): Update NEG_POOL_RANGE.
         (movdf_soft_insn): Likewise.
       * config/arm/fpa.md (thumb2_movdf_fpa): Likewise.
       * config/arm/neon.md (neon_mov<mode>): Likewise.
       * config/arm/vfp.md (movdi_vfp): Likewise.
         (movdi_vfp_cortexa8): Likewise.
         (movdf_vfp): Likewise.

- Thanks and regards,
  Sameera D.
Ramana Radhakrishnan - Nov. 18, 2011, 11:12 p.m.
On 17 November 2011 15:16, Sameera Deshpande <sameera.deshpande@arm.com> wrote:
> Hi!
>
> Please find attached the patch updating NEG_POOL_RANGE from 1008 to
> 1020 -(8 + <data size>).

This is OK - can you add a comment around the neg_pool_range attribute
in arm.md stating that the limit should essentially be <max_range> -
(8 + <data_size> ?.

cheers
Ramana

Patch

*** gcc/config/arm/.svn/text-base/arm.md.svn-base	Mon Oct 31 14:59:55 2011
--- gcc/config/arm/arm.md	Thu Nov 17 11:52:38 2011
*************** (define_insn "*arm_movdi"
*** 5223,5229 ****
    [(set_attr "length" "8,12,16,8,8")
     (set_attr "type" "*,*,*,load2,store2")
     (set_attr "arm_pool_range" "*,*,*,1020,*")
!    (set_attr "arm_neg_pool_range" "*,*,*,1008,*")
     (set_attr "thumb2_pool_range" "*,*,*,4096,*")
     (set_attr "thumb2_neg_pool_range" "*,*,*,0,*")]
  )
--- 5223,5229 ----
    [(set_attr "length" "8,12,16,8,8")
     (set_attr "type" "*,*,*,load2,store2")
     (set_attr "arm_pool_range" "*,*,*,1020,*")
!    (set_attr "arm_neg_pool_range" "*,*,*,1004,*")
     (set_attr "thumb2_pool_range" "*,*,*,4096,*")
     (set_attr "thumb2_neg_pool_range" "*,*,*,0,*")]
  )
*************** (define_insn "*movdf_soft_insn"
*** 6583,6589 ****
    [(set_attr "length" "8,12,16,8,8")
     (set_attr "type" "*,*,*,load2,store2")
     (set_attr "pool_range" "*,*,*,1020,*")
!    (set_attr "arm_neg_pool_range" "*,*,*,1008,*")
     (set_attr "thumb2_neg_pool_range" "*,*,*,0,*")]
  )
  
--- 6583,6589 ----
    [(set_attr "length" "8,12,16,8,8")
     (set_attr "type" "*,*,*,load2,store2")
     (set_attr "pool_range" "*,*,*,1020,*")
!    (set_attr "arm_neg_pool_range" "*,*,*,1004,*")
     (set_attr "thumb2_neg_pool_range" "*,*,*,0,*")]
  )
  
*** gcc/config/arm/.svn/text-base/neon.md.svn-base	Mon Oct 31 14:59:54 2011
--- gcc/config/arm/neon.md	Thu Nov 17 11:52:38 2011
*************** (define_insn "*neon_mov<mode>"
*** 198,204 ****
    (set_attr "insn" "*,*,*,*,*,*,mov,*,*")
    (set_attr "length" "4,4,4,4,4,4,8,8,8")
    (set_attr "pool_range"     "*,*,*,1020,*,*,*,1020,*")
!   (set_attr "neg_pool_range" "*,*,*,1008,*,*,*,1008,*")])
  
  (define_insn "*neon_mov<mode>"
    [(set (match_operand:VQXMOV 0 "nonimmediate_operand"
--- 198,204 ----
    (set_attr "insn" "*,*,*,*,*,*,mov,*,*")
    (set_attr "length" "4,4,4,4,4,4,8,8,8")
    (set_attr "pool_range"     "*,*,*,1020,*,*,*,1020,*")
!   (set_attr "neg_pool_range" "*,*,*,1004,*,*,*,1004,*")])
  
  (define_insn "*neon_mov<mode>"
    [(set (match_operand:VQXMOV 0 "nonimmediate_operand"
*************** (define_insn "*neon_mov<mode>"
*** 243,249 ****
     (set_attr "insn" "*,*,*,*,*,*,mov,*,*")
     (set_attr "length" "4,8,4,8,8,8,16,8,16")
     (set_attr "pool_range" "*,*,*,1020,*,*,*,1020,*")
!    (set_attr "neg_pool_range" "*,*,*,1008,*,*,*,1008,*")])
  
  (define_expand "movti"
    [(set (match_operand:TI 0 "nonimmediate_operand" "")
--- 243,249 ----
     (set_attr "insn" "*,*,*,*,*,*,mov,*,*")
     (set_attr "length" "4,8,4,8,8,8,16,8,16")
     (set_attr "pool_range" "*,*,*,1020,*,*,*,1020,*")
!    (set_attr "neg_pool_range" "*,*,*,996,*,*,*,996,*")])
  
  (define_expand "movti"
    [(set (match_operand:TI 0 "nonimmediate_operand" "")
*** gcc/config/arm/.svn/text-base/vfp.md.svn-base	Thu Sep 29 10:31:13 2011
--- gcc/config/arm/vfp.md	Thu Nov 17 11:52:38 2011
*************** (define_insn "*movdi_vfp"
*** 178,184 ****
                                   (const_int 4))]
                                (const_int 4)))
     (set_attr "pool_range"     "*,*,*,*,1020,4096,*,*,*,*,1020,*")
!    (set_attr "neg_pool_range" "*,*,*,*,1008,0,*,*,*,*,1008,*")
     (set_attr "arch"           "t2,any,any,any,a,t2,any,any,any,any,any,any")]
  )
  
--- 178,184 ----
                                   (const_int 4))]
                                (const_int 4)))
     (set_attr "pool_range"     "*,*,*,*,1020,4096,*,*,*,*,1020,*")
!    (set_attr "neg_pool_range" "*,*,*,*,1004,0,*,*,*,*,1004,*")
     (set_attr "arch"           "t2,any,any,any,a,t2,any,any,any,any,any,any")]
  )
  
*************** (define_insn "*movdi_vfp_cortexa8"
*** 223,229 ****
                                (const_int 4)))
     (set_attr "predicable"    "yes")
     (set_attr "pool_range"     "*,*,*,*,1020,4096,*,*,*,*,1020,*")
!    (set_attr "neg_pool_range" "*,*,*,*,1008,0,*,*,*,*,1008,*")
     (set (attr "ce_count") 
  	(symbol_ref "get_attr_length (insn) / 4"))
     (set_attr "arch"           "t2,any,any,any,a,t2,any,any,any,any,any,any")]
--- 223,229 ----
                                (const_int 4)))
     (set_attr "predicable"    "yes")
     (set_attr "pool_range"     "*,*,*,*,1020,4096,*,*,*,*,1020,*")
!    (set_attr "neg_pool_range" "*,*,*,*,1004,0,*,*,*,*,1004,*")
     (set (attr "ce_count") 
  	(symbol_ref "get_attr_length (insn) / 4"))
     (set_attr "arch"           "t2,any,any,any,a,t2,any,any,any,any,any,any")]
*************** (define_insn "*movdf_vfp"
*** 460,466 ****
  			      (const_int 4)))
     (set_attr "predicable" "yes")
     (set_attr "pool_range" "*,*,*,1020,*,1020,*,*,*")
!    (set_attr "neg_pool_range" "*,*,*,1008,*,1008,*,*,*")]
  )
  
  (define_insn "*thumb2_movdf_vfp"
--- 460,466 ----
  			      (const_int 4)))
     (set_attr "predicable" "yes")
     (set_attr "pool_range" "*,*,*,1020,*,1020,*,*,*")
!    (set_attr "neg_pool_range" "*,*,*,1004,*,1004,*,*,*")]
  )
  
  (define_insn "*thumb2_movdf_vfp"
*** gcc/config/arm/.svn/text-base/fpa.md.svn-base	Wed Aug 24 13:39:04 2011
--- gcc/config/arm/fpa.md	Thu Nov 17 11:52:38 2011
*************** (define_insn "*thumb2_movdf_fpa"
*** 671,677 ****
     (set_attr "type"
      "load1,store2,*,store2,load1,ffarith,ffarith,f_fpa_load,f_fpa_store,r_mem_f,f_mem_r")
     (set_attr "pool_range" "*,*,*,*,4092,*,*,1024,*,*,*")
!    (set_attr "neg_pool_range" "*,*,*,*,0,*,*,1020,*,*,*")]
  )
  
  ;; Saving and restoring the floating point registers in the prologue should
--- 671,677 ----
     (set_attr "type"
      "load1,store2,*,store2,load1,ffarith,ffarith,f_fpa_load,f_fpa_store,r_mem_f,f_mem_r")
     (set_attr "pool_range" "*,*,*,*,4092,*,*,1024,*,*,*")
!    (set_attr "neg_pool_range" "*,*,*,*,0,*,*,1008,*,*,*")]
  )
  
  ;; Saving and restoring the floating point registers in the prologue should