Add rounding mode to VFPU
[ipdf/code.git] / src / vfpu.h
index c489e89..edf471a 100644 (file)
@@ -23,10 +23,11 @@ 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 enum {EVEN=0x00, ZERO=0x01, UP=0x10, DOWN=0x11} Rmode;
        typedef std::bitset<32> Register;
        
        typedef std::bitset<32> Register;
        
-       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
+       extern Register Exec(const Register & a, const Register & b, Opcode op, Rmode rmode = EVEN); // operate with registers
+       extern float Exec(float a, float b, Opcode op, Rmode rmode = EVEN); //converts floats into registers and back
 }
 
 #endif //_VFPU_H
 }
 
 #endif //_VFPU_H

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