]> gcc.gnu.org Git - gcc.git/commitdiff
Currently the SBFM, UBFM and BFM instructions all use the attribute "bfm".
authorWilco Dijkstra <wdijkstr@arm.com>
Mon, 14 Nov 2016 12:04:11 +0000 (12:04 +0000)
committerWilco Dijkstra <wilco@gcc.gnu.org>
Mon, 14 Nov 2016 12:04:11 +0000 (12:04 +0000)
SBFM and UBFM include all shifts on AArch64, which are simpler than bitfield
insert.  Add a new bfx attribute for these instructions so that they can be
modelled more accurately in the future.  There is no difference in code
generation.

* config/aarch64/aarch64.md (aarch64_ashl_sisd_or_int_<mode>3)
Use bfx attribute.
(aarch64_lshr_sisd_or_int_<mode>3): Likewise.
(aarch64_ashr_sisd_or_int_<mode>3): Likewise.
(<optab>si3_insn_uxtw): Likewise.
(<optab><mode>3_insn): Likewise.
(<ANY_EXTEND:optab><GPI:mode>_ashl<SHORT:mode>): Likewise.
(zero_extend<GPI:mode>_lshr<SHORT:mode>): Likewise.
(extend<GPI:mode>_ashr<SHORT:mode>): Likewise.
(<optab><mode>): Likewise.
(insv<mode>): Likewise.
(andim_ashift<mode>_bfiz): Likewise.
* config/aarch64/thunderx.md (thunderx_shift): Add bfx.
* config/arm/cortex-a53.md (cortex_a53_alu_shift): Likewise.
* config/arm/cortex-a57.md (cortex_a57_alu): Add bfx.
* config/arm/exynos-m1.md (exynos_m1_alu): Add bfx.
(exynos_m1_alu_p): Likewise.
* config/arm/types.md: Add bfx.
* config/arm/xgene1.md (xgene1_bfm): Add bfx.

From-SVN: r242384

gcc/ChangeLog
gcc/config/aarch64/aarch64.md
gcc/config/aarch64/thunderx.md
gcc/config/arm/cortex-a53.md
gcc/config/arm/cortex-a57.md
gcc/config/arm/exynos-m1.md
gcc/config/arm/types.md
gcc/config/arm/xgene1.md

index b3967a245dea075e7dfa7dd55625c83512ecf110..07173ab54e88fb0f2b8ee7ea33f8cb4190e09018 100644 (file)
@@ -1,3 +1,25 @@
+2016-11-14  Wilco Dijkstra  <wdijkstr@arm.com>
+
+       * config/aarch64/aarch64.md (aarch64_ashl_sisd_or_int_<mode>3)
+       Use bfx attribute.
+       (aarch64_lshr_sisd_or_int_<mode>3): Likewise.
+       (aarch64_ashr_sisd_or_int_<mode>3): Likewise.
+       (<optab>si3_insn_uxtw): Likewise.
+       (<optab><mode>3_insn): Likewise.
+       (<ANY_EXTEND:optab><GPI:mode>_ashl<SHORT:mode>): Likewise.
+       (zero_extend<GPI:mode>_lshr<SHORT:mode>): Likewise.
+       (extend<GPI:mode>_ashr<SHORT:mode>): Likewise.
+       (<optab><mode>): Likewise.
+       (insv<mode>): Likewise.
+       (andim_ashift<mode>_bfiz): Likewise.
+       * config/aarch64/thunderx.md (thunderx_shift): Add bfx.
+       * config/arm/cortex-a53.md (cortex_a53_alu_shift): Likewise.
+       * config/arm/cortex-a57.md (cortex_a57_alu): Add bfx.
+       * config/arm/exynos-m1.md (exynos_m1_alu): Add bfx.
+       (exynos_m1_alu_p): Likewise.
+       * config/arm/types.md: Add bfx.
+       * config/arm/xgene1.md (xgene1_bfm): Add bfx.
+
 2016-11-14  Wilco Dijkstra  <wdijkstr@arm.com>
 
        * config/aarch64/aarch64.c (cortexa57_vector_cost):
