@@ -4155,14 +4155,18 @@ class StubGenerator: public StubCodeGenerator {
4155
4155
4156
4156
// to minimize the number of memory operations:
4157
4157
// read the 4 state 4-byte values in pairs, with a single ld,
4158
- // and split them into 2 registers
4159
- __ mv (t0, mask32);
4158
+ // and split them into 2 registers.
4159
+ //
4160
+ // And, as the core algorithm of md5 works on 32-bits words, so
4161
+ // in the following code, it does not care about the content of
4162
+ // higher 32-bits in state[x]. Based on this observation,
4163
+ // we can apply further optimization, which is to just ignore the
4164
+ // higher 32-bits in state0/state2, rather than set the higher
4165
+ // 32-bits of state0/state2 to zero explicitly with extra instructions.
4160
4166
__ ld (state0, Address (state));
4161
4167
__ srli (state1, state0, 32 );
4162
- __ andr (state0, state0, t0);
4163
4168
__ ld (state2, Address (state, 8 ));
4164
4169
__ srli (state3, state2, 32 );
4165
- __ andr (state2, state2, t0);
4166
4170
4167
4171
Label md5_loop;
4168
4172
__ BIND (md5_loop);
0 commit comments