On Sun, 11 Dec 2022 11:48:30 +0000
"Kerr-Mudd, John" <
ad...@127.0.0.1> wrote:
> On Sun, 11 Dec 2022 09:28:07 GMT
>
an...@mips.complang.tuwien.ac.at (Anton Ertl) wrote:
>
>
> [log2 to give a first estimate for a sqrt program]
>
> > P Falth <
peter....@gmail.com> writes:
> > >My E5 v2 cpu is the generation before Haswell and do not have the lzcnt opcode.
> > >But it does not flag an error if executed, instead it executes bsr! and give a wrong
> > >result. This is also stated in the Intel manual.
> >
> > Interesting. Looking at the encoding, lzcount is encoded as repne
> > bsr, and the repne prefix normally is ignored except for the string
> > instructions. Apparently nobody encoded bsr with a repne prefix,
> > otherwise they could not have encoded lzcnt in this way.
> >
>
> I just tried a leading zero count in asm, trying "repnz shr ax,1"; the
> assembler (nasm) was OK encoding it but on execution it dropped out
> after one shift, even though the flags register shows 'nz'. This is on a
> 20 year old Pentium.
> Intel's Instruction Reference (ASDM) says rep[] only applies to string ops,
> so I can't really complain.
> I rarely use rep lods[x] though!
>
> xpost to ala, as it's more about asm.
>
/alt/.lang.asm
doh!
--
Bah, and indeed Humbug.