Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/runtime.cpp @ 23813:daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
Summary: Add intrinsics for BigInteger squareToLen and mulAdd methods.
Reviewed-by: kvn, jrose
author | igerasim |
---|---|
date | Wed, 17 Feb 2016 13:40:12 +0300 |
parents | ddce0b7cee93 |
children | ea7ac121a5d3 |
comparison
equal
deleted
inserted
replaced
23812:81adfb064a4f | 23813:daaf806995b3 |
---|---|
954 fields[TypeFunc::Parms+0] = NULL; | 954 fields[TypeFunc::Parms+0] = NULL; |
955 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); | 955 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); |
956 return TypeFunc::make(domain, range); | 956 return TypeFunc::make(domain, range); |
957 } | 957 } |
958 | 958 |
959 const TypeFunc* OptoRuntime::squareToLen_Type() { | |
960 // create input type (domain) | |
961 int num_args = 4; | |
962 int argcnt = num_args; | |
963 const Type** fields = TypeTuple::fields(argcnt); | |
964 int argp = TypeFunc::Parms; | |
965 fields[argp++] = TypePtr::NOTNULL; // x | |
966 fields[argp++] = TypeInt::INT; // len | |
967 fields[argp++] = TypePtr::NOTNULL; // z | |
968 fields[argp++] = TypeInt::INT; // zlen | |
969 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); | |
970 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); | |
971 | |
972 // no result type needed | |
973 fields = TypeTuple::fields(1); | |
974 fields[TypeFunc::Parms+0] = NULL; | |
975 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); | |
976 return TypeFunc::make(domain, range); | |
977 } | |
978 | |
979 // for mulAdd calls, 2 pointers and 3 ints, returning int | |
980 const TypeFunc* OptoRuntime::mulAdd_Type() { | |
981 // create input type (domain) | |
982 int num_args = 5; | |
983 int argcnt = num_args; | |
984 const Type** fields = TypeTuple::fields(argcnt); | |
985 int argp = TypeFunc::Parms; | |
986 fields[argp++] = TypePtr::NOTNULL; // out | |
987 fields[argp++] = TypePtr::NOTNULL; // in | |
988 fields[argp++] = TypeInt::INT; // offset | |
989 fields[argp++] = TypeInt::INT; // len | |
990 fields[argp++] = TypeInt::INT; // k | |
991 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); | |
992 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); | |
993 | |
994 // returning carry (int) | |
995 fields = TypeTuple::fields(1); | |
996 fields[TypeFunc::Parms+0] = TypeInt::INT; | |
997 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields); | |
998 return TypeFunc::make(domain, range); | |
999 } | |
1000 | |
959 | 1001 |
960 | 1002 |
961 //------------- Interpreter state access for on stack replacement | 1003 //------------- Interpreter state access for on stack replacement |
962 const TypeFunc* OptoRuntime::osr_end_Type() { | 1004 const TypeFunc* OptoRuntime::osr_end_Type() { |
963 // create input type (domain) | 1005 // create input type (domain) |