Why do you state " b) Do your (single) FP operation"? There is no
requirement to limit your FP operations to a single operation. Once you save
the fp state you can perform as many operations as you desire before you
restore the state.
Paul Lever
----- Original Message -----
From: “Miguel Monteiro”
To: “NT Developers Interest List”
Sent: Wednesday, June 20, 2001 3:07 AM
Subject: [ntdev] FP arithmetic on Kernel Mode - Done, thank you.
> Thank you, Elyas.
> I did searched the newsgroup archives you gently pointed me out. As
> I suspected, this is not a peaceful question. If anyone’s interested,
> here’s what I’ve learned and concluded about the subject:
>
> 1. Floating point operations in kernel-mode doesn’t make great sense.
>
> 2. If sense is not to be called here, you should be aware that FP
> support in KM is very limited.
>
> 3. In fact, there’s no guarantee that NT 4.0 and prior releases support
> FP in KM.
>
> 4. If you’re using Win2K the FP restriction has been lifted: you may
> use FP math in KM. But it’s best to stick with integer math.
>
> 5. If you really, really insist on using FP math then:
>
> a) Save the FP state (KeSaveFloatingPointState)
> b) Do your (single) FP operation
> c) Restore the FP state (KeRestoreFloatingPointState)
>
> 6. Use integer math in KM and pass those silly FP operations up to
> user mode level.
>
> OK, that’s it. I’ll have to resign myself and stick with the last (6)
> “brilliant” bottomline… :)))
>
> Miguel Monteiro
> xxxxx@criticalsoftware.com
> www.criticalsoftware.com
> ------------------------------------------------------------
> “Humour and love are God’s answers
> to Human weaknesses”
> ------------------------------------------------------------
>
> On Monday, June 18, 2001 8:31 PM “Eliyas Yakub” wrote:
>
>
> >Please search the newsgroup archive
> >(http://groups.google.com/groups?hl=en&lr=&safe=off&group=comp.os.ms-wi
> ndows.programmer.nt).
> >This has been discussed several times before.
> >
> >Windows beta2 DDK documentation has new section called “Using Floating
> >Point or MMX in a WDM Driver”. Read that for more info.
> >
> >-Eliyas
>
> —Original Message—
> On Friday, June 15, 2001 11:32 AM I (Miguel Monteiro) wrote:
>
> >Hi,
> >Using FP arithmetic on KM seems a hedious task.
> >Strange as it might seem, suppose such task is needed on a km driver.
> >I could:
> >
> >1. Use KeSaveFloatingPointState to save the FP context in a resident
> >(e.g. in the device extension) KFLOATING_SAVE variable;
> >2. Perform the FP operation (e.g. a DOUBLE division);
> >3. Restore the FP context, using KeRestoreFloatingPointState.
> >
> >This scheme works fine for a single operation (A), but what if I need
> to
> >perform a sequence of FP operations:
> >
> >save(A), restore(A), save(B), restore(B) = Ok
> >save(A), save(B), save(C) … restore(C), restore(B), restore(A) = NOT
> >Ok…
> >
> >(When dividing, one possible solution would be to use integer
> arithmetic
> >instead, “expanding” the divident (SHL), perform the division and then
> >“shrink” the result (SHR) again. But I’m not sure if the results are
> reliable…)
> >
> >Does anyone know how the “community” has been handling/solving the
> >FP problem on KM drivers? Any tips/points/links are mostly appreciated.
> >
> >Thank you,
> >
> >Miguel Monteiro
> >xxxxx@criticalsoftware.com
> >www.criticalsoftware.com
> >------------------------------------------------------------
> >“Humour and love are God’s answers
> >to Human weaknesses”
> ------------------------------------------------------------
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@home.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com