Skip to contentSkip to conversation

Looking for an emulation for CMOV* instructions.

Q Andi Kleen 3 participants 3 messages Jan 11, 2002 – Jan 18, 2002 1 message not in the archive

lore
Share & tools
lore

Andi Kleen

author
#1 lore raw
In reply to a message not in the archive
Quoted 4 lines · Alan Cox

The kernel isnt there to fix up the fact authors can't read. Its also very hard to get emulations right. I grant that this wasn't helped by the fact the gcc x86 folks also couldnt read the pentium pro manual correctly.

One corner case where emulation would IMHO make sense would be CMPXCHG8. It would allow to do efficient inline mutexes in pthreads, and hit the emulation only on 386/486. cpu feature flag checking is unfortunately not an option normally for inline code.

-Andi (who would have already done it if he had an 486/386 to test)

#2 lore raw
In reply to a message not in the archive
Followup to:  <[email protected]>
By author:    Andi Kleen <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 6 lines

One corner case where emulation would IMHO make sense would be CMPXCHG8. It would allow to do efficient inline mutexes in pthreads, and hit the emulation only on 386/486. cpu feature flag checking is unfortunately not an option normally for inline code.

You don't need CMPXCHG8B to do efficient inline mutexes. In fact, the pthreads code for i386 uses the same mutexes the kernel does (LOCK INC based, I believe), complete with section hacking to make them efficiently inlinable -- and then they're put inside a function call. I believe "kill me now" is an appropriate response.

-hpa

Signature · 3 lines
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<[email protected]>
#3 lore raw
In reply to a message not in the archive

Hi!

Quoted 10 lines
Quoted 3 lines

The kernel isnt there to fix up the fact authors can't read. Its also very hard to get emulations right. I grant that this wasn't helped by the fact the gcc x86 folks also couldnt read the pentium pro manual correctly.

One corner case where emulation would IMHO make sense would be CMPXCHG8. It would allow to do efficient inline mutexes in pthreads, and hit the emulation only on 386/486. cpu feature flag checking is unfortunately not an option normally for inline code.

-Andi (who would have already done it if he had an 486/386 to test)

Do you want one? I have elonex, which is 486sx, small and quiet (needs NFS root). But I'd want it back eventually. Or I might be able to get you some 386...
Pavel

Signature · 2 lines
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.