RFR: 8341527: AVX-512 intrinsic for SHA3 [v4]

Ferenc Rakoczi duke at openjdk.org
Wed Oct 16 16:09:14 UTC 2024


On Tue, 15 Oct 2024 22:56:56 GMT, Volodymyr Paprotski <duke at openjdk.org> wrote:

> If you still have it and it can be 'made clean'.. I would love to see some of that 'scaffolding test code' kept for the final commit. (I like to imagine the 'final code cleanup' as 'removing **scaffolding** from a construction site' :) ) This will be especially useful if (when?) we revisit the intrinsic. (I can already see us also needing an AVX2 version.. someone will need to re-learn how to verify that intrinsic too)

The scaffolding is really simple: instead of e.g.

@IntrinsiCandidate
void foo(byte[] output, byte[] input) {
  // do some computation
}

you would have

void foo(byte[] output, byte[] input) {
   byte[] inputCopy = input.clone();
   int x = fooImpl(output, input);
   if (x==0) {
    // it was the intrinsic, so e.g. call fooImplJava() on imputCopy and compare the result
  }
}

@IntrinsicCandidate
int fooImpl(byte[] output, byte[] input) {
  fooImplJava(input, output);
  return 1;
}

void fooImplJava(byte[] output, byte[] input) {
  // do some computation
}

Just a bit more complicated for non-void methods.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/21352#issuecomment-2417277788


More information about the hotspot-dev mailing list