cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

riza_guntur
Journeyman III

How to do 5-way mad using Brook+

Is it possible, then how to?

I see in Beyond3D they bench using 5-way mad so off course the performance improved 20 percent

0 Likes
4 Replies
gaurav_garg
Adept I

Compiler tries to use all 5-units as much as possible. One main problem with code generation in Brook+ IL is that a mad instruction in Brook+ doesn't generate mad in ISA.

One way to resolve this problem is to change all mul_ieee instructions to mul in IL generated by brcc. Of course, if you want to tune your code further to maximize 5-way usage, you can hand-tune the IL.

0 Likes

Can you provide an example?

It is a fine topic btw

0 Likes

I have a question regard this. If I change MUL_IEEE to a MUL instruction the compiler generates MAD instructions. However acording to the RV770 ISA there are two MAD instructions, one for MULADD and one for MULADD_IEEE. Why doesn't the IL compiler generates MULADD_IEEE instructions when MUL_IEEE is used?

Also, using double precision Brook+ generates DMUL and DADD instructions, but then the IL compiler doesn't fuse them into MULADD_64. Is this normal? Is there any workaround?

0 Likes
eduardoschardong
Journeyman III

You could always edit the generated IL, I changed the HLSL library to do it, I have to go now, but if you search in this forum you will find a better description of how to do it.

 

0 Likes