src/cpu/ppc/vm/vm_version_ppc.cpp

changeset 8608
0d78aecb0948
parent 7424
c5e86c5cd22e
child 8856
ac27a9c85bea
child 8903
9575483cce09
     1.1 --- a/src/cpu/ppc/vm/vm_version_ppc.cpp	Fri Aug 05 10:47:35 2016 +0000
     1.2 +++ b/src/cpu/ppc/vm/vm_version_ppc.cpp	Wed Aug 10 14:59:21 2016 +0200
     1.3 @@ -102,7 +102,7 @@
     1.4    // Create and print feature-string.
     1.5    char buf[(num_features+1) * 16]; // Max 16 chars per feature.
     1.6    jio_snprintf(buf, sizeof(buf),
     1.7 -               "ppc64%s%s%s%s%s%s%s%s",
     1.8 +               "ppc64%s%s%s%s%s%s%s%s%s",
     1.9                 (has_fsqrt()   ? " fsqrt"   : ""),
    1.10                 (has_isel()    ? " isel"    : ""),
    1.11                 (has_lxarxeh() ? " lxarxeh" : ""),
    1.12 @@ -111,7 +111,8 @@
    1.13                 (has_popcntb() ? " popcntb" : ""),
    1.14                 (has_popcntw() ? " popcntw" : ""),
    1.15                 (has_fcfids()  ? " fcfids"  : ""),
    1.16 -               (has_vand()    ? " vand"    : "")
    1.17 +               (has_vand()    ? " vand"    : ""),
    1.18 +               (has_vcipher() ? " aes"     : "")
    1.19                 // Make sure number of %s matches num_features!
    1.20                );
    1.21    _features_str = strdup(buf);
    1.22 @@ -156,6 +157,28 @@
    1.23    }
    1.24  
    1.25    // The AES intrinsic stubs require AES instruction support.
    1.26 +#if defined(VM_LITTLE_ENDIAN)
    1.27 +  if (has_vcipher()) {
    1.28 +    if (FLAG_IS_DEFAULT(UseAES)) {
    1.29 +      UseAES = true;
    1.30 +    }
    1.31 +  } else if (UseAES) {
    1.32 +    if (!FLAG_IS_DEFAULT(UseAES))
    1.33 +      warning("AES instructions are not available on this CPU");
    1.34 +    FLAG_SET_DEFAULT(UseAES, false);
    1.35 +  }
    1.36 +
    1.37 +  if (UseAES && has_vcipher()) {
    1.38 +    if (FLAG_IS_DEFAULT(UseAESIntrinsics)) {
    1.39 +      UseAESIntrinsics = true;
    1.40 +    }
    1.41 +  } else if (UseAESIntrinsics) {
    1.42 +    if (!FLAG_IS_DEFAULT(UseAESIntrinsics))
    1.43 +      warning("AES intrinsics are not available on this CPU");
    1.44 +    FLAG_SET_DEFAULT(UseAESIntrinsics, false);
    1.45 +  }
    1.46 +
    1.47 +#else
    1.48    if (UseAES) {
    1.49      warning("AES instructions are not available on this CPU");
    1.50      FLAG_SET_DEFAULT(UseAES, false);
    1.51 @@ -165,6 +188,7 @@
    1.52        warning("AES intrinsics are not available on this CPU");
    1.53      FLAG_SET_DEFAULT(UseAESIntrinsics, false);
    1.54    }
    1.55 +#endif
    1.56  
    1.57    if (UseSHA) {
    1.58      warning("SHA instructions are not available on this CPU");
    1.59 @@ -452,6 +476,7 @@
    1.60    a->popcntw(R7, R5);                          // code[7] -> popcntw
    1.61    a->fcfids(F3, F4);                           // code[8] -> fcfids
    1.62    a->vand(VR0, VR0, VR0);                      // code[9] -> vand
    1.63 +  a->vcipher(VR0, VR1, VR2);                   // code[10] -> vcipher
    1.64    a->blr();
    1.65  
    1.66    // Emit function to set one cache line to zero. Emit function descriptor and get pointer to it.
    1.67 @@ -495,6 +520,7 @@
    1.68    if (code[feature_cntr++]) features |= popcntw_m;
    1.69    if (code[feature_cntr++]) features |= fcfids_m;
    1.70    if (code[feature_cntr++]) features |= vand_m;
    1.71 +  if (code[feature_cntr++]) features |= vcipher_m;
    1.72  
    1.73    // Print the detection code.
    1.74    if (PrintAssembly) {

mercurial