Divide some numbers by 5.
[ipdf/code.git] / src / vfpu.h
1 /**
2  * @file vfpu.h
3  * @brief Implements a terrible and hacky interface to use a virtual FPU to do floating point operations
4  */
5
6 #ifndef _VFPU_H
7 #define _VFPU_H
8
9 #include <bitset>
10 namespace VFPU
11 {
12         extern int Start(const char * vcd_output = NULL); // Starts the VFPU
13         extern int Halt(); // Halts the VFPU
14         typedef enum {ADD=0x000, SUB=0x001, MULT=0x010, DIV=0x011, SQRT=0x100} Opcode;
15         typedef enum {EVEN=0x00, ZERO=0x01, UP=0x10, DOWN=0x11} Rmode; // Rounding mode; to even, towards zero, always up, always down
16         typedef std::bitset<32> Register;
17         extern Register Exec(const Register & a, const Register & b, Opcode op, Rmode rmode = EVEN); // operate with registers
18         extern float Exec(float a, float b, Opcode op, Rmode rmode = EVEN); //converts floats into registers and back
19 }
20
21 #endif //_VFPU_H
22
23

UCC git Repository :: git.ucc.asn.au