8270832: Aarch64: Update algorithm annotations for MacroAssembler::fill_words

Co-authored-by: Wang Huang <whuang@openjdk.org>
Co-authored-by: Miu Zhuojun <mouzhuojun@huawei.com>
Co-authored-by: Wu Yan <wuyan@openjdk.org>
Reviewed-by: ngasson, aph
This commit is contained in:
Wang Huang 2021-09-07 01:40:24 +00:00 committed by Nick Gasson
parent eb221812b2
commit 649c22c5b1

View File

@ -4773,23 +4773,37 @@ void MacroAssembler::fill_words(Register base, Register cnt, Register value)
{
// Algorithm:
//
// scratch1 = cnt & 7;
// if (cnt == 0) {
// return;
// }
// if ((p & 8) != 0) {
// *p++ = v;
// }
//
// scratch1 = cnt & 14;
// cnt -= scratch1;
// p += scratch1;
// switch (scratch1) {
// switch (scratch1 / 2) {
// do {
// cnt -= 8;
// p[-8] = v;
// cnt -= 16;
// p[-16] = v;
// p[-15] = v;
// case 7:
// p[-7] = v;
// p[-14] = v;
// p[-13] = v;
// case 6:
// p[-6] = v;
// p[-12] = v;
// p[-11] = v;
// // ...
// case 1:
// p[-2] = v;
// p[-1] = v;
// case 0:
// p += 8;
// p += 16;
// } while (cnt);
// }
// if ((cnt & 1) == 1) {
// *p++ = v;
// }
assert_different_registers(base, cnt, value, rscratch1, rscratch2);