File:  [HATARI the Atari ST Emulator] / hatari / src / uae-cpu / fpp-ieee-be.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Mon Apr 1 07:09:16 2019 UTC (7 years, 2 months ago) by root
Branches: hatari, MAIN
CVS tags: hatari02210, hatari02200, hatari02100, hatari02000, hatari01900, hatari01800, hatari01700, hatari01620, hatari01610, hatari01600, hatari01500, hatari01400, hatari01310, hatari01300, hatari01200, hatari01100, hatari01001, hatari01000, hatari00090, hatari00080, hatari00070, hatari00060, hatari00050, hatari00045, hatari00040, hatari00030, hatari00025, hatari00020, hatari00011, hatari00010, hatari00005, HEAD
hatari 0.05

 /*
  * UAE - The Un*x Amiga Emulator
  *
  * MC68881 emulation
  * Support functions for IEEE compatible host CPUs.
  * These functions use a GCC extension (type punning through unions) and
  * should only be compiled with compilers that support this.
  *
  * Copyright 1999 Sam Jordan
  */

STATIC_INLINE double to_single (uae_u32 value)
{
    union {
        float f;
        uae_u32 u;
    } val;

    val.u = value;
    return val.f;
}

STATIC_INLINE uae_u32 from_single (double src)
{
    union {
        float f;
        uae_u32 u;
    } val;

    val.f = src;
    return val.u;
}

STATIC_INLINE double to_double(uae_u32 wrd1, uae_u32 wrd2)
{
    union {
        double d;
        uae_u32 u[2];
    } val;

    val.u[0] = wrd1;
    val.u[1] = wrd2;
    return val.d;
}

STATIC_INLINE void from_double(double src, uae_u32 * wrd1, uae_u32 * wrd2)
{
    union {
        double d;
        uae_u32 u[2];
    } val;

    val.d = src;
    *wrd1 = val.u[0];
    *wrd2 = val.u[1];
}

#define HAVE_from_double
#define HAVE_to_double
#define HAVE_from_single
#define HAVE_to_single

/* Get the rest of the conversion functions defined.  */
#include "fpp-unknown.h"

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.