Mercurial > hg > graal-compiler
comparison src/share/vm/opto/runtime.cpp @ 14261:00f5eff62d18
8002074: Support for AES on SPARC
Summary: Add intrinsics/stub routines support for single-block and multi-block (as used by Cipher Block Chaining mode) AES encryption and decryption operations on the SPARC platform.
Reviewed-by: kvn, roland
Contributed-by: shrinivas.joshi@oracle.com
author | kvn |
---|---|
date | Tue, 14 Jan 2014 17:46:48 -0800 |
parents | 469216acdb28 |
children | 63a4eb8bcd23 abec000618bf 606acabe7b5c |
comparison
equal
deleted
inserted
replaced
14260:8cdf3f43f63e | 14261:00f5eff62d18 |
---|---|
812 | 812 |
813 // for aescrypt encrypt/decrypt operations, just three pointers returning void (length is constant) | 813 // for aescrypt encrypt/decrypt operations, just three pointers returning void (length is constant) |
814 const TypeFunc* OptoRuntime::aescrypt_block_Type() { | 814 const TypeFunc* OptoRuntime::aescrypt_block_Type() { |
815 // create input type (domain) | 815 // create input type (domain) |
816 int num_args = 3; | 816 int num_args = 3; |
817 if (Matcher::pass_original_key_for_aes()) { | |
818 num_args = 4; | |
819 } | |
817 int argcnt = num_args; | 820 int argcnt = num_args; |
818 const Type** fields = TypeTuple::fields(argcnt); | 821 const Type** fields = TypeTuple::fields(argcnt); |
819 int argp = TypeFunc::Parms; | 822 int argp = TypeFunc::Parms; |
820 fields[argp++] = TypePtr::NOTNULL; // src | 823 fields[argp++] = TypePtr::NOTNULL; // src |
821 fields[argp++] = TypePtr::NOTNULL; // dest | 824 fields[argp++] = TypePtr::NOTNULL; // dest |
822 fields[argp++] = TypePtr::NOTNULL; // k array | 825 fields[argp++] = TypePtr::NOTNULL; // k array |
826 if (Matcher::pass_original_key_for_aes()) { | |
827 fields[argp++] = TypePtr::NOTNULL; // original k array | |
828 } | |
823 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); | 829 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); |
824 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); | 830 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); |
825 | 831 |
826 // no result type needed | 832 // no result type needed |
827 fields = TypeTuple::fields(1); | 833 fields = TypeTuple::fields(1); |
854 | 860 |
855 // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning void | 861 // for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning void |
856 const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() { | 862 const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() { |
857 // create input type (domain) | 863 // create input type (domain) |
858 int num_args = 5; | 864 int num_args = 5; |
865 if (Matcher::pass_original_key_for_aes()) { | |
866 num_args = 6; | |
867 } | |
859 int argcnt = num_args; | 868 int argcnt = num_args; |
860 const Type** fields = TypeTuple::fields(argcnt); | 869 const Type** fields = TypeTuple::fields(argcnt); |
861 int argp = TypeFunc::Parms; | 870 int argp = TypeFunc::Parms; |
862 fields[argp++] = TypePtr::NOTNULL; // src | 871 fields[argp++] = TypePtr::NOTNULL; // src |
863 fields[argp++] = TypePtr::NOTNULL; // dest | 872 fields[argp++] = TypePtr::NOTNULL; // dest |
864 fields[argp++] = TypePtr::NOTNULL; // k array | 873 fields[argp++] = TypePtr::NOTNULL; // k array |
865 fields[argp++] = TypePtr::NOTNULL; // r array | 874 fields[argp++] = TypePtr::NOTNULL; // r array |
866 fields[argp++] = TypeInt::INT; // src len | 875 fields[argp++] = TypeInt::INT; // src len |
876 if (Matcher::pass_original_key_for_aes()) { | |
877 fields[argp++] = TypePtr::NOTNULL; // original k array | |
878 } | |
867 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); | 879 assert(argp == TypeFunc::Parms+argcnt, "correct decoding"); |
868 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); | 880 const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); |
869 | 881 |
870 // no result type needed | 882 // returning cipher len (int) |
871 fields = TypeTuple::fields(1); | 883 fields = TypeTuple::fields(1); |
872 fields[TypeFunc::Parms+0] = NULL; // void | 884 fields[TypeFunc::Parms+0] = TypeInt::INT; |
873 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); | 885 const TypeTuple* range = TypeTuple::make(TypeFunc::Parms+1, fields); |
874 return TypeFunc::make(domain, range); | 886 return TypeFunc::make(domain, range); |
875 } | 887 } |
876 | 888 |
877 //------------- Interpreter state access for on stack replacement | 889 //------------- Interpreter state access for on stack replacement |
878 const TypeFunc* OptoRuntime::osr_end_Type() { | 890 const TypeFunc* OptoRuntime::osr_end_Type() { |