Re: FPU

1998-08-26 Thread Michele Bini


On Sun, 23 Aug 1998, Georgios Dimitriadis wrote:

 I recently tried to install debian on my laptop, 386sx. I have 5M of free
 RAM and acording to the installation guide it is enough. The problem is
 that when i try to boot from the disk the error message cant find
 coprossesor or math emulation appears and the boot stops. The manual says
 that an FPU is not needet to run Debian.
This is true, but you should choose a kernel with FPU emulation
compiled-in or.

-Michele



FPU

1998-08-23 Thread Georgios Dimitriadis
I recently tried to install debian on my laptop, 386sx. I have 5M of free
RAM and acording to the installation guide it is enough. The problem is
that when i try to boot from the disk the error message cant find
coprossesor or math emulation appears and the boot stops. The manual says
that an FPU is not needet to run Debian.

Since I am a begginer at this I havent any idea what to do next...

--
Georgios Dimitriadishttp://www.physto.se/~georgios
Snapphanevagen 44
177 54 JarfŠlla
SWEDEN  [EMAIL PROTECTED]
---


Controlling the FPU under Linux

1997-10-17 Thread Chris Hanson
   Date: Mon, 13 Oct 1997 16:28:12 +0200
   From: Thomas SCHIEX [EMAIL PROTECTED]

   I'd like to know if anybody has experience in finely controlling the FPU
   under Linux (I'm under Debian 1.3.1). I need to control the rounding mode of
   the FPU (rounding up or down instead of to nearest).

Here is a program to set the FPU modes (assuming you are using an
Intel machine).

/*

Code to initialize the ix87 FP coprocessor control word.
This code must be run once before starting a computation.

Bit(s)  Description
--  ---
0   invalid operation (FP stack overflow or IEEE invalid arithmetic op)
1   denormalized operand
2   zero divide
3   overflow
4   underflow
5   precision (indicates that precision was lost; happens frequently)

The first 6 bits control how the chip responds to various
exceptions.  If a given mask bit is 0, then that exception
will generate a processor trap.  If the mask bit is 1, then
that exception will not trap but is handled by a default
action, usually substituting an infinity or NaN.

Default is all masks set to 1.

8/9 precision control

00 IEEE single precision
01 (reserved)
10 IEEE double precision
11 non-IEEE extended precision

Default is non-IEEE extended precision.

10/11   rounding control

00 round to nearest or even
01 round toward negative infinity
10 round toward positive infinity
11 truncate toward zero

Default is round to nearest or even.

This code (0x0220) sets these bits as follows:

1. Precision mask 1, all others 0.
2. Precision control: IEEE double precision.
3. Rounding control: round to nearest or even.

*/

#ifdef __GNUC__
#if #cpu (i386)

void
initialize_387_to_ieee (void)
{
  unsigned short control_word;
  asm (fclex : : );
  asm (fnstcw %0 : =m (control_word) : );
  asm (andw %2,%0 : =m (control_word) : 0 (control_word), n (0xf0e0));
  asm (orw %2,%0 : =m (control_word) : 0 (control_word), n (0x0220));
  asm (fldcw %0 : : m (control_word));
}

#endif /* #cpu (i386) */
#endif /* __GNUC__ */


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Controlling the FPU under Linux

1997-10-13 Thread Thomas SCHIEX

Hello,

I'd like to know if anybody has experience in finely controlling the FPU
under Linux (I'm under Debian 1.3.1). I need to control the rounding mode of
the FPU (rounding up or down instead of to nearest).

I found /usr/include/i386/fpucontrol, but I cannot get the following program
to give at least 2 different results. Any idea ?

Thomas

#include stdio.h
#include math.h
#include fpu_control.h
#include stdlib.h

main()
{
  double a;

  a = 1.0/3.0;
  printf(%.30f\n,a);

  __setfpucw(0x1b72);
  a = 1.0/3.0;
  __setfpucw(0x1372);
  
  printf(%.30f\n,a);

  __setfpucw(0x1772);
  a = 1.0/3.0;
  __setfpucw(0x1372);
  
  printf(%.30f\n,a);
  return(0);
}


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .