aboutsummaryrefslogtreecommitdiff
path: root/include/tcg/tcg.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/tcg/tcg.h')
-rw-r--r--include/tcg/tcg.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index f2da340bb9..8bcd60d0ed 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -320,6 +320,22 @@ typedef enum TCGType {
} TCGType;
/**
+ * tcg_type_size
+ * @t: type
+ *
+ * Return the size of the type in bytes.
+ */
+static inline int tcg_type_size(TCGType t)
+{
+ unsigned i = t;
+ if (i >= TCG_TYPE_V64) {
+ tcg_debug_assert(i < TCG_TYPE_COUNT);
+ i -= TCG_TYPE_V64 - 1;
+ }
+ return 4 << i;
+}
+
+/**
* get_alignment_bits
* @memop: MemOp value
*