Skip to content

Commit

Permalink
8271567: AArch64: AES Galois CounterMode (GCM) interleaved implementa…
Browse files Browse the repository at this point in the history
…tion using vector instructions

Reviewed-by: ngasson, adinn, xliu
  • Loading branch information
Andrew Haley committed Sep 23, 2021
1 parent 8799856 commit 4f3b626
Show file tree
Hide file tree
Showing 7 changed files with 1,168 additions and 225 deletions.
8 changes: 4 additions & 4 deletions src/hotspot/cpu/aarch64/assembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,22 +647,22 @@ typedef enum {

class Assembler : public AbstractAssembler {

public:

#ifndef PRODUCT
static const uintptr_t asm_bp;

void emit_long(jint x) {
void emit_int32(jint x) {
if ((uintptr_t)pc() == asm_bp)
NOP();
AbstractAssembler::emit_int32(x);
}
#else
void emit_long(jint x) {
void emit_int32(jint x) {
AbstractAssembler::emit_int32(x);
}
#endif

public:

enum { instruction_size = 4 };

//---< calculate length of instruction >---
Expand Down
26 changes: 26 additions & 0 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1296,11 +1296,37 @@ class MacroAssembler: public Assembler {
void kernel_crc32c_using_crc32c(Register crc, Register buf,
Register len, Register tmp0, Register tmp1, Register tmp2,
Register tmp3);

void ghash_modmul (FloatRegister result,
FloatRegister result_lo, FloatRegister result_hi, FloatRegister b,
FloatRegister a, FloatRegister vzr, FloatRegister a1_xor_a0, FloatRegister p,
FloatRegister t1, FloatRegister t2, FloatRegister t3);
void ghash_load_wide(int index, Register data, FloatRegister result, FloatRegister state);
public:
void multiply_to_len(Register x, Register xlen, Register y, Register ylen, Register z,
Register zlen, Register tmp1, Register tmp2, Register tmp3,
Register tmp4, Register tmp5, Register tmp6, Register tmp7);
void mul_add(Register out, Register in, Register offs, Register len, Register k);
void ghash_multiply(FloatRegister result_lo, FloatRegister result_hi,
FloatRegister a, FloatRegister b, FloatRegister a1_xor_a0,
FloatRegister tmp1, FloatRegister tmp2, FloatRegister tmp3);
void ghash_multiply_wide(int index,
FloatRegister result_lo, FloatRegister result_hi,
FloatRegister a, FloatRegister b, FloatRegister a1_xor_a0,
FloatRegister tmp1, FloatRegister tmp2, FloatRegister tmp3);
void ghash_reduce(FloatRegister result, FloatRegister lo, FloatRegister hi,
FloatRegister p, FloatRegister z, FloatRegister t1);
void ghash_reduce_wide(int index, FloatRegister result, FloatRegister lo, FloatRegister hi,
FloatRegister p, FloatRegister z, FloatRegister t1);
void ghash_processBlocks_wide(address p, Register state, Register subkeyH,
Register data, Register blocks, int unrolls);


void aesenc_loadkeys(Register key, Register keylen);
void aesecb_encrypt(Register from, Register to, Register keylen,
FloatRegister data = v0, int unrolls = 1);
void aesecb_decrypt(Register from, Register to, Register key, Register keylen);
void aes_round(FloatRegister input, FloatRegister subkey);

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

1 comment on commit 4f3b626

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.