2002-06-04 Chris Demetriou <cgd@broadcom.com>

Ed Satterthwaite  <ehs@broadcom.com>

        * cp1.c (Infinity): Remove.
        * sim-main.h (Infinity): Likewise.

        * cp1.c (fp_unary, fp_binary): New functions.
        (fp_abs, fp_neg, fp_add, fp_sub, fp_mul, fp_div, fp_recip)
        (fp_sqrt): New functions, implemented in terms of the above.
        (AbsoluteValue, Negate, Add, Sub, Multiply, Divide)
        (Recip, SquareRoot): Remove (replaced by functions above).
        * sim-main.h (fp_abs, fp_neg, fp_add, fp_sub, fp_mul, fp_div)
        (fp_recip, fp_sqrt): New prototypes.
        (AbsoluteValue, Negate, Add, Sub, Multiply, Divide)
        (Recip, SquareRoot): Replace prototypes with #defines which
        invoke the functions above.
This commit is contained in:
Chris Demetriou
2002-06-04 16:17:20 +00:00
parent ae2ab2ce36
commit ba46ddd0cf
3 changed files with 135 additions and 412 deletions

View File

@@ -716,17 +716,24 @@ void store_fpr (SIM_STATE, int fpr, FP_formats fmt, unsigned64 value);
/* FPU operations. */
int NaN (unsigned64 op, FP_formats fmt);
int Infinity (unsigned64 op, FP_formats fmt);
int Less (unsigned64 op1, unsigned64 op2, FP_formats fmt);
int Equal (unsigned64 op1, unsigned64 op2, FP_formats fmt);
unsigned64 AbsoluteValue (unsigned64 op, FP_formats fmt);
unsigned64 Negate (unsigned64 op, FP_formats fmt);
unsigned64 Add (unsigned64 op1, unsigned64 op2, FP_formats fmt);
unsigned64 Sub (unsigned64 op1, unsigned64 op2, FP_formats fmt);
unsigned64 Multiply (unsigned64 op1, unsigned64 op2, FP_formats fmt);
unsigned64 Divide (unsigned64 op1, unsigned64 op2, FP_formats fmt);
unsigned64 Recip (unsigned64 op, FP_formats fmt);
unsigned64 SquareRoot (unsigned64 op, FP_formats fmt);
unsigned64 fp_abs (SIM_STATE, unsigned64 op, FP_formats fmt);
#define AbsoluteValue(op,fmt) fp_abs(SIM_ARGS, op, fmt)
unsigned64 fp_neg (SIM_STATE, unsigned64 op, FP_formats fmt);
#define Negate(op,fmt) fp_neg(SIM_ARGS, op, fmt)
unsigned64 fp_add (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt);
#define Add(op1,op2,fmt) fp_add(SIM_ARGS, op1, op2, fmt)
unsigned64 fp_sub (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt);
#define Sub(op1,op2,fmt) fp_sub(SIM_ARGS, op1, op2, fmt)
unsigned64 fp_mul (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt);
#define Multiply(op1,op2,fmt) fp_mul(SIM_ARGS, op1, op2, fmt)
unsigned64 fp_div (SIM_STATE, unsigned64 op1, unsigned64 op2, FP_formats fmt);
#define Divide(op1,op2,fmt) fp_div(SIM_ARGS, op1, op2, fmt)
unsigned64 fp_recip (SIM_STATE, unsigned64 op, FP_formats fmt);
#define Recip(op,fmt) fp_recip(SIM_ARGS, op, fmt)
unsigned64 fp_sqrt (SIM_STATE, unsigned64 op, FP_formats fmt);
#define SquareRoot(op,fmt) fp_sqrt(SIM_ARGS, op, fmt)
unsigned64 convert (SIM_STATE, int rm, unsigned64 op, FP_formats from, FP_formats to);
#define Convert(rm,op,from,to) convert (SIM_ARGS, rm, op, from, to)