996 fields[TypeFunc::Parms+0] = TypeInt::INT; |
996 fields[TypeFunc::Parms+0] = TypeInt::INT; |
997 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields); |
997 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields); |
998 return TypeFunc::make(domain, range); |
998 return TypeFunc::make(domain, range); |
999 } |
999 } |
1000 |
1000 |
|
1001 const TypeFunc* OptoRuntime::montgomeryMultiply_Type() { |
|
1002 // create input type (domain) |
|
1003 int num_args = 7; |
|
1004 int argcnt = num_args; |
|
1005 const Type** fields = TypeTuple::fields(argcnt); |
|
1006 int argp = TypeFunc::Parms; |
|
1007 fields[argp++] = TypePtr::NOTNULL; // a |
|
1008 fields[argp++] = TypePtr::NOTNULL; // b |
|
1009 fields[argp++] = TypePtr::NOTNULL; // n |
|
1010 fields[argp++] = TypeInt::INT; // len |
|
1011 fields[argp++] = TypeLong::LONG; // inv |
|
1012 fields[argp++] = Type::HALF; |
|
1013 fields[argp++] = TypePtr::NOTNULL; // result |
|
1014 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); |
|
1015 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); |
|
1016 |
|
1017 // result type needed |
|
1018 fields = TypeTuple::fields(1); |
|
1019 fields[TypeFunc::Parms+0] = TypePtr::NOTNULL; |
|
1020 |
|
1021 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); |
|
1022 return TypeFunc::make(domain, range); |
|
1023 } |
|
1024 |
|
1025 const TypeFunc* OptoRuntime::montgomerySquare_Type() { |
|
1026 // create input type (domain) |
|
1027 int num_args = 6; |
|
1028 int argcnt = num_args; |
|
1029 const Type** fields = TypeTuple::fields(argcnt); |
|
1030 int argp = TypeFunc::Parms; |
|
1031 fields[argp++] = TypePtr::NOTNULL; // a |
|
1032 fields[argp++] = TypePtr::NOTNULL; // n |
|
1033 fields[argp++] = TypeInt::INT; // len |
|
1034 fields[argp++] = TypeLong::LONG; // inv |
|
1035 fields[argp++] = Type::HALF; |
|
1036 fields[argp++] = TypePtr::NOTNULL; // result |
|
1037 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); |
|
1038 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); |
|
1039 |
|
1040 // result type needed |
|
1041 fields = TypeTuple::fields(1); |
|
1042 fields[TypeFunc::Parms+0] = TypePtr::NOTNULL; |
|
1043 |
|
1044 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); |
|
1045 return TypeFunc::make(domain, range); |
|
1046 } |
1001 |
1047 |
1002 |
1048 |
1003 //------------- Interpreter state access for on stack replacement |
1049 //------------- Interpreter state access for on stack replacement |
1004 const TypeFunc* OptoRuntime::osr_end_Type() { |
1050 const TypeFunc* OptoRuntime::osr_end_Type() { |
1005 // create input type (domain) |
1051 // create input type (domain) |