Beispiel #1
0
float __floatsisf(SItype i)
{
    FP_DECL_EX;
    FP_DECL_S(A);
    float a;

    FP_FROM_INT_S(A, i, 32, int);
    FP_PACK_S(a, A);
    FP_HANDLE_EXCEPTIONS;

    return a;
}
Beispiel #2
0
SFtype __negsf2(SFtype a)
{
  FP_DECL_EX;
  FP_DECL_S(A); FP_DECL_S(R);
  SFtype r;

  FP_UNPACK_S(A, a);
  FP_NEG_S(R, A);
  FP_PACK_S(r, R);
  FP_CLEAR_EXCEPTIONS;
  FP_HANDLE_EXCEPTIONS;

  return r;
}
Beispiel #3
0
float __negsf2(float a)
{
  FP_DECL_EX;
  FP_DECL_S(A); FP_DECL_S(R);
  float r;

  FP_UNPACK_S(A, a);
  FP_NEG_S(R, A);
  FP_PACK_S(r, R);
  FP_CLEAR_EXCEPTIONS;
  FP_HANDLE_EXCEPTIONS;

  return r;
}
Beispiel #4
0
SFtype __mulsf3(SFtype a, SFtype b)
{
  FP_DECL_EX;
  FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R);
  SFtype r;

  FP_INIT_ROUNDMODE;
  FP_UNPACK_S(A, a);
  FP_UNPACK_S(B, b);
  FP_MUL_S(R, A, B);
  FP_PACK_S(r, R);
  FP_HANDLE_EXCEPTIONS;

  return r;
}
Beispiel #5
0
SFtype
__sqrtsf2 (SFtype a)
{
  FP_DECL_EX;
  FP_DECL_S (A);
  FP_DECL_S (R);
  SFtype r;

  FP_INIT_ROUNDMODE;
  FP_UNPACK_S (A, a);
  FP_SQRT_S (R, A);
  FP_PACK_S (r, R);
  FP_HANDLE_EXCEPTIONS;

  return r;
}
Beispiel #6
0
float __truncdfsf2(double a)
{
  FP_DECL_EX;
  FP_DECL_D(A);
  FP_DECL_S(R);
  float r;

  FP_INIT_ROUNDMODE;
  FP_UNPACK_D(A, a);
#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
  FP_CONV(S,D,1,2,R,A);
#else
  FP_CONV(S,D,1,1,R,A);
#endif
  FP_PACK_S(r, R);
  FP_HANDLE_EXCEPTIONS;

  return r;
}
Beispiel #7
0
float
__fmaf (float a, float b, float c)
{
  FP_DECL_EX;
  FP_DECL_S (A);
  FP_DECL_S (B);
  FP_DECL_S (C);
  FP_DECL_S (R);
  float r;

  FP_INIT_ROUNDMODE;
  FP_UNPACK_S (A, a);
  FP_UNPACK_S (B, b);
  FP_UNPACK_S (C, c);
  FP_FMA_S (R, A, B, C);
  FP_PACK_S (r, R);
  FP_HANDLE_EXCEPTIONS;

  return r;
}