On Mon, 28 Mar 2022 07:40:48 GMT, Jie Fu <ji...@openjdk.org> wrote: >> The compiler can get the real type info from `Op_NegVI` that can also handle >> the `BYTE ` and `SHORT ` basic type. I just don't want to add more new IRs >> which also need more match rules in the ad files. >> >>> Is there any performance drop for byte/short negation operation if both of >>> them are handled as a NegVI vector? >> >> From the benchmark results I showed in the commit message, I didn't see not >> any performance drop for byte/short. Thanks! > >> The compiler can get the real type info from `Op_NegVI` that can also handle >> the `BYTE ` and `SHORT ` basic type. I just don't want to add more new IRs >> which also need more match rules in the ad files. >> >> > Is there any performance drop for byte/short negation operation if both of >> > them are handled as a NegVI vector? >> >> From the benchmark results I showed in the commit message, I didn't see not >> any performance drop for byte/short. Thanks! > > There seems no vectorized negation instructions for {byte, short, int, long} > on x86, so this should be fine on x86. > I tested the patch on x86 and the performance number looks good.
Thanks for doing this! Yeah, I think the performance for masked negation operations might improve on non avx-512 systems. ------------- PR: https://git.openjdk.java.net/jdk/pull/7782