How do set up the FPU to process instrunctions parallel to the CPU? 
Author Message
 How do set up the FPU to process instrunctions parallel to the CPU?

How do I issue instructions to the FPU to be processed in parallel to the CPU
under TASM.  For example is it possible to set up the FPU to do a floating
point multiply while at the same time moving a pixel to screen memory through
the CPU?  Specifically I'm looking for ways to do this on a Cyrix 686 but
information on the Pentium would also be welcome.

Cheers



Fri, 27 Aug 1999 03:00:00 GMT  
 How do set up the FPU to process instrunctions parallel to the CPU?

Quote:

> How do I issue instructions to the FPU to be processed in parallel to the CPU
> under TASM.  For example is it possible to set up the FPU to do a floating
> point multiply while at the same time moving a pixel to screen memory through
> the CPU?  Specifically I'm looking for ways to do this on a Cyrix 686 but
> information on the Pentium would also be welcome.

Easy. You just start the FPU instruction, execute
your integer instructions and read the result of
the FPU instruction. If everything goes as expected,
the FPU instruction executes in parallel with the
integer instructions. There is no need for any
magical setup.

For example:

        ; Start the FPU divide
        fld     QWORD PTR [var1]
        fdiv    QWORD PTR [var2]

        ; Prefetch destination into L1 cache
        push    eax
        mov     eax,[var3]
        push    ebx
        mov     ebx,[var3+4]

        ; Check for 0
        mov     eax,[var2+4]
        mov     ebx,[var2]
        add     eax,eax
        or      eax,ebx
        pop     ebx
        pop     eax
        je      trap_divide_by_zero

        fstp    QWORD PTR [var3]

        ...

trap_divide_by_zero:

        ...

The long latency FDIV instruction is supposed to
execute in parallel with the integer instructions
in the above example.

==> Vesa Karvonen



Fri, 27 Aug 1999 03:00:00 GMT  
 How do set up the FPU to process instrunctions parallel to the CPU?

Quote:

>        ; Start the FPU divide
>        fld     QWORD PTR [var1]
>        fdiv    QWORD PTR [var2]
>        ; Prefetch destination into L1 cache
>        push    eax
>        mov     eax,[var3]
>        push    ebx
>        mov     ebx,[var3+4]
>The long latency FDIV instruction is supposed to
>execute in parallel with the integer instructions
>in the above example.

Thanks for the info.  But now how do I know when the fpu is ready
to receive the next instruction so that when I send the next fdiv the
whole system doesn't wait for the first fdiv to finish?


Sat, 28 Aug 1999 03:00:00 GMT  
 How do set up the FPU to process instrunctions parallel to the CPU?

: How do I issue instructions to the FPU to be processed in parallel to the CPU
: under TASM.

  There are no specific instructions to the CPU to cause it to execute
instructions in parallel.  The CPU does it automatically whenever it
can.  The trick is to figure out when it can, and order/code your
instructions in a manner that allows the CPU to execute them in parallel.

  The rules for how to do this differ depending on which CPU you are
writing for.

  Now isn't that special?

--
<---->



Sun, 29 Aug 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Fpu Parallel Processing Features

2. managing stdout and stderr neatly while doing parallel processing

3. ALU + FPU in parallel

4. FPU versus CPU

5. cpu detection, fpu, mmx and rdtsc

6. FPU faster than CPU for simple calculation?

7. FPU versus CPU

8. RB uses CPU even when doing nothing

9. Doing both input and output to a process

10. How to wait until all forked process are done

11. server process, tight loop, and cpu consumption?

12. Synchronization of parallel processes

 

 
Powered by phpBB® Forum Software