Wed, 29 Mar 2017 09:41:51 +0800
#4662 TieredCompilation is turned off.
TieredCompilation is not supported yet.
aoqi@1 | 1 | /* |
aoqi@1 | 2 | * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
aoqi@1 | 3 | * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. |
aoqi@1 | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@1 | 5 | * |
aoqi@1 | 6 | * This code is free software; you can redistribute it and/or modify it |
aoqi@1 | 7 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@1 | 8 | * published by the Free Software Foundation. |
aoqi@1 | 9 | * |
aoqi@1 | 10 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@1 | 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@1 | 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@1 | 13 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@1 | 14 | * accompanied this code). |
aoqi@1 | 15 | * |
aoqi@1 | 16 | * You should have received a copy of the GNU General Public License version |
aoqi@1 | 17 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@1 | 18 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@1 | 19 | * |
aoqi@1 | 20 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@1 | 21 | * or visit www.oracle.com if you need additional information or have any |
aoqi@1 | 22 | * questions. |
aoqi@1 | 23 | * |
aoqi@1 | 24 | */ |
aoqi@1 | 25 | |
aoqi@1 | 26 | #ifndef CPU_MIPS_VM_VM_VERSION_MIPS_HPP |
aoqi@1 | 27 | #define CPU_MIPS_VM_VM_VERSION_MIPS_HPP |
chenhaoxuan@358 | 28 | |
aoqi@1 | 29 | #include "runtime/globals_extension.hpp" |
aoqi@1 | 30 | #include "runtime/vm_version.hpp" |
aoqi@1 | 31 | |
aoqi@1 | 32 | |
aoqi@1 | 33 | class VM_Version: public Abstract_VM_Version { |
aoqi@1 | 34 | protected: |
chenhaoxuan@358 | 35 | enum Feature_Flag { |
chenhaoxuan@358 | 36 | with_l2_cache = 0, |
chenhaoxuan@358 | 37 | spt_16k_page = 1, |
chenhaoxuan@358 | 38 | gs464v = 2, |
chenhaoxuan@358 | 39 | gs464e = 3, |
chenhaoxuan@358 | 40 | gs464 = 4, |
chenhaoxuan@358 | 41 | with_gs_support = 5, |
chenhaoxuan@358 | 42 | //////////////////////add some other feature here////////////////// |
chenhaoxuan@358 | 43 | }; |
aoqi@1 | 44 | |
chenhaoxuan@358 | 45 | enum Feature_Flag_Set { |
chenhaoxuan@358 | 46 | unknown_m = 0, |
chenhaoxuan@358 | 47 | all_features_m = -1, |
chenhaoxuan@358 | 48 | with_l2_cache_m = 1 << with_l2_cache, |
chenhaoxuan@358 | 49 | spt_16k_page_m = 1 << spt_16k_page, |
chenhaoxuan@358 | 50 | with_gs_support_m = 1 << with_gs_support, |
chenhaoxuan@358 | 51 | gs464_m = 1 << gs464, |
chenhaoxuan@358 | 52 | gs464v_m = 1 << gs464v, |
chenhaoxuan@358 | 53 | gs464e_m = 1 << gs464e, |
aoqi@1 | 54 | |
chenhaoxuan@358 | 55 | //////////////////////add some other feature here////////////////// |
chenhaoxuan@358 | 56 | }; |
aoqi@1 | 57 | |
chenhaoxuan@358 | 58 | static int _features; |
chenhaoxuan@358 | 59 | static const char* _features_str; |
chenhaoxuan@358 | 60 | |
chenhaoxuan@358 | 61 | static void print_features(); |
chenhaoxuan@358 | 62 | static int determine_features(); |
chenhaoxuan@358 | 63 | static int platform_features(int features); |
aoqi@1 | 64 | |
aoqi@1 | 65 | public: |
chenhaoxuan@358 | 66 | // Initialization |
chenhaoxuan@358 | 67 | static void initialize(); |
aoqi@1 | 68 | |
chenhaoxuan@358 | 69 | //mips has no such instructions, use ll/sc instead |
chenhaoxuan@358 | 70 | static bool supports_compare_and_exchange() { return false; } |
chenhaoxuan@358 | 71 | |
chenhaoxuan@358 | 72 | static bool has_l2_cache() { return _features & with_l2_cache_m; } |
chenhaoxuan@358 | 73 | static bool has_16k_page() { return _features & spt_16k_page_m; } |
chenhaoxuan@358 | 74 | static bool is_gs464() { return _features & gs464_m; } |
chenhaoxuan@358 | 75 | static bool is_gs464v() { return _features & gs464v_m; } |
chenhaoxuan@358 | 76 | static bool is_gs464e() { return _features & gs464e_m; } |
chenhaoxuan@358 | 77 | static bool is_loongson() { return _features & with_gs_support_m; } |
chenhaoxuan@358 | 78 | static bool support_dsp() { return _features & gs464e_m; } |
aoqi@209 | 79 | static bool supports_ps() { return 1; /*Loongson CPUs support ps instructions*/} |
aoqi@209 | 80 | static bool supports_3d() { return 0; /*Loongson CPUs do not support 3d instructions*/} |
aoqi@1 | 81 | |
chenhaoxuan@358 | 82 | //////////////////////add some other feature here////////////////// |
chenhaoxuan@358 | 83 | |
chenhaoxuan@358 | 84 | static const char* cpu_features() { return _features_str; } |
chenhaoxuan@358 | 85 | |
chenhaoxuan@358 | 86 | // Assembler testing |
chenhaoxuan@358 | 87 | static void allow_all(); |
chenhaoxuan@358 | 88 | static void revert(); |
aoqi@1 | 89 | }; |
aoqi@1 | 90 | |
aoqi@1 | 91 | #endif // CPU_MIPS_VM_VM_VERSION_MIPS_HPP |