对GCC pipeline description的疑惑

22 views
Skip to first unread message

彭建章

unread,
Oct 23, 2009, 3:35:29 AM10/23/09
to hell...@googlegroups.com
大家好,在理解pipeline description的时候有几个疑惑:
1,
在internal手册 16.19.8 Specifying processor pipeline description有一个例子

Integer division and multiplication insns can be executed only in the second integer
pipeline and their results are ready correspondingly in 8 and 4
cycles. The integer division is not pipelined, i.e. the subsequent
integer division insn can not be issued until the current division
insn finished.

(define_insn_reservation "div" 8 (eq_attr "type" "div")
"i1_pipeline, div*7, div + (port0 | port1)")

我的理解是
(define_insn_reservation "div" 8 (eq_attr "type" "div")
"(i1_pipeline+div)*7, div + (port0 | port1)")

应该在做除法的时候不允许,别的指令上pipeline。


2,latency 和 reservation不等怎么理解?

Eric Fisher

unread,
Oct 23, 2009, 3:55:25 AM10/23/09
to hell...@googlegroups.com
我会去掉div和port的定义,直接为

(define_insn_reservation "div" 8 (eq_attr "type" "div")

"i1_pipeline*8")
不知道是否合适。

比如乘法,latency为4,但是指令是流水的,我会定义为

(define_insn_reservation "mult" 4 (eq_attr "type" "mult")
"i1_pipeline")

邢明杰

2009/10/23 彭建章 <pengji...@gmail.com>:

Amker.Cheng

unread,
Oct 23, 2009, 4:01:20 AM10/23/09
to hell...@googlegroups.com
>>
>> 2,latency 和 reservation不等怎么理解?
>>
>>
是否能这样理解
latency是指令本身流水特征,在多少个cycles后ok;
reservation则是指令对流水线部件的使用情况,在哪些cycle需要占用哪些resources。

--
Best Regards.

Amker.Cheng

unread,
Oct 23, 2009, 4:04:40 AM10/23/09
to hell...@googlegroups.com
(define_insn_reservation "div" 8 (eq_attr "type" "div")
"i1_pipeline, div*7, div + (port0 | port1)")

我的理解是
(define_insn_reservation "div" 8 (eq_attr "type" "div")

"(i1_pipeline+div)*7, div + (port0 | port1)")

这两个表示应该不等价,
前者指div指令没有流水,而后者指div指令和其它integer指令也不能流水,限制更强吧。
是否如此?


--
Best Regards.

Eric Fisher

unread,
Oct 23, 2009, 4:11:07 AM10/23/09
to hell...@googlegroups.com
unit应该用来描述相应的功能部件,这样比较好理解些。

如果处理器的功能部件有四个:alu0,alu1,falu,mem。就不需要定义div功能部件。如果另有一个单独的div功能部件,就应该按照文档上的那个例子来描述。

2009/10/23 Amker.Cheng <amker...@gmail.com>:

彭建章

unread,
Oct 23, 2009, 4:20:39 AM10/23/09
to hell...@googlegroups.com
谢谢大家

2009/10/23 Eric Fisher <joefo...@gmail.com>
Reply all
Reply to author
Forward
0 new messages