comparison graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java @ 13351:7345e9672dc3

refactor computation of architecture features
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Mon, 16 Dec 2013 10:22:17 -0800
parents 2c3b59f34619
children eefb0224149d
comparison
equal deleted inserted replaced
13350:2c3b59f34619 13351:7345e9672dc3
35 35
36 @ServiceProvider(HotSpotBackendFactory.class) 36 @ServiceProvider(HotSpotBackendFactory.class)
37 public class AMD64HotSpotBackendFactory implements HotSpotBackendFactory { 37 public class AMD64HotSpotBackendFactory implements HotSpotBackendFactory {
38 38
39 protected Architecture createArchitecture(HotSpotVMConfig config) { 39 protected Architecture createArchitecture(HotSpotVMConfig config) {
40 return new AMD64(computeFeatures(config));
41 }
42
43 protected EnumSet<AMD64.CPUFeature> computeFeatures(HotSpotVMConfig config) {
40 // Configure the feature set using the HotSpot flag settings. 44 // Configure the feature set using the HotSpot flag settings.
41 EnumSet<AMD64.CPUFeature> features = EnumSet.noneOf(AMD64.CPUFeature.class); 45 EnumSet<AMD64.CPUFeature> features = EnumSet.noneOf(AMD64.CPUFeature.class);
42 assert config.useSSE >= 2 : "minimum config for x64"; 46 assert config.useSSE >= 2 : "minimum config for x64";
43 features.add(AMD64.CPUFeature.SSE); 47 features.add(AMD64.CPUFeature.SSE);
44 features.add(AMD64.CPUFeature.SSE2); 48 features.add(AMD64.CPUFeature.SSE2);
64 features.add(AMD64.CPUFeature.AES); 68 features.add(AMD64.CPUFeature.AES);
65 } 69 }
66 if (config.allocatePrefetchInstr == 3) { 70 if (config.allocatePrefetchInstr == 3) {
67 features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH); 71 features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH);
68 } 72 }
69 73 return features;
70 return new AMD64(features);
71 } 74 }
72 75
73 protected TargetDescription createTarget(HotSpotVMConfig config) { 76 protected TargetDescription createTarget(HotSpotVMConfig config) {
74 final int stackFrameAlignment = 16; 77 final int stackFrameAlignment = 16;
75 final int implicitNullCheckLimit = 4096; 78 final int implicitNullCheckLimit = 4096;