5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 package jdk.vm.ci.hotspot.amd64; 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 } | 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 package jdk.vm.ci.hotspot.amd64; 24 25 import static jdk.vm.ci.common.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.common.InitTimer; 35 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; 36 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; 37 import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory; 38 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; 39 import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; 40 import jdk.vm.ci.hotspot.HotSpotStackIntrospection; 41 import jdk.vm.ci.hotspot.HotSpotVMConfig; 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 } |