Support for gcc vector attributes, SIMD builtins

Brad Roberts braddr at puremagic.com
Sun Feb 6 15:09:49 PST 2011


On 2/6/2011 2:58 PM, Iain Buclaw wrote:
> == Quote from Brad Roberts (braddr at puremagic.com)'s article
>> I'd be happy to have gcc finding vectorization opportunities, but there's no
> need to add this sort of thing to the
>> language.  This already has a hook to call a library function:
>> float[4] a = [1,2,3,4], b = [5,6,7,8], c;
>> c[] = a[] + b[];
> 
> Aye, and 9 times out of 10 I would agree with this thinking also.
> 
> The pros to hashing out GCC Vector intrinsics to the D frontend though are that
> the GCC backend has much more creative control over the codegen. Inlining and
> optimising the intrinsics in a far better way than optimising the overhead of an
> external library call.
> 
> Baring in mind that DMD's array libraries are already extremely performant anyway,
> I honestly don't see the harm if it makes the poignant speed freaks happy.
> 
> Regards

The harm that I'd like to minimize (preferably avoid) is compiler specific language changes.  When GDC or LDC or DMD add
little things to the language that aren't supported by all three, the choice of compilers used to build a chunk of code
is reduced.  The result is a fragmentation of the language.

I agree that gcc's inliner and optimizers are way better than dmd's when it comes to vectors (among other things), and
would love to see those brought to bear.

So, imho, try not to go any higher than the glue layer.

Later,
Brad


More information about the D.gnu mailing list