aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--slang_rs_export_element_support.inc3
-rw-r--r--slang_rs_export_type.cpp15
-rw-r--r--slang_rs_export_type.hpp2
-rw-r--r--slang_rs_export_type_support.inc27
-rw-r--r--slang_rs_reflection.cpp23
5 files changed, 44 insertions, 26 deletions
diff --git a/slang_rs_export_element_support.inc b/slang_rs_export_element_support.inc
index 7de388a..fbd89d2 100644
--- a/slang_rs_export_element_support.inc
+++ b/slang_rs_export_element_support.inc
@@ -7,6 +7,7 @@
# define ELEMENT_DATA_TYPE_SIGNED_8 RSExportPrimitiveType::DataTypeSigned8
# define ELEMENT_DATA_TYPE_SIGNED_16 RSExportPrimitiveType::DataTypeSigned16
# define ELEMENT_DATA_TYPE_SIGNED_32 RSExportPrimitiveType::DataTypeSigned32
+# define ELEMENT_DATA_TYPE_SIGNED_64 RSExportPrimitiveType::DataTypeSigned64
# define ELEMENT_DATA_TYPE_UNSIGNED_8 RSExportPrimitiveType::DataTypeUnsigned8
# define ELEMENT_DATA_TYPE_UNSIGNED_16 RSExportPrimitiveType::DataTypeUnsigned16
# define ELEMENT_DATA_TYPE_UNSIGNED_32 RSExportPrimitiveType::DataTypeUnsigned32
@@ -113,6 +114,7 @@
DEF_PRIMITIVE_DATA_TYPE(SIGNED_8, "char")
DEF_PRIMITIVE_DATA_TYPE(SIGNED_16, "short")
DEF_PRIMITIVE_DATA_TYPE(SIGNED_32, "int")
+ DEF_PRIMITIVE_DATA_TYPE(SIGNED_64, "long")
DEF_PRIMITIVE_DATA_TYPE(UNSIGNED_8, "uchar")
DEF_PRIMITIVE_DATA_TYPE(UNSIGNED_16, "ushort")
DEF_PRIMITIVE_DATA_TYPE(UNSIGNED_32, "uint")
@@ -157,6 +159,7 @@
# undef ELEMENT_DATA_TYPE_SIGNED_8
# undef ELEMENT_DATA_TYPE_SIGNED_16
# undef ELEMENT_DATA_TYPE_SIGNED_32
+# undef ELEMENT_DATA_TYPE_SIGNED_64
# undef ELEMENT_DATA_TYPE_UNSIGNED_8
# undef ELEMENT_DATA_TYPE_UNSIGNED_16
# undef ELEMENT_DATA_TYPE_UNSIGNED_32
diff --git a/slang_rs_export_type.cpp b/slang_rs_export_type.cpp
index 70179d6..c3b452e 100644
--- a/slang_rs_export_type.cpp
+++ b/slang_rs_export_type.cpp
@@ -64,8 +64,9 @@ llvm::StringRef RSExportType::GetTypeName(const Type* T) {
else if(type == RSExportPrimitiveType::DataTypeSigned8) return "char"; \
else if(type == RSExportPrimitiveType::DataTypeSigned16) return "short"; \
else if(type == RSExportPrimitiveType::DataTypeSigned32) return "int"; \
+ else if(type == RSExportPrimitiveType::DataTypeSigned64) return "long"; \
else if(type == RSExportPrimitiveType::DataTypeBool) return "bool"; \
- else assert(false && "Unknow data type of supported builtin"); \
+ else assert(false && "Unknown data type of supported builtin"); \
break;
#include "slang_rs_export_type_support.inc"
@@ -522,6 +523,11 @@ const llvm::Type* RSExportPrimitiveType::convertToLLVMType() const {
return llvm::Type::getInt32Ty(C);
break;
+ case DataTypeSigned64:
+ // case DataTypeUnsigned64:
+ return llvm::Type::getInt64Ty(C);
+ break;
+
case DataTypeBool:
return llvm::Type::getInt1Ty(C);
break;
@@ -635,6 +641,11 @@ const llvm::Type* RSExportConstantArrayType::convertToLLVMType() const {
typ = llvm::Type::getInt32Ty(C);
break;
+ case DataTypeSigned64:
+ //case DataTypeUnsigned64:
+ typ = llvm::Type::getInt64Ty(C);
+ break;
+
case DataTypeBool:
typ = llvm::Type::getInt1Ty(C);
break;
@@ -656,6 +667,7 @@ const char* RSExportVectorType::VectorTypeNameStore[][3] = {
/* 5 */ { "uint2", "uint3", "uint4" },
/* 6 */ { "float2", "float3", "float4" },
/* 7 */ { "double2", "double3", "double4" },
+ /* 8 */ { "long2", "long3", "long4" },
};
llvm::StringRef RSExportVectorType::GetTypeName(const ExtVectorType* EVT) {
@@ -679,6 +691,7 @@ llvm::StringRef RSExportVectorType::GetTypeName(const ExtVectorType* EVT) {
else if(type == RSExportPrimitiveType::DataTypeUnsigned32) BaseElement = VectorTypeNameStore[5]; \
else if(type == RSExportPrimitiveType::DataTypeFloat32) BaseElement = VectorTypeNameStore[6]; \
else if(type == RSExportPrimitiveType::DataTypeFloat64) BaseElement = VectorTypeNameStore[7]; \
+ else if(type == RSExportPrimitiveType::DataTypeSigned64) BaseElement = VectorTypeNameStore[8]; \
else if(type == RSExportPrimitiveType::DataTypeBool) BaseElement = VectorTypeNameStore[0]; \
break;
#include "slang_rs_export_type_support.inc"
diff --git a/slang_rs_export_type.hpp b/slang_rs_export_type.hpp
index 9711c21..9ccd9b9 100644
--- a/slang_rs_export_type.hpp
+++ b/slang_rs_export_type.hpp
@@ -115,7 +115,7 @@ public:
DataTypeSigned8 = 4,
DataTypeSigned16 = 5,
DataTypeSigned32 = 6,
- //DataTypeSigned64 = 7,
+ DataTypeSigned64 = 7,
DataTypeUnsigned8 = 8,
DataTypeUnsigned16 = 9,
DataTypeUnsigned32 = 10,
diff --git a/slang_rs_export_type_support.inc b/slang_rs_export_type_support.inc
index e640d44..0b354fb 100644
--- a/slang_rs_export_type_support.inc
+++ b/slang_rs_export_type_support.inc
@@ -1,18 +1,19 @@
/* SLANG_RS_SUPPORT_BUILTIN_TYPE(builtin_type, bits, type) */
#ifdef SLANG_RS_SUPPORT_BUILTIN_TYPE
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Char_U, RSExportPrimitiveType::DataTypeUnsigned8)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::UChar, RSExportPrimitiveType::DataTypeUnsigned8)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Char_S, RSExportPrimitiveType::DataTypeSigned8)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::SChar, RSExportPrimitiveType::DataTypeSigned8)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Char16, RSExportPrimitiveType::DataTypeSigned16)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::UShort, RSExportPrimitiveType::DataTypeUnsigned16)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Short, RSExportPrimitiveType::DataTypeSigned16)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Char32, RSExportPrimitiveType::DataTypeSigned32)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::UInt, RSExportPrimitiveType::DataTypeUnsigned32)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Int, RSExportPrimitiveType::DataTypeSigned32)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Float, RSExportPrimitiveType::DataTypeFloat32)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Double, RSExportPrimitiveType::DataTypeFloat64)
- SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Bool, RSExportPrimitiveType::DataTypeBool)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Char_U, RSExportPrimitiveType::DataTypeUnsigned8)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::UChar, RSExportPrimitiveType::DataTypeUnsigned8)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Char_S, RSExportPrimitiveType::DataTypeSigned8)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::SChar, RSExportPrimitiveType::DataTypeSigned8)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Char16, RSExportPrimitiveType::DataTypeSigned16)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::UShort, RSExportPrimitiveType::DataTypeUnsigned16)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Short, RSExportPrimitiveType::DataTypeSigned16)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Char32, RSExportPrimitiveType::DataTypeSigned32)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::UInt, RSExportPrimitiveType::DataTypeUnsigned32)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Int, RSExportPrimitiveType::DataTypeSigned32)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::LongLong, RSExportPrimitiveType::DataTypeSigned64)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Float, RSExportPrimitiveType::DataTypeFloat32)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Double, RSExportPrimitiveType::DataTypeFloat64)
+ SLANG_RS_SUPPORT_BUILTIN_TYPE(BuiltinType::Bool, RSExportPrimitiveType::DataTypeBool)
# undef SLANG_RS_SUPPORT_BUILTIN_TYPE
#endif
diff --git a/slang_rs_reflection.cpp b/slang_rs_reflection.cpp
index 9cf4224..c763b86 100644
--- a/slang_rs_reflection.cpp
+++ b/slang_rs_reflection.cpp
@@ -121,6 +121,7 @@ static const char* GetVectorTypeName(const RSExportVectorType* EVT) {
BaseElement = VectorTypeJavaNameMap[2];
break;
+ case RSExportPrimitiveType::DataTypeSigned64:
case RSExportPrimitiveType::DataTypeUnsigned32:
BaseElement = VectorTypeJavaNameMap[3];
break;
@@ -242,16 +243,16 @@ static const char* GetBuiltinElementConstruct(const RSExportType* ET) {
static const char* PrimitiveBuiltinElementConstructMap[] = {
NULL,
NULL,
- "F32", /* RSExportPrimitiveType::DataTypeFloat32 */
- "F64", /* RSExportPrimitiveType::DataTypeFloat64 */
- "I8", /* RSExportPrimitiveType::DataTypeSigned8 */
- NULL, /* RSExportPrimitiveType::DataTypeSigned16 */
- "I32", /* RSExportPrimitiveType::DataTypeSigned32 */
- NULL, /* RSExportPrimitiveType::DataTypeSigned64 */
- "U8", /* RSExportPrimitiveType::DataTypeUnsigned8 */
- NULL, /* RSExportPrimitiveType::DataTypeUnsigned16 */
- "U32", /* RSExportPrimitiveType::DataTypeUnsigned32 */
- NULL, /* RSExportPrimitiveType::DataTypeUnsigned64 */
+ "F32", /* RSExportPrimitiveType::DataTypeFloat32 */
+ "F64", /* RSExportPrimitiveType::DataTypeFloat64 */
+ "I8", /* RSExportPrimitiveType::DataTypeSigned8 */
+ NULL, /* RSExportPrimitiveType::DataTypeSigned16 */
+ "I32", /* RSExportPrimitiveType::DataTypeSigned32 */
+ "I64", /* RSExportPrimitiveType::DataTypeSigned64 */
+ "U8", /* RSExportPrimitiveType::DataTypeUnsigned8 */
+ NULL, /* RSExportPrimitiveType::DataTypeUnsigned16 */
+ "U32", /* RSExportPrimitiveType::DataTypeUnsigned32 */
+ NULL, /* RSExportPrimitiveType::DataTypeUnsigned64 */
NULL, /* RSExportPrimitiveType::DataTypeUnsigned565 */
NULL, /* RSExportPrimitiveType::DataTypeUnsigned5551 */
@@ -363,7 +364,7 @@ static const char* GetElementDataTypeName(RSExportPrimitiveType::DataType DT) {
"Element.DataType.SIGNED_8", /* RSExportPrimitiveType::DataTypeSigned8 */
"Element.DataType.SIGNED_16", /* RSExportPrimitiveType::DataTypeSigned16 */
"Element.DataType.SIGNED_32", /* RSExportPrimitiveType::DataTypeSigned32 */
- NULL, /* RSExportPrimitiveType::DataTypeSigned64 */
+ "Element.DataType.SIGNED_64", /* RSExportPrimitiveType::DataTypeSigned64 */
"Element.DataType.UNSIGNED_8", /* RSExportPrimitiveType::DataTypeUnsigned8 */
"Element.DataType.UNSIGNED_16", /* RSExportPrimitiveType::DataTypeUnsigned16 */
"Element.DataType.UNSIGNED_32", /* RSExportPrimitiveType::DataTypeUnsigned32 */