2741 __ stvx (vTmp2, fifteen, to); // store this one first (may alias)
2742 __ stvx (vTmp1, to);
2743
2744 __ blr();
2745 return start;
2746 }
2747
2748 // Arguments for generated stub:
2749 // R3_ARG1 - source byte array address
2750 // R4_ARG2 - destination byte array address
2751 // R5_ARG3 - K (key) in little endian int array
2752 address generate_aescrypt_decryptBlock() {
2753 assert(UseAES, "need AES instructions and misaligned SSE support");
2754 StubCodeMark mark(this, "StubRoutines", "aescrypt_decryptBlock");
2755
2756 address start = __ function_entry();
2757
2758 Label L_doLast;
2759 Label L_do44;
2760 Label L_do52;
2761 Label L_do60;
2762
2763 Register from = R3_ARG1; // source array address
2764 Register to = R4_ARG2; // destination array address
2765 Register key = R5_ARG3; // round key array
2766
2767 Register keylen = R8;
2768 Register temp = R9;
2769 Register keypos = R10;
2770 Register fifteen = R12;
2771
2772 VectorRegister vRet = VR0;
2773
2774 VectorRegister vKey1 = VR1;
2775 VectorRegister vKey2 = VR2;
2776 VectorRegister vKey3 = VR3;
2777 VectorRegister vKey4 = VR4;
2778 VectorRegister vKey5 = VR5;
2779
2780 VectorRegister fromPerm = VR6;
2781 VectorRegister keyPerm = VR7;
3279 const Register lplw_s = R7;
3280 const Register in_aux = R8;
3281 const Register out_aux = R9;
3282 const Register piece = R10;
3283 const Register product = R14;
3284 const Register lplw = R15;
3285 const Register i_minus1 = R16;
3286 const Register carry = R17;
3287 const Register offset = R18;
3288 const Register off_aux = R19;
3289 const Register t = R20;
3290 const Register mlen = R21;
3291 const Register len = R22;
3292 const Register a = R23;
3293 const Register b = R24;
3294 const Register i = R25;
3295 const Register c = R26;
3296 const Register cs = R27;
3297
3298 // Labels
3299 Label SKIP_LSHIFT, SKIP_DIAGONAL_SUM, SKIP_ADDONE, SKIP_MULADD, SKIP_LOOP_SQUARE;
3300 Label LOOP_LSHIFT, LOOP_DIAGONAL_SUM, LOOP_ADDONE, LOOP_MULADD, LOOP_SQUARE;
3301
3302 // Save non-volatile regs (frameless).
3303 int current_offs = -8;
3304 __ std(R28, current_offs, R1_SP); current_offs -= 8;
3305 __ std(R27, current_offs, R1_SP); current_offs -= 8;
3306 __ std(R26, current_offs, R1_SP); current_offs -= 8;
3307 __ std(R25, current_offs, R1_SP); current_offs -= 8;
3308 __ std(R24, current_offs, R1_SP); current_offs -= 8;
3309 __ std(R23, current_offs, R1_SP); current_offs -= 8;
3310 __ std(R22, current_offs, R1_SP); current_offs -= 8;
3311 __ std(R21, current_offs, R1_SP); current_offs -= 8;
3312 __ std(R20, current_offs, R1_SP); current_offs -= 8;
3313 __ std(R19, current_offs, R1_SP); current_offs -= 8;
3314 __ std(R18, current_offs, R1_SP); current_offs -= 8;
3315 __ std(R17, current_offs, R1_SP); current_offs -= 8;
3316 __ std(R16, current_offs, R1_SP); current_offs -= 8;
3317 __ std(R15, current_offs, R1_SP); current_offs -= 8;
3318 __ std(R14, current_offs, R1_SP);
3319
3320 // Store the squares, right shifted one bit (i.e., divided by 2)
|
2741 __ stvx (vTmp2, fifteen, to); // store this one first (may alias)
2742 __ stvx (vTmp1, to);
2743
2744 __ blr();
2745 return start;
2746 }
2747
2748 // Arguments for generated stub:
2749 // R3_ARG1 - source byte array address
2750 // R4_ARG2 - destination byte array address
2751 // R5_ARG3 - K (key) in little endian int array
2752 address generate_aescrypt_decryptBlock() {
2753 assert(UseAES, "need AES instructions and misaligned SSE support");
2754 StubCodeMark mark(this, "StubRoutines", "aescrypt_decryptBlock");
2755
2756 address start = __ function_entry();
2757
2758 Label L_doLast;
2759 Label L_do44;
2760 Label L_do52;
2761
2762 Register from = R3_ARG1; // source array address
2763 Register to = R4_ARG2; // destination array address
2764 Register key = R5_ARG3; // round key array
2765
2766 Register keylen = R8;
2767 Register temp = R9;
2768 Register keypos = R10;
2769 Register fifteen = R12;
2770
2771 VectorRegister vRet = VR0;
2772
2773 VectorRegister vKey1 = VR1;
2774 VectorRegister vKey2 = VR2;
2775 VectorRegister vKey3 = VR3;
2776 VectorRegister vKey4 = VR4;
2777 VectorRegister vKey5 = VR5;
2778
2779 VectorRegister fromPerm = VR6;
2780 VectorRegister keyPerm = VR7;
3278 const Register lplw_s = R7;
3279 const Register in_aux = R8;
3280 const Register out_aux = R9;
3281 const Register piece = R10;
3282 const Register product = R14;
3283 const Register lplw = R15;
3284 const Register i_minus1 = R16;
3285 const Register carry = R17;
3286 const Register offset = R18;
3287 const Register off_aux = R19;
3288 const Register t = R20;
3289 const Register mlen = R21;
3290 const Register len = R22;
3291 const Register a = R23;
3292 const Register b = R24;
3293 const Register i = R25;
3294 const Register c = R26;
3295 const Register cs = R27;
3296
3297 // Labels
3298 Label SKIP_LSHIFT, SKIP_DIAGONAL_SUM, SKIP_ADDONE, SKIP_LOOP_SQUARE;
3299 Label LOOP_LSHIFT, LOOP_DIAGONAL_SUM, LOOP_ADDONE, LOOP_SQUARE;
3300
3301 // Save non-volatile regs (frameless).
3302 int current_offs = -8;
3303 __ std(R28, current_offs, R1_SP); current_offs -= 8;
3304 __ std(R27, current_offs, R1_SP); current_offs -= 8;
3305 __ std(R26, current_offs, R1_SP); current_offs -= 8;
3306 __ std(R25, current_offs, R1_SP); current_offs -= 8;
3307 __ std(R24, current_offs, R1_SP); current_offs -= 8;
3308 __ std(R23, current_offs, R1_SP); current_offs -= 8;
3309 __ std(R22, current_offs, R1_SP); current_offs -= 8;
3310 __ std(R21, current_offs, R1_SP); current_offs -= 8;
3311 __ std(R20, current_offs, R1_SP); current_offs -= 8;
3312 __ std(R19, current_offs, R1_SP); current_offs -= 8;
3313 __ std(R18, current_offs, R1_SP); current_offs -= 8;
3314 __ std(R17, current_offs, R1_SP); current_offs -= 8;
3315 __ std(R16, current_offs, R1_SP); current_offs -= 8;
3316 __ std(R15, current_offs, R1_SP); current_offs -= 8;
3317 __ std(R14, current_offs, R1_SP);
3318
3319 // Store the squares, right shifted one bit (i.e., divided by 2)
|