[vector] binary operations with a scalar
Vladimir Ivanov
vladimir.x.ivanov at oracle.com
Tue Feb 20 21:26:14 UTC 2018
>
> I like this but suggest we keep the code marginally simpler and revisit if we have performance concerns. If we don’t make intrinsic the broadcast+op combination i think something like this is probably ok for now:
>
> @Override
> @ForceInline
> public Int256Vector add(int o) {
> return add(Int256Species.broadcastImpl(o));
> }
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.
Best regards,
Vladimir Ivanov
More information about the panama-dev
mailing list