This is the mail archive of the gcc-patches@gcc.gnu.org mailing 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]

Re: [patch] Add DFA-based pipeline descriptions for MIPS 24K core.


Here we go again..... 

This patch adds support for the MIPS 24K processor family.

The new attrib "cnv_mode" is introduced to catch the different float/int
conversions, which have different delays.

David.


2005-05-04  David Ung  <davidu@mips.com>

        * config/mips/mips.h (processor_type): Add names for the 24K. 
        
        * config/mips/mips.c (mips_cpu_info_table): Add names for the 24K
        processor family.

        * config/mips/mips.md (cnv_mode): New attribute for recording the
        conversion types of float convert insns.
        (cpu): Add 24k and 24kx.
        (include): Include 24k.md file.
        ("truncdfsf2", "extendsfdf2", "fix_truncdfsi2_insn")
        ("fix_truncdfsi2_macro", "fix_truncsfsi2_insn")
        ("fix_truncsfsi2_macro", "fix_truncdfdi2", "fix_truncsfdi2")
        ("floatsidf2", "floatdidf2", "floatsisf2")
	("floatdisf2"): Setup cnv_mode.
        
        * config/mips/24k.md: New file, contains 24k DFA pipeline
        description. 

Index: config/mips/mips.c
===================================================================
RCS file: /cvs/uberbaum/gcc/config/mips/mips.c,v
retrieving revision 1.498
diff -c -3 -p -r1.498 mips.c
*** config/mips/mips.c  26 Apr 2005 17:55:23 -0000      1.498
--- config/mips/mips.c  4 May 2005 17:04:23 -0000
*************** const struct mips_cpu_info mips_cpu_info
*** 700,705 ****
--- 700,709 ----

    /* MIPS32 Release 2 */
    { "m4k", PROCESSOR_M4K, 33 },
+   { "24k", PROCESSOR_24K, 33 },
+   { "24kc", PROCESSOR_24K, 33 },  /* 24K  no FPU */
+   { "24kf", PROCESSOR_24K, 33 },  /* 24K 1:2 FPU */
+   { "24kx", PROCESSOR_24KX, 33 }, /* 24K 1:1 FPU */

    /* MIPS64 */
    { "5kc", PROCESSOR_5KC, 64 },
Index: config/mips/mips.h
===================================================================
RCS file: /cvs/uberbaum/gcc/config/mips/mips.h,v
retrieving revision 1.390
diff -c -3 -p -r1.390 mips.h
*** config/mips/mips.h  27 Apr 2005 09:11:58 -0000      1.390
--- config/mips/mips.h  4 May 2005 17:04:23 -0000
*************** enum processor_type {
*** 36,41 ****
--- 36,43 ----
    PROCESSOR_4KC,
    PROCESSOR_5KC,
    PROCESSOR_20KC,
+   PROCESSOR_24K,
+   PROCESSOR_24KX,
    PROCESSOR_M4K,
    PROCESSOR_R3000,
    PROCESSOR_R3900,
Index: config/mips/mips.md
===================================================================
RCS file: /cvs/uberbaum/gcc/config/mips/mips.md,v
retrieving revision 1.315
diff -c -3 -p -r1.315 mips.md
*** config/mips/mips.md 13 Mar 2005 18:03:25 -0000      1.315
--- config/mips/mips.md 4 May 2005 17:04:24 -0000
***************
*** 157,162 ****
--- 157,173 ----
  (define_attr "mode" "unknown,none,QI,HI,SI,DI,SF,DF,FPSW"
    (const_string "unknown"))

+ ;; Mode for conversion types (fcvt and xfer)
+ ;; I2S          integer to float single (SI/DI to SF)
+ ;; I2D          integer to float double (SI/DI to DF)
+ ;; S2I          float to integer (SF to SI/DI)
+ ;; D2I          float to integer (DF to SI/DI)
+ ;; D2S          double to float single
+ ;; S2D          float single to double
+
+ (define_attr "cnv_mode" "unknown,I2S,I2D,S2I,D2I,D2S,S2D"
+   (const_string "unknown"))
+
  ;; Is this an extended instruction in mips16 mode?
  (define_attr "extended_mips16" "no,yes"
    (const_string "no"))
***************
*** 254,260 ****
  ;; Attribute describing the processor.  This attribute must match exactly
  ;; with the processor_type enumeration in mips.h.
  (define_attr "cpu"
!   "default,4kc,5kc,20kc,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sr71000"
    (const (symbol_ref "mips_tune")))

  ;; The type of hardware hazard associated with this instruction.
--- 265,271 ----
  ;; Attribute describing the processor.  This attribute must match exactly
  ;; with the processor_type enumeration in mips.h.
  (define_attr "cpu"
!   "default,4kc,5kc,20kc,24k,24kx,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sr71000"
    (const (symbol_ref "mips_tune")))

  ;; The type of hardware hazard associated with this instruction.
***************
*** 478,483 ****
--- 489,495 ----
  (define_cpu_unit "alu" "alu")
  (define_cpu_unit "imuldiv" "imuldiv")

+ (include "24k.md")
  (include "3000.md")
  (include "4000.md")
  (include "4100.md")
*************** beq\t%2,%.,1b\;\
*** 2130,2135 ****
--- 2142,2148 ----
    "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
    "cvt.s.d\t%0,%1"
    [(set_attr "type"   "fcvt")
+    (set_attr "cnv_mode"       "D2S")
     (set_attr "mode"   "SF")])

  ;; Integer truncation patterns.  Truncating SImode values to smaller
*************** beq\t%2,%.,1b\;\
*** 2444,2449 ****
--- 2457,2463 ----
    "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
    "cvt.d.s\t%0,%1"
    [(set_attr "type"   "fcvt")
+    (set_attr "cnv_mode"       "S2D")
     (set_attr "mode"   "DF")])


  ;;
*************** beq\t%2,%.,1b\;\
*** 2472,2477 ****
--- 2486,2492 ----
    "trunc.w.d %0,%1"
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "DF")
+    (set_attr "cnv_mode"       "D2I")
     (set_attr "length" "4")])

  (define_insn "fix_truncdfsi2_macro"
*************** beq\t%2,%.,1b\;\
*** 2487,2492 ****
--- 2502,2508 ----
  }
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "DF")
+    (set_attr "cnv_mode"       "D2I")
     (set_attr "length" "36")])

  (define_expand "fix_truncsfsi2"
*************** beq\t%2,%.,1b\;\
*** 2508,2513 ****
--- 2524,2530 ----
    "trunc.w.s %0,%1"
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "DF")
+    (set_attr "cnv_mode"       "S2I")
     (set_attr "length" "4")])

  (define_insn "fix_truncsfsi2_macro"
*************** beq\t%2,%.,1b\;\
*** 2523,2528 ****
--- 2540,2546 ----
  }
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "DF")
+    (set_attr "cnv_mode"       "S2I")
     (set_attr "length" "36")])


*************** beq\t%2,%.,1b\;\
*** 2533,2538 ****
--- 2551,2557 ----
    "trunc.l.d %0,%1"
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "DF")
+    (set_attr "cnv_mode"       "D2I")
     (set_attr "length" "4")])


*************** beq\t%2,%.,1b\;\
*** 2543,2548 ****
--- 2562,2568 ----
    "trunc.l.s %0,%1"
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "SF")
+    (set_attr "cnv_mode"       "S2I")
     (set_attr "length" "4")])


*************** beq\t%2,%.,1b\;\
*** 2553,2558 ****
--- 2573,2579 ----
    "cvt.d.w\t%0,%1"
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "DF")
+    (set_attr "cnv_mode"       "I2D")
     (set_attr "length" "4")])


*************** beq\t%2,%.,1b\;\
*** 2563,2568 ****
--- 2584,2590 ----
    "cvt.d.l\t%0,%1"
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "DF")
+    (set_attr "cnv_mode"       "I2D")
     (set_attr "length" "4")])


*************** beq\t%2,%.,1b\;\
*** 2573,2578 ****
--- 2595,2601 ----
    "cvt.s.w\t%0,%1"
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "SF")
+    (set_attr "cnv_mode"       "I2S")
     (set_attr "length" "4")])


*************** beq\t%2,%.,1b\;\
*** 2583,2588 ****
--- 2606,2612 ----
    "cvt.s.l\t%0,%1"
    [(set_attr "type"   "fcvt")
     (set_attr "mode"   "SF")
+    (set_attr "cnv_mode"       "I2S")
     (set_attr "length" "4")])

Attachment: 24k.md
Description: application/genesis-rom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]