1094 int argcnt = num_args; 1095 const Type** fields = TypeTuple::fields(argcnt); 1096 int argp = TypeFunc::Parms; 1097 fields[argp++] = TypePtr::NOTNULL; // a 1098 fields[argp++] = TypePtr::NOTNULL; // n 1099 fields[argp++] = TypeInt::INT; // len 1100 fields[argp++] = TypeLong::LONG; // inv 1101 fields[argp++] = Type::HALF; 1102 fields[argp++] = TypePtr::NOTNULL; // result 1103 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); 1104 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); 1105 1106 // result type needed 1107 fields = TypeTuple::fields(1); 1108 fields[TypeFunc::Parms+0] = TypePtr::NOTNULL; 1109 1110 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); 1111 return TypeFunc::make(domain, range); 1112 } 1113 1114 const TypeFunc* OptoRuntime::vectorizedMismatch_Type() { 1115 // create input type (domain) 1116 int num_args = 4; 1117 int argcnt = num_args; 1118 const Type** fields = TypeTuple::fields(argcnt); 1119 int argp = TypeFunc::Parms; 1120 fields[argp++] = TypePtr::NOTNULL; // obja 1121 fields[argp++] = TypePtr::NOTNULL; // objb 1122 fields[argp++] = TypeInt::INT; // length, number of elements 1123 fields[argp++] = TypeInt::INT; // log2scale, element size 1124 assert(argp == TypeFunc::Parms + argcnt, "correct decoding"); 1125 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + argcnt, fields); 1126 1127 //return mismatch index (int) 1128 fields = TypeTuple::fields(1); 1129 fields[TypeFunc::Parms + 0] = TypeInt::INT; 1130 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms + 1, fields); 1131 return TypeFunc::make(domain, range); 1132 } 1133 | 1094 int argcnt = num_args; 1095 const Type** fields = TypeTuple::fields(argcnt); 1096 int argp = TypeFunc::Parms; 1097 fields[argp++] = TypePtr::NOTNULL; // a 1098 fields[argp++] = TypePtr::NOTNULL; // n 1099 fields[argp++] = TypeInt::INT; // len 1100 fields[argp++] = TypeLong::LONG; // inv 1101 fields[argp++] = Type::HALF; 1102 fields[argp++] = TypePtr::NOTNULL; // result 1103 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); 1104 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); 1105 1106 // result type needed 1107 fields = TypeTuple::fields(1); 1108 fields[TypeFunc::Parms+0] = TypePtr::NOTNULL; 1109 1110 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); 1111 return TypeFunc::make(domain, range); 1112 } 1113 1114 const TypeFunc * OptoRuntime::bigIntegerShift_Type() { 1115 int argcnt = 5; 1116 const Type** fields = TypeTuple::fields(argcnt); 1117 int argp = TypeFunc::Parms; 1118 fields[argp++] = TypePtr::NOTNULL; // newArr 1119 fields[argp++] = TypePtr::NOTNULL; // oldArr 1120 fields[argp++] = TypeInt::INT; // newIdx 1121 fields[argp++] = TypeInt::INT; // shiftCount 1122 fields[argp++] = TypeInt::INT; // numIter 1123 assert(argp == TypeFunc::Parms + argcnt, "correct decoding"); 1124 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + argcnt, fields); 1125 1126 // no result type needed 1127 fields = TypeTuple::fields(1); 1128 fields[TypeFunc::Parms + 0] = NULL; 1129 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); 1130 return TypeFunc::make(domain, range); 1131 } 1132 1133 const TypeFunc* OptoRuntime::vectorizedMismatch_Type() { 1134 // create input type (domain) 1135 int num_args = 4; 1136 int argcnt = num_args; 1137 const Type** fields = TypeTuple::fields(argcnt); 1138 int argp = TypeFunc::Parms; 1139 fields[argp++] = TypePtr::NOTNULL; // obja 1140 fields[argp++] = TypePtr::NOTNULL; // objb 1141 fields[argp++] = TypeInt::INT; // length, number of elements 1142 fields[argp++] = TypeInt::INT; // log2scale, element size 1143 assert(argp == TypeFunc::Parms + argcnt, "correct decoding"); 1144 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + argcnt, fields); 1145 1146 //return mismatch index (int) 1147 fields = TypeTuple::fields(1); 1148 fields[TypeFunc::Parms + 0] = TypeInt::INT; 1149 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms + 1, fields); 1150 return TypeFunc::make(domain, range); 1151 } 1152 |