Added missing file
authorBenjamin Segovia <segovia.benjamin@gmail.com>
Tue, 21 Feb 2012 05:39:29 +0000 (05:39 +0000)
committerKeith Packard <keithp@keithp.com>
Fri, 10 Aug 2012 23:15:24 +0000 (16:15 -0700)
backend/src/ir/type.cpp [new file with mode: 0644]

diff --git a/backend/src/ir/type.cpp b/backend/src/ir/type.cpp
new file mode 100644 (file)
index 0000000..0de58da
--- /dev/null
@@ -0,0 +1,49 @@
+/* 
+ * Copyright © 2012 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Benjamin Segovia <benjamin.segovia@intel.com>
+ */
+
+/**
+ * \file instruction.cpp
+ * \author Benjamin Segovia <benjamin.segovia@intel.com>
+ */
+
+#include "ir/type.hpp"
+
+namespace gbe {
+namespace ir {
+  std::ostream &operator<< (std::ostream &out, const Type &type) {
+    switch (type) {
+      case TYPE_BOOL: return out << "bool";
+      case TYPE_S8: return out << "int8";
+      case TYPE_U8: return out << "uin8";
+      case TYPE_S16: return out << "int16";
+      case TYPE_U16: return out << "uin16";
+      case TYPE_S32: return out << "int32";
+      case TYPE_U32: return out << "uin32";
+      case TYPE_S64: return out << "int64";
+      case TYPE_U64: return out << "uin64";
+      case TYPE_HALF: return out << "half";
+      case TYPE_FLOAT: return out << "float";
+      case TYPE_DOUBLE: return out << "double";
+    };
+    return out;
+  }
+
+} /* namespace ir */
+} /* namespace gbe */
+