[Beignet] [Printf v2][PATCH 05/12] Add tuple processing logic for printf.
yan.wang at linux.intel.com
yan.wang at linux.intel.com
Sun Jan 31 23:39:50 PST 2016
From: Yan Wang <yan.wang at linux.intel.com>
Contributor: Junyan He <junyan.he at linux.intel.com>
Signed-off-by: Yan Wang <yan.wang at linux.intel.com>
---
backend/src/ir/context.hpp | 5 +++++
backend/src/ir/function.hpp | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/backend/src/ir/context.hpp b/backend/src/ir/context.hpp
index b95741f..877d639 100644
--- a/backend/src/ir/context.hpp
+++ b/backend/src/ir/context.hpp
@@ -149,6 +149,11 @@ namespace ir {
GBE_ASSERTM(fn != NULL, "No function currently defined");
return fn->file.appendArrayTuple(reg, regNum);
}
+ /*! Make a tuple from an array of types */
+ INLINE Tuple arrayTypeTuple(const ir::Type *type, uint32_t num) {
+ GBE_ASSERTM(fn != NULL, "No function currently defined");
+ return fn->file.appendArrayTypeTuple((uint8_t*)type, num);
+ }
/*! We just use variadic templates to forward instruction functions */
#define DECL_INSN(NAME, FAMILY) \
template <typename... Args> INLINE void NAME(Args...args);
diff --git a/backend/src/ir/function.hpp b/backend/src/ir/function.hpp
index 78250cf..5785bee 100644
--- a/backend/src/ir/function.hpp
+++ b/backend/src/ir/function.hpp
@@ -341,6 +341,14 @@ namespace ir {
INLINE void setRegister(Tuple ID, uint32_t which, Register reg) {
file.set(ID, which, reg);
}
+ /*! Get the type from the tuple vector */
+ INLINE uint8_t getType(Tuple ID, uint32_t which) const {
+ return file.getType(ID, which);
+ }
+ /*! Set the type into the tuple vector */
+ INLINE void setType(Tuple ID, uint32_t which, uint8_t type) {
+ file.setType(ID, which, type);
+ }
/*! Get the register file */
INLINE const RegisterFile &getRegisterFile(void) const { return file; }
/*! Get the given value ie immediate from the function */
--
2.4.3
More information about the Beignet
mailing list