index 46eaa30b1593444279ea495eb19a926e9b78702b..a652a7c12bd051f638fcd280ba6be220b047bf4b 100644 (file)
    shl\t%<rtn>0<vas>, %<rtn>1<vas>, %2
    ushl\t%<rtn>0<vas>, %<rtn>1<vas>, %<rtn>2<vas>"
   [(set_attr "simd" "no,no,yes,yes")
-   (set_attr "type" "bfm,shift_reg,neon_shift_imm<q>, neon_shift_reg<q>")]
+   (set_attr "type" "bfx,shift_reg,neon_shift_imm<q>, neon_shift_reg<q>")]
 )
 
 ;; Logical right shift using SISD or Integer instruction
    #
    #"
   [(set_attr "simd" "no,no,yes,yes,yes")
-   (set_attr "type" "bfm,shift_reg,neon_shift_imm<q>,neon_shift_reg<q>,neon_shift_reg<q>")]
+   (set_attr "type" "bfx,shift_reg,neon_shift_imm<q>,neon_shift_reg<q>,neon_shift_reg<q>")]
 )
 
 (define_split
    #
    #"
   [(set_attr "simd" "no,no,yes,yes,yes")
-   (set_attr "type" "bfm,shift_reg,neon_shift_imm<q>,neon_shift_reg<q>,neon_shift_reg<q>")]
+   (set_attr "type" "bfx,shift_reg,neon_shift_imm<q>,neon_shift_reg<q>,neon_shift_reg<q>")]
 )
 
 (define_split
   "@
    <shift>\\t%w0, %w1, %2
    <shift>\\t%w0, %w1, %w2"
-  [(set_attr "type" "bfm,shift_reg")]
+  [(set_attr "type" "bfx,shift_reg")]
 )
 
 (define_insn "*<optab><mode>3_insn"
   operands[3] = GEN_INT (<sizen> - UINTVAL (operands[2]));
   return "<bfshift>\t%w0, %w1, %2, %3";
 }
-  [(set_attr "type" "bfm")]
+  [(set_attr "type" "bfx")]
 )
 
 (define_insn "*extr<mode>5_insn"
   operands[3] = GEN_INT (<SHORT:sizen> - UINTVAL (operands[2]));
   return "<su>bfiz\t%<GPI:w>0, %<GPI:w>1, %2, %3";
 }
-  [(set_attr "type" "bfm")]
+  [(set_attr "type" "bfx")]
 )
 
 (define_insn "*zero_extend<GPI:mode>_lshr<SHORT:mode>"
   operands[3] = GEN_INT (<SHORT:sizen> - UINTVAL (operands[2]));
   return "ubfx\t%<GPI:w>0, %<GPI:w>1, %2, %3";
 }
-  [(set_attr "type" "bfm")]
+  [(set_attr "type" "bfx")]
 )
 
 (define_insn "*extend<GPI:mode>_ashr<SHORT:mode>"
   operands[3] = GEN_INT (<SHORT:sizen> - UINTVAL (operands[2]));
   return "sbfx\\t%<GPI:w>0, %<GPI:w>1, %2, %3";
 }
-  [(set_attr "type" "bfm")]
+  [(set_attr "type" "bfx")]
 )
 
 ;; -------------------------------------------------------------------
   "IN_RANGE (INTVAL (operands[2]) + INTVAL (operands[3]),
             1, GET_MODE_BITSIZE (<MODE>mode) - 1)"
   "<su>bfx\\t%<w>0, %<w>1, %3, %2"
-  [(set_attr "type" "bfm")]
+  [(set_attr "type" "bfx")]
 )
 
 ;; Bitfield Insert (insv)
              : GEN_INT (<GPI:sizen> - UINTVAL (operands[2]));
   return "<su>bfiz\t%<GPI:w>0, %<GPI:w>1, %2, %3";
 }
-  [(set_attr "type" "bfm")]
+  [(set_attr "type" "bfx")]
 )
 
 ;; XXX We should match (any_extend (ashift)) here, like (and (ashift)) below
                 (match_operand 3 "const_int_operand" "n")))]
   "aarch64_mask_and_shift_for_ubfiz_p (<MODE>mode, operands[3], operands[2])"
   "ubfiz\\t%<w>0, %<w>1, %2, %P3"
