Skip to content

Commit 4f3b626

Browse files
author
Andrew Haley
committed
8271567: AArch64: AES Galois CounterMode (GCM) interleaved implementation using vector instructions
Reviewed-by: ngasson, adinn, xliu
1 parent 8799856 commit 4f3b626

File tree

7 files changed

+1168
-225
lines changed

7 files changed

+1168
-225
lines changed

src/hotspot/cpu/aarch64/assembler_aarch64.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,22 +647,22 @@ typedef enum {
647647

648648
class Assembler : public AbstractAssembler {
649649

650+
public:
651+
650652
#ifndef PRODUCT
651653
static const uintptr_t asm_bp;
652654

653-
void emit_long(jint x) {
655+
void emit_int32(jint x) {
654656
if ((uintptr_t)pc() == asm_bp)
655657
NOP();
656658
AbstractAssembler::emit_int32(x);
657659
}
658660
#else
659-
void emit_long(jint x) {
661+
void emit_int32(jint x) {
660662
AbstractAssembler::emit_int32(x);
661663
}
662664
#endif
663665

664-
public:
665-
666666
enum { instruction_size = 4 };
667667

668668
//---< calculate length of instruction >---

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,11 +1296,37 @@ class MacroAssembler: public Assembler {
12961296
void kernel_crc32c_using_crc32c(Register crc, Register buf,
12971297
Register len, Register tmp0, Register tmp1, Register tmp2,
12981298
Register tmp3);
1299+
1300+
void ghash_modmul (FloatRegister result,
1301+
FloatRegister result_lo, FloatRegister result_hi, FloatRegister b,
1302+
FloatRegister a, FloatRegister vzr, FloatRegister a1_xor_a0, FloatRegister p,
1303+
FloatRegister t1, FloatRegister t2, FloatRegister t3);
1304+
void ghash_load_wide(int index, Register data, FloatRegister result, FloatRegister state);
12991305
public:
13001306
void multiply_to_len(Register x, Register xlen, Register y, Register ylen, Register z,
13011307
Register zlen, Register tmp1, Register tmp2, Register tmp3,
13021308
Register tmp4, Register tmp5, Register tmp6, Register tmp7);
13031309
void mul_add(Register out, Register in, Register offs, Register len, Register k);
1310+
void ghash_multiply(FloatRegister result_lo, FloatRegister result_hi,
1311+
FloatRegister a, FloatRegister b, FloatRegister a1_xor_a0,
1312+
FloatRegister tmp1, FloatRegister tmp2, FloatRegister tmp3);
1313+
void ghash_multiply_wide(int index,
1314+
FloatRegister result_lo, FloatRegister result_hi,
1315+
FloatRegister a, FloatRegister b, FloatRegister a1_xor_a0,
1316+
FloatRegister tmp1, FloatRegister tmp2, FloatRegister tmp3);
1317+
void ghash_reduce(FloatRegister result, FloatRegister lo, FloatRegister hi,
1318+
FloatRegister p, FloatRegister z, FloatRegister t1);
1319+
void ghash_reduce_wide(int index, FloatRegister result, FloatRegister lo, FloatRegister hi,
1320+
FloatRegister p, FloatRegister z, FloatRegister t1);
1321+
void ghash_processBlocks_wide(address p, Register state, Register subkeyH,
1322+
Register data, Register blocks, int unrolls);
1323+
1324+
1325+
void aesenc_loadkeys(Register key, Register keylen);
1326+
void aesecb_encrypt(Register from, Register to, Register keylen,
1327+
FloatRegister data = v0, int unrolls = 1);
1328+
void aesecb_decrypt(Register from, Register to, Register key, Register keylen);
1329+
void aes_round(FloatRegister input, FloatRegister subkey);
13041330

13051331
// Place an ISB after code may have been modified due to a safepoint.
13061332
void safepoint_isb();

0 commit comments

Comments
 (0)