< prev index next >

test/hotspot/jtreg/compiler/intrinsics/sha/sanity/DigestSanityTestBase.java

Print this page
rev 60737 : 8252204: AArch64: Implement SHA3 accelerator/intrinsic
Reviewed-by: duke
Contributed-by: dongbo4@huawei.com


  28 import sun.hotspot.WhiteBox;
  29 
  30 import java.io.FileOutputStream;
  31 import java.io.IOException;
  32 import java.util.Objects;
  33 import java.util.Properties;
  34 import java.util.function.BooleanSupplier;
  35 
  36 /**
  37  * Base class for sanity tests on SHA intrinsics support.
  38  */
  39 public class DigestSanityTestBase {
  40     protected static final String MD5_INTRINSIC_ID
  41             = "_md5_implCompress";
  42     protected static final String SHA1_INTRINSIC_ID
  43             = "_sha_implCompress";
  44     protected static final String SHA256_INTRINSIC_ID
  45             = "_sha2_implCompress";
  46     protected static final String SHA512_INTRINSIC_ID
  47             = "_sha5_implCompress";


  48     protected static final String MB_INTRINSIC_ID
  49             = "_digestBase_implCompressMB";
  50 
  51     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
  52     private static final int MSG_SIZE = 1024;
  53     private static final int OFFSET = 0;
  54     private static final int ITERATIONS = 10000;
  55     private static final int WARMUP_ITERATIONS = 1;
  56     private static final String PROVIDER = "SUN";
  57 
  58     private final BooleanSupplier predicate;
  59     private final String intrinsicID;
  60 
  61     /**
  62      * Construct the new test on intrinsic with ID {@code intrinsicID},
  63      * which is expected to be emitted if {@code predicate} is evaluated to
  64      * {@code true}.
  65      *
  66      * @param predicate The predicate indicating if the intrinsic is expected to
  67      *                  be used.




  28 import sun.hotspot.WhiteBox;
  29 
  30 import java.io.FileOutputStream;
  31 import java.io.IOException;
  32 import java.util.Objects;
  33 import java.util.Properties;
  34 import java.util.function.BooleanSupplier;
  35 
  36 /**
  37  * Base class for sanity tests on SHA intrinsics support.
  38  */
  39 public class DigestSanityTestBase {
  40     protected static final String MD5_INTRINSIC_ID
  41             = "_md5_implCompress";
  42     protected static final String SHA1_INTRINSIC_ID
  43             = "_sha_implCompress";
  44     protected static final String SHA256_INTRINSIC_ID
  45             = "_sha2_implCompress";
  46     protected static final String SHA512_INTRINSIC_ID
  47             = "_sha5_implCompress";
  48     protected static final String SHA3_INTRINSIC_ID
  49             = "_sha3_implCompress";
  50     protected static final String MB_INTRINSIC_ID
  51             = "_digestBase_implCompressMB";
  52 
  53     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
  54     private static final int MSG_SIZE = 1024;
  55     private static final int OFFSET = 0;
  56     private static final int ITERATIONS = 10000;
  57     private static final int WARMUP_ITERATIONS = 1;
  58     private static final String PROVIDER = "SUN";
  59 
  60     private final BooleanSupplier predicate;
  61     private final String intrinsicID;
  62 
  63     /**
  64      * Construct the new test on intrinsic with ID {@code intrinsicID},
  65      * which is expected to be emitted if {@code predicate} is evaluated to
  66      * {@code true}.
  67      *
  68      * @param predicate The predicate indicating if the intrinsic is expected to
  69      *                  be used.


< prev index next >