ppc.h (991B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 /* compile-time and runtime tests for whether to use Power ISA-specific 6 extensions */ 7 8 #ifndef mozilla_ppc_h_ 9 #define mozilla_ppc_h_ 10 11 // for definition of MFBT_DATA 12 #include "mozilla/Types.h" 13 14 namespace mozilla { 15 namespace ppc_private { 16 extern bool MFBT_DATA vmx_enabled; 17 extern bool MFBT_DATA vsx_enabled; 18 extern bool MFBT_DATA vsx3_enabled; 19 } // namespace ppc_private 20 21 inline bool supports_vmx() { 22 #ifdef __powerpc__ 23 return ppc_private::vmx_enabled; 24 #else 25 return false; 26 #endif 27 } 28 29 inline bool supports_vsx() { 30 #ifdef __powerpc__ 31 return ppc_private::vsx_enabled; 32 #else 33 return false; 34 #endif 35 } 36 37 inline bool supports_vsx3() { 38 #ifdef __powerpc__ 39 return ppc_private::vsx3_enabled; 40 #else 41 return false; 42 #endif 43 } 44 45 } // namespace mozilla 46 47 #endif /* !defined(mozilla_ppc_h_) */