By: -.- (blarg.delete@this.mailinator.com), May 19, 2022 6:11 am
Room: Moderated Discussions
Jan Wassenberg (jan.wassenberg.delete@this.gmail.com) on May 18, 2022 10:23 pm wrote:
> > WHILELT can be emulated on AVX-512, but could be comparatively costly.
> I think just getting a -1 constant, bzhi, then kmovd?
The sequence I had in mind is probably the same:
MOV tmp, b # move eliminated
SUB tmp, a
BZHI tmp, -1, tmp # -1 set in register outside loop
KMOV mask, tmp
So 3-4 instructions instead of 1, and you lose a register for holding a constant (or load it from memory as I think BZHI supports it).
> > WHILELT can be emulated on AVX-512, but could be comparatively costly.
> I think just getting a -1 constant, bzhi, then kmovd?
The sequence I had in mind is probably the same:
MOV tmp, b # move eliminated
SUB tmp, a
BZHI tmp, -1, tmp # -1 set in register outside loop
KMOV mask, tmp
So 3-4 instructions instead of 1, and you lose a register for holding a constant (or load it from memory as I think BZHI supports it).