src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java

Print this page




  24 
  25 import static jdk.vm.ci.inittimer.InitTimer.timer;
  26 
  27 import java.util.EnumSet;
  28 
  29 import jdk.vm.ci.amd64.AMD64;
  30 import jdk.vm.ci.code.Architecture;
  31 import jdk.vm.ci.code.RegisterConfig;
  32 import jdk.vm.ci.code.TargetDescription;
  33 import jdk.vm.ci.code.stack.StackIntrospection;
  34 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider;
  35 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
  36 import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;
  37 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider;
  38 import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider;
  39 import jdk.vm.ci.hotspot.HotSpotStackIntrospection;
  40 import jdk.vm.ci.hotspot.HotSpotVMConfig;
  41 import jdk.vm.ci.inittimer.InitTimer;
  42 import jdk.vm.ci.meta.ConstantReflectionProvider;
  43 import jdk.vm.ci.runtime.JVMCIBackend;
  44 import jdk.vm.ci.service.ServiceProvider;
  45 
  46 @ServiceProvider(HotSpotJVMCIBackendFactory.class)
  47 public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory {
  48 
  49     protected EnumSet<AMD64.CPUFeature> computeFeatures(HotSpotVMConfig config) {
  50         // Configure the feature set using the HotSpot flag settings.
  51         EnumSet<AMD64.CPUFeature> features = EnumSet.noneOf(AMD64.CPUFeature.class);
  52         if ((config.vmVersionFeatures & config.amd643DNOWPREFETCH) != 0) {
  53             features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH);
  54         }
  55         assert config.useSSE >= 2 : "minimum config for x64";
  56         features.add(AMD64.CPUFeature.SSE);
  57         features.add(AMD64.CPUFeature.SSE2);
  58         if ((config.vmVersionFeatures & config.amd64SSE3) != 0) {
  59             features.add(AMD64.CPUFeature.SSE3);
  60         }
  61         if ((config.vmVersionFeatures & config.amd64SSSE3) != 0) {
  62             features.add(AMD64.CPUFeature.SSSE3);
  63         }
  64         if ((config.vmVersionFeatures & config.amd64SSE4A) != 0) {
  65             features.add(AMD64.CPUFeature.SSE4A);
  66         }




  24 
  25 import static jdk.vm.ci.inittimer.InitTimer.timer;
  26 
  27 import java.util.EnumSet;
  28 
  29 import jdk.vm.ci.amd64.AMD64;
  30 import jdk.vm.ci.code.Architecture;
  31 import jdk.vm.ci.code.RegisterConfig;
  32 import jdk.vm.ci.code.TargetDescription;
  33 import jdk.vm.ci.code.stack.StackIntrospection;
  34 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider;
  35 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
  36 import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;
  37 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider;
  38 import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider;
  39 import jdk.vm.ci.hotspot.HotSpotStackIntrospection;
  40 import jdk.vm.ci.hotspot.HotSpotVMConfig;
  41 import jdk.vm.ci.inittimer.InitTimer;
  42 import jdk.vm.ci.meta.ConstantReflectionProvider;
  43 import jdk.vm.ci.runtime.JVMCIBackend;

  44 

  45 public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory {
  46 
  47     protected EnumSet<AMD64.CPUFeature> computeFeatures(HotSpotVMConfig config) {
  48         // Configure the feature set using the HotSpot flag settings.
  49         EnumSet<AMD64.CPUFeature> features = EnumSet.noneOf(AMD64.CPUFeature.class);
  50         if ((config.vmVersionFeatures & config.amd643DNOWPREFETCH) != 0) {
  51             features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH);
  52         }
  53         assert config.useSSE >= 2 : "minimum config for x64";
  54         features.add(AMD64.CPUFeature.SSE);
  55         features.add(AMD64.CPUFeature.SSE2);
  56         if ((config.vmVersionFeatures & config.amd64SSE3) != 0) {
  57             features.add(AMD64.CPUFeature.SSE3);
  58         }
  59         if ((config.vmVersionFeatures & config.amd64SSSE3) != 0) {
  60             features.add(AMD64.CPUFeature.SSSE3);
  61         }
  62         if ((config.vmVersionFeatures & config.amd64SSE4A) != 0) {
  63             features.add(AMD64.CPUFeature.SSE4A);
  64         }