File:  [Isaki's NoNo m68k/m88k emulator] / nono / fpe / test.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed Apr 29 17:04:28 2026 UTC (3 months ago) by root
Branches: MAIN, Isaki
CVS tags: v027, v026, v025, v024, v023, v022, v021, v020, v019, v018, v017, v016, v015, v014, v013, v012, v011, v010, v009, v008, v007, v006, v005, v004, v003, v002, v001, HEAD
nono 0.0.1

#include "fpu_emulate.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>

struct fpemu dummyfe;
struct fpframe dummyframe;

int
main(int ac, char *av[])
{
	struct fpemu *fe = &dummyfe;
	fe->fe_fpframe = &dummyframe;
	struct fpn *fp = &fe->fe_f2;

#if 0
	uint32_t a[3] = { 0xbff00000, 0x80000000, 0x00000000 };
	fpu_explode(fe, &fe->fe_f2, FTYPE_EXT, a);
#else
	double d = atof(av[1]);
	uint32_t *dp = (uint32_t *)&d;
	uint32_t a[3];
	a[0] = dp[1];
	a[1] = dp[0];
	fpu_explode(fe, &fe->fe_f2, FTYPE_DBL, a);
#endif
DUMPFPN("inp:", &fe->fe_f2);

	fp = fpu_etox(fe);
DUMPFPN("ret:", fp);
	return 0;
}

unix.superglobalmegacorp.com

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