aboutsummaryrefslogtreecommitdiff
path: root/disas/libvixl/a64/cpu-a64.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-08-29 15:00:27 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-08-29 15:00:27 +0100
commit508280f5666a706a3681462b2a1d7de8107fd6fb (patch)
tree8ac95cc1b77048afcaad49c350e734bc145e31dd /disas/libvixl/a64/cpu-a64.h
parentd9aa68855724752a5684c6acfb17d8db15cec2f8 (diff)
disas/libvixl: Update to upstream VIXL 1.5
Update our copy of libvixl to upstream's 1.5 release. This includes the upstream versions of the fixes we were carrying locally (commit ffebe899). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1407162987-4659-1-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'disas/libvixl/a64/cpu-a64.h')
-rw-r--r--disas/libvixl/a64/cpu-a64.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/disas/libvixl/a64/cpu-a64.h b/disas/libvixl/a64/cpu-a64.h
index dfd8f015cf..59b7974a19 100644
--- a/disas/libvixl/a64/cpu-a64.h
+++ b/disas/libvixl/a64/cpu-a64.h
@@ -28,6 +28,7 @@
#define VIXL_CPU_A64_H
#include "globals.h"
+#include "instructions-a64.h"
namespace vixl {
@@ -42,6 +43,32 @@ class CPU {
// safely run.
static void EnsureIAndDCacheCoherency(void *address, size_t length);
+ // Handle tagged pointers.
+ template <typename T>
+ static T SetPointerTag(T pointer, uint64_t tag) {
+ VIXL_ASSERT(is_uintn(kAddressTagWidth, tag));
+
+ // Use C-style casts to get static_cast behaviour for integral types (T),
+ // and reinterpret_cast behaviour for other types.
+
+ uint64_t raw = (uint64_t)pointer;
+ VIXL_STATIC_ASSERT(sizeof(pointer) == sizeof(raw));
+
+ raw = (raw & ~kAddressTagMask) | (tag << kAddressTagOffset);
+ return (T)raw;
+ }
+
+ template <typename T>
+ static uint64_t GetPointerTag(T pointer) {
+ // Use C-style casts to get static_cast behaviour for integral types (T),
+ // and reinterpret_cast behaviour for other types.
+
+ uint64_t raw = (uint64_t)pointer;
+ VIXL_STATIC_ASSERT(sizeof(pointer) == sizeof(raw));
+
+ return (raw & kAddressTagMask) >> kAddressTagOffset;
+ }
+
private:
// Return the content of the cache type register.
static uint32_t GetCacheType();