-  [(set_attr "type" "bfm")]
+  [(set_attr "type" "bfx")]
 )
 
 (define_insn "bswap<mode>2"
index 058713a2ad98a364d36a3faaf0e93c39cb89adbc..7c1c28b0498cfe0129e3f0de7e29e31536fe421a 100644 (file)
@@ -39,7 +39,7 @@
 
 (define_insn_reservation "thunderx_shift" 1
   (and (eq_attr "tune" "thunderx")
-       (eq_attr "type" "bfm,extend,rotate_imm,shift_imm,shift_reg,rbit,rev"))
+       (eq_attr "type" "bfm,bfx,extend,rotate_imm,shift_imm,shift_reg,rbit,rev"))
   "thunderx_pipe0 | thunderx_pipe1")
 
 
index 70c0f4daabe0ccb8e32808f1af51f5460e087a18..eb6d0b04976aaf441dd95cc43d02918226e75387 100644 (file)
@@ -93,7 +93,7 @@
   (and (eq_attr "tune" "cortexa53")
        (eq_attr "type" "alu_shift_imm,alus_shift_imm,
                        crc,logic_shift_imm,logics_shift_imm,
-                       alu_ext,alus_ext,bfm,extend,mvn_shift"))
+                       alu_ext,alus_ext,bfm,bfx,extend,mvn_shift"))
   "cortex_a53_slot_any")
 
 (define_insn_reservation "cortex_a53_alu_shift_reg" 3
index 85b18e5970f6cbb4f11e76d7f461a9a548fc7ce2..da461846baa5b28ce3d9c9f731dbfd7becb31a85 100644 (file)
        (eq_attr "type" "alu_imm,alus_imm,logic_imm,logics_imm,\
                        alu_sreg,alus_sreg,logic_reg,logics_reg,\
                        adc_imm,adcs_imm,adc_reg,adcs_reg,\
-                       adr,bfm,clz,csel,rbit,rev,alu_dsp_reg,\
+                       adr,bfm,bfx,clz,rbit,rev,alu_dsp_reg,\
                        rotate_imm,shift_imm,shift_reg,\
                        mov_imm,mov_reg,\
                        mvn_imm,mvn_reg,\
index 318b151d64697001d0082295e54486a2ffcaa6e5..00574d7930f23c36005648cddca285405ced8a8c 100644 (file)
            (eq_attr "type" "alu_imm, alus_imm, logic_imm, logics_imm,\
                             alu_sreg, alus_sreg, logic_reg, logics_reg,\
                             adc_imm, adcs_imm, adc_reg, adcs_reg,\
-                            adr, bfm, clz, rbit, rev, csel, alu_dsp_reg,\
+                            adr, bfm, bfx, clz, rbit, rev, csel, alu_dsp_reg,\
                             shift_imm, shift_reg, rotate_imm, extend,\
                             mov_imm, mov_reg,\
                             mvn_imm, mvn_reg,\
            (eq_attr "type" "alu_imm, alus_imm, logic_imm, logics_imm,\
                             alu_sreg, alus_sreg, logic_reg, logics_reg,\
                             adc_imm, adcs_imm, adc_reg, adcs_reg,\
-                            adr, bfm, clz, rbit, rev, alu_dsp_reg,\
+                            adr, bfm, bfx, clz, rbit, rev, alu_dsp_reg,\
                             shift_imm, shift_reg, rotate_imm, extend,\
                             mov_imm, mov_reg,\
                             mvn_imm, mvn_reg,\
index 25f79b4d010ae24c14d97d9fead93db1eff42f32..7a95a3704d0907fcaf42463c5803cbff82b29fa1 100644 (file)
@@ -51,6 +51,7 @@
 ; alus_shift_imm     as alu_shift_imm, setting condition flags.
 ; alus_shift_reg     as alu_shift_reg, setting condition flags.
 ; bfm                bitfield move operation.
+; bfx                bitfield extract operation.
 ; block              blockage insn, this blocks all functional units.
 ; branch             branch.
 ; call               subroutine call.
   alus_shift_imm,\
   alus_shift_reg,\
   bfm,\
+  bfx,\
   block,\
   branch,\
   call,\
index b7aeac6916353f9a02b56821e3df3c2f43fc2946..4f27b28461f23aff6720cd1ba54c46fa9ae574ce 100644 (file)
 
 (define_insn_reservation "xgene1_bfm" 2
   (and (eq_attr "tune" "xgene1")
-       (eq_attr "type" "bfm"))
+       (eq_attr "type" "bfm,bfx"))
   "xgene1_decode1op,xgene1_fsu")
 
 (define_insn_reservation "xgene1_f_rint" 5
This page took 0.095336 seconds and 5 git commands to generate.