Commit 1fd81ec2 authored by Cerlane Leong's avatar Cerlane Leong 💬

support Microsoft

parent c3ab5677
This diff is collapsed.
......@@ -210,7 +210,7 @@ quire16_t q16_fdp_add(quire16_t, posit16_t, posit16_t);
quire16_t q16_fdp_sub(quire16_t, posit16_t, posit16_t);
posit16_t convertQ16ToP16(quire16_t);
posit16_t q16_to_p16(quire16_t);
#define isNaRQ16( q ) ( q.v[0]==0x8000000000000000ULL && q.v[1]==0 )
#define isNaRQ16( q ) ( (q).v[0]==0x8000000000000000ULL && (q).v[1]==0 )
#define isQ16Zero(q) (q.v[0]==0 && q.v[1]==0)
quire16_t q16_TwosComplement(quire16_t);
......
......@@ -180,8 +180,8 @@ quire16_t q16_fdp_add( quire16_t q, posit16_t pA, posit16_t pB ){
uZ.ui[0] = (uZ.ui[0]<<1 | (rcarryb3 & 0x1) );
//Exception handling
if (isNaRQ16(uZ.q) ) uZ.q = q16_clr(uZ.q);
//Exception handling for NaR
if (isNaRQ16(uZ.q)) uZ.q.v[0] = 0;
return uZ.q;
}
......@@ -185,7 +185,7 @@ quire16_t q16_fdp_sub( quire16_t q, posit16_t pA, posit16_t pB ){
uZ.ui[0] = (uZ.ui[0]<<1 | (rcarryb3 & 0x1) );
//Exception handling
if (isNaRQ16(uZ.q) ) uZ.q = q16_clr(uZ.q);
if (isNaRQ16(uZ.q)) uZ.q.v[0] = 0;
return uZ.q;
}
......@@ -69,7 +69,7 @@ quire32_t q32_fdp_add( quire32_t q, posit32_t pA, posit32_t pB ){
uB.p = pB;
uiB = uB.ui;
uZ2.q = q32_clr(uZ2.q); //set it to zero
uZ2.q = q32Clr(uZ2.q); //set it to zero
//NaR
if (isNaRQ32(q) || isNaRP32UI(uA.ui) || isNaRP32UI(uB.ui)){
//set to all zeros
......@@ -196,7 +196,7 @@ quire32_t q32_fdp_add( quire32_t q, posit32_t pA, posit32_t pB ){
}
//Exception handling
if (isNaRQ32(uZ.q) ) uZ.q = q32_clr(uZ.q);
if (isNaRQ32(uZ.q) ) uZ.q.v[0]=0;
return uZ.q;
}
......@@ -71,7 +71,7 @@ quire32_t q32_fdp_sub( quire32_t q, posit32_t pA, posit32_t pB ){
uB.p = pB;
uiB = uB.ui;
uZ2.q = q32_clr(uZ2.q); //set it to zero
uZ2.q = q32Clr(uZ2.q); //set it to zero
//NaR
if (isNaRQ32(q) || isNaRP32UI(uA.ui) || isNaRP32UI(uB.ui)){
//set to all zeros
......@@ -199,7 +199,7 @@ quire32_t q32_fdp_sub( quire32_t q, posit32_t pA, posit32_t pB ){
}
//Exception handling
if (isNaRQ32(uZ.q) ) uZ.q = q32_clr(uZ.q);
if (isNaRQ32(uZ.q) ) uZ.q.v[0]=0;
return uZ.q;
}
......@@ -131,7 +131,7 @@ quire8_t q8_fdp_add( quire8_t q, posit8_t pA, posit8_t pB ){
//Addition
uqZ.ui = uqZ2.ui + uqZ1.ui;
//Exception handling
if (isNaRQ8(uqZ.q) ) uqZ.q = q8_clr(uqZ.q);
if (isNaRQ8(uqZ.q) ) uqZ.q.v = 0;
return uqZ.q;
}
......@@ -130,7 +130,7 @@ quire8_t q8_fdp_sub( quire8_t q, posit8_t pA, posit8_t pB ){
uqZ.ui = uqZ2.ui + uqZ1.ui;
//Exception handling
if (isNaRQ8(uqZ.q) ) uqZ.q = q8_clr(uqZ.q);
if (isNaRQ8(uqZ.q) ) uqZ.q.v=0;
return uqZ.q;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment