Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: runtime/platform/globals.h

Issue 12207117: SSE Assembler and Disassembler support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review fixes Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/assembler_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/globals.h
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 0e352c647eadaaf81687d99fa5a9805f57f9538e..176246e9de500987b422a0c5427e153014ce20f0 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -79,15 +79,47 @@
#if defined(_M_X64) || defined(__x86_64__)
#define HOST_ARCH_X64 1
#define ARCH_IS_64_BIT 1
+#include <xmmintrin.h> // NOLINT
+#define kFpuRegisterSize 16
+typedef __m128 fpu_register_t;
+typedef __m128 simd_value_t;
+// Unaligned load.
+#define simd_value_safe_load(addr) \
+ _mm_loadu_ps(reinterpret_cast<const float*>(addr))
+// Unaligned store.
+#define simd_value_safe_store(addr, value) \
+ _mm_storeu_ps(reinterpret_cast<float*>(addr), value)
#elif defined(_M_IX86) || defined(__i386__)
#define HOST_ARCH_IA32 1
#define ARCH_IS_32_BIT 1
+#include <xmmintrin.h> // NOLINT
+#define kFpuRegisterSize 16
+typedef __m128 fpu_register_t;
+typedef __m128 simd_value_t;
+// Unaligned load.
+#define simd_value_safe_load(addr) \
+ _mm_loadu_ps(reinterpret_cast<const float*>(addr))
+// Unaligned store.
+#define simd_value_safe_store(addr, value) \
+ _mm_storeu_ps(reinterpret_cast<float*>(addr), value)
#elif defined(__ARMEL__)
#define HOST_ARCH_ARM 1
#define ARCH_IS_32_BIT 1
+#define kFpuRegisterSize 8
+typedef double fpu_register_t;
+// TODO(johnmccutchan): ARM simd type.
+typedef struct {
+ uint32_t data_[4];
+} simd_value_t;
#elif defined(__MIPSEL__)
#define HOST_ARCH_MIPS 1
#define ARCH_IS_32_BIT 1
+#define kFpuRegisterSize 8
+typedef double fpu_register_t;
+// TODO(johnmccutchan): MIPS simd type.
+typedef struct {
+ uint32_t data_[4];
+} simd_value_t;
#else
#error Architecture was not detected as supported by Dart.
#endif
@@ -169,7 +201,8 @@ typedef uintptr_t uword;
// Byte sizes.
const int kWordSize = sizeof(word);
const int kDoubleSize = sizeof(double); // NOLINT
-const int kFloatSize = sizeof(float); // NOLINT
+const int kFloatSize = sizeof(float); // NOLINT
+const int kSimd128Size = 16;
#ifdef ARCH_IS_32_BIT
const int kWordSizeLog2 = 2;
const uword kUwordMax = kMaxUint32;
« no previous file with comments | « no previous file | runtime/vm/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698