From: Yan Wang <[email protected]>
Contributor: Junyan He <[email protected]>
Signed-off-by: Yan Wang <[email protected]>
---
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
_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet