[vector] binary operations with a scalar

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Feb 21 12:06:16 UTC 2018


>> If we don't care about optimized default implementation, then even simpler variant should work:
>>
>>      @Override
>>      @ForceInline
>>      public Int256Vector add(int i) {
>>          return add(species().broadcast(i));
>>      }
>>
>> add(), species(), and broadcast() methdos are trivially inlined since the new method is declared in concrete vector class.
>>
> 
> Ah! so a call to say species() is problematic if we are at the abstract level, say IntVector?

Yes, there's only a single Int256Vector::species() (Int256Vector is a 
leaf class), but IntVector::species() has many overloads. Depending on 
compilation context (and profile data), it can be hard to devirtualize 
(and then inline) the call.

Best regards,
Vladimir Ivanov


More information about the panama-dev mailing list