git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
VFPU now using std::bitset instead of just float typedef
[ipdf/code.git]
/
src
/
vfpu.h
diff --git
a/src/vfpu.h
b/src/vfpu.h
index
da130a4
..
c489e89
100644
(file)
--- a/
src/vfpu.h
+++ b/
src/vfpu.h
@@
-5,6
+5,8
@@
* Implements a terrible and hacky interface to use a virtual FPU to do floating point operations
*/
* Implements a terrible and hacky interface to use a virtual FPU to do floating point operations
*/
+#include <bitset>
+
namespace VFPU
{
extern int Start(); // Starts the VFPU
namespace VFPU
{
extern int Start(); // Starts the VFPU
@@
-21,10
+23,10
@@
namespace VFPU
-- 111 = unused
*/
typedef enum {ADD=0x000, SUB=0x001, MULT=0x010, DIV=0x011, SQRT=0x100} Opcode;
-- 111 = unused
*/
typedef enum {ADD=0x000, SUB=0x001, MULT=0x010, DIV=0x011, SQRT=0x100} Opcode;
- typedef
float
Register;
+ typedef
std::bitset<32>
Register;
- extern Register Exec(const Register & a, const Register & b, Opcode op);
-
+ extern Register Exec(const Register & a, const Register & b, Opcode op);
// operate with registers
+ extern float Exec(float a, float b, Opcode op); //converts floats into registers and back
}
#endif //_VFPU_H
}
#endif //_VFPU_H
UCC
git Repository :: git.ucc.asn.au