8341013: Optimize x86/aarch64 MD5 intrinsics by reducing data dependency

Reviewed-by: mli, ascarpino
This commit is contained in:
Oli Gillespie 2024-09-30 10:53:20 +00:00 committed by Hamlin Li
parent 475b8943c6
commit 1cf26a5179
2 changed files with 6 additions and 6 deletions

View File

@ -3419,15 +3419,15 @@ class StubGenerator: public StubCodeGenerator {
Register rscratch3 = r10; Register rscratch3 = r10;
Register rscratch4 = r11; Register rscratch4 = r11;
__ andw(rscratch3, r2, r4);
__ bicw(rscratch4, r3, r4);
reg_cache.extract_u32(rscratch1, k); reg_cache.extract_u32(rscratch1, k);
__ movw(rscratch2, t); __ movw(rscratch2, t);
__ orrw(rscratch3, rscratch3, rscratch4);
__ addw(rscratch4, r1, rscratch2); __ addw(rscratch4, r1, rscratch2);
__ addw(rscratch4, rscratch4, rscratch1); __ addw(rscratch4, rscratch4, rscratch1);
__ addw(rscratch3, rscratch3, rscratch4); __ bicw(rscratch2, r3, r4);
__ rorw(rscratch2, rscratch3, 32 - s); __ andw(rscratch3, r2, r4);
__ addw(rscratch2, rscratch2, rscratch4);
__ addw(rscratch2, rscratch2, rscratch3);
__ rorw(rscratch2, rscratch2, 32 - s);
__ addw(r1, rscratch2, r2); __ addw(r1, rscratch2, r2);
} }

View File

@ -81,8 +81,8 @@ void MacroAssembler::fast_md5(Register buf, Address state, Address ofs, Address
notl(rsi); \ notl(rsi); \
andl(rdi, r2); \ andl(rdi, r2); \
andl(rsi, r3); \ andl(rsi, r3); \
orl(rsi, rdi); \
addl(r1, rsi); \ addl(r1, rsi); \
addl(r1, rdi); \
roll(r1, s); \ roll(r1, s); \
addl(r1, r2); addl(r1, r2);