diff mbox

[1/2] mips: Add R4600 scheduling support for imul and idiv

Message ID 1330141994-26174-1-git-send-email-mattst88@gmail.com
State New
Headers show

Commit Message

Matt Turner Feb. 25, 2012, 3:53 a.m. UTC
The r4600_imul and r4600_idiv reservations were correct for si, but
there were no *_di reservations.

See page 4 of
http://www.sgistuff.net/hardware/other/documents/R4600_Prod_OV.pdf

2012-02-24  Matt Turner  <mattst88@gmail.com>

	* config/mips/4600.md (r4600_imul_si): Rename from r4600_imul.
	(r4600_imul_di): New.
	(r4600_idiv_si): Rename from r4600_idiv.
	(r4600_idiv_di): New.
---
 gcc/config/mips/4600.md |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

Comments

Richard Sandiford Feb. 25, 2012, 8:11 a.m. UTC | #1
Matt Turner <mattst88@gmail.com> writes:
> The r4600_imul and r4600_idiv reservations were correct for si, but
> there were no *_di reservations.
>
> See page 4 of
> http://www.sgistuff.net/hardware/other/documents/R4600_Prod_OV.pdf
>
> 2012-02-24  Matt Turner  <mattst88@gmail.com>
>
> 	* config/mips/4600.md (r4600_imul_si): Rename from r4600_imul.
> 	(r4600_imul_di): New.
> 	(r4600_idiv_si): Rename from r4600_idiv.
> 	(r4600_idiv_di): New.

Both patches look good, thanks.  Will commit once 4.8 is open and the
copyright assignment is sorted.

Richard
Matt Turner May 28, 2012, 9:56 p.m. UTC | #2
On Sat, Feb 25, 2012 at 3:11 AM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> Matt Turner <mattst88@gmail.com> writes:
>> The r4600_imul and r4600_idiv reservations were correct for si, but
>> there were no *_di reservations.
>>
>> See page 4 of
>> http://www.sgistuff.net/hardware/other/documents/R4600_Prod_OV.pdf
>>
>> 2012-02-24  Matt Turner  <mattst88@gmail.com>
>>
>>       * config/mips/4600.md (r4600_imul_si): Rename from r4600_imul.
>>       (r4600_imul_di): New.
>>       (r4600_idiv_si): Rename from r4600_idiv.
>>       (r4600_idiv_di): New.
>
> Both patches look good, thanks.  Will commit once 4.8 is open and the
> copyright assignment is sorted.
>
> Richard

Copyright assignment is sorted. Please commit. :)
Richard Sandiford May 31, 2012, 9:35 p.m. UTC | #3
Matt Turner <mattst88@gmail.com> writes:
> On Sat, Feb 25, 2012 at 3:11 AM, Richard Sandiford
> <rdsandiford@googlemail.com> wrote:
>> Matt Turner <mattst88@gmail.com> writes:
>>> The r4600_imul and r4600_idiv reservations were correct for si, but
>>> there were no *_di reservations.
>>>
>>> See page 4 of
>>> http://www.sgistuff.net/hardware/other/documents/R4600_Prod_OV.pdf
>>>
>>> 2012-02-24  Matt Turner  <mattst88@gmail.com>
>>>
>>>       * config/mips/4600.md (r4600_imul_si): Rename from r4600_imul.
>>>       (r4600_imul_di): New.
>>>       (r4600_idiv_si): Rename from r4600_idiv.
>>>       (r4600_idiv_di): New.
>>
>> Both patches look good, thanks.  Will commit once 4.8 is open and the
>> copyright assignment is sorted.
>>
>> Richard
>
> Copyright assignment is sorted. Please commit. :)

Applied this one.  Part 2 seems to be based on a different version
of driver-native.c though.

Thanks for perservering. :-)

Richard
Matt Turner May 31, 2012, 10:47 p.m. UTC | #4
On Thu, May 31, 2012 at 5:35 PM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> Matt Turner <mattst88@gmail.com> writes:
>> On Sat, Feb 25, 2012 at 3:11 AM, Richard Sandiford
>> <rdsandiford@googlemail.com> wrote:
>>> Matt Turner <mattst88@gmail.com> writes:
>>>> The r4600_imul and r4600_idiv reservations were correct for si, but
>>>> there were no *_di reservations.
>>>>
>>>> See page 4 of
>>>> http://www.sgistuff.net/hardware/other/documents/R4600_Prod_OV.pdf
>>>>
>>>> 2012-02-24  Matt Turner  <mattst88@gmail.com>
>>>>
>>>>       * config/mips/4600.md (r4600_imul_si): Rename from r4600_imul.
>>>>       (r4600_imul_di): New.
>>>>       (r4600_idiv_si): Rename from r4600_idiv.
>>>>       (r4600_idiv_di): New.
>>>
>>> Both patches look good, thanks.  Will commit once 4.8 is open and the
>>> copyright assignment is sorted.
>>>
>>> Richard
>>
>> Copyright assignment is sorted. Please commit. :)
>
> Applied this one.  Part 2 seems to be based on a different version
> of driver-native.c though.
>
> Thanks for perservering. :-)
>
> Richard

Thanks a lot!

Ah, right, 2/2 was written before IRIX support was removed and changed
driver-native.c significantly.

Updated patch in your inbox shortly.

Thanks!
Matt
diff mbox

Patch

diff --git a/gcc/config/mips/4600.md b/gcc/config/mips/4600.md
index c645cbc..fcdbf00 100644
--- a/gcc/config/mips/4600.md
+++ b/gcc/config/mips/4600.md
@@ -1,5 +1,5 @@ 
 ;; R4600 and R4650 pipeline description.
-;;   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+;;   Copyright (C) 2004, 2005, 2007, 2012 Free Software Foundation, Inc.
 ;;
 ;; This file is part of GCC.
 
@@ -24,16 +24,30 @@ 
 ;; We handle the R4600 and R4650 in much the same way.  The only difference
 ;; is in the integer multiplication and division costs.
 
-(define_insn_reservation "r4600_imul" 10
+(define_insn_reservation "r4600_imul_si" 10
   (and (eq_attr "cpu" "r4600")
-       (eq_attr "type" "imul,imul3,imadd"))
+       (eq_attr "type" "imul,imul3,imadd")
+       (eq_attr "mode" "SI"))
   "imuldiv*10")
 
-(define_insn_reservation "r4600_idiv" 42
+(define_insn_reservation "r4600_imul_di" 12
   (and (eq_attr "cpu" "r4600")
-       (eq_attr "type" "idiv"))
+       (eq_attr "type" "imul,imul3,imadd")
+       (eq_attr "mode" "DI"))
+  "imuldiv*12")
+
+(define_insn_reservation "r4600_idiv_si" 42
+  (and (eq_attr "cpu" "r4600")
+       (eq_attr "type" "idiv")
+       (eq_attr "mode" "SI"))
   "imuldiv*42")
 
+(define_insn_reservation "r4600_idiv_di" 74
+  (and (eq_attr "cpu" "r4600")
+       (eq_attr "type" "idiv")
+       (eq_attr "mode" "DI"))
+  "imuldiv*74")
+
 
 (define_insn_reservation "r4650_imul" 4
   (and (eq_attr "cpu" "r4650")