Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a1acac8a
Commit
a1acac8a
authored
Nov 05, 2002
by
Richard Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix carry ripple in 3 and 4 word addition and subtraction macros.
parent
db01fdce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
32 deletions
+58
-32
include/math-emu/op-4.h
include/math-emu/op-4.h
+58
-32
No files found.
include/math-emu/op-4.h
View file @
a1acac8a
...
@@ -513,58 +513,84 @@
...
@@ -513,58 +513,84 @@
(X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0)
(X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0)
#ifndef __FP_FRAC_ADD_3
#ifndef __FP_FRAC_ADD_3
#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
#define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
(r0 = x0 + y0, \
do { \
r1 = x1 + y1 + (r0 < x0), \
int _c1, _c2; \
r2 = x2 + y2 + (r1 < x1))
r0 = x0 + y0; \
_c1 = r0 < x0; \
r1 = x1 + y1; \
_c2 = r1 < x1; \
r1 += _c1; \
_c2 |= r1 < _c1; \
r2 = x2 + y2 + _c2; \
} while (0)
#endif
#endif
#ifndef __FP_FRAC_ADD_4
#ifndef __FP_FRAC_ADD_4
#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
(r0 = x0 + y0, \
do { \
r1 = x1 + y1 + (r0 < x0), \
int _c1, _c2, _c3; \
r2 = x2 + y2 + (r1 < x1), \
r0 = x0 + y0; \
r3 = x3 + y3 + (r2 < x2))
_c1 = r0 < x0; \
r1 = x1 + y1; \
_c2 = r1 < x1; \
r1 += _c1; \
_c2 |= r1 < _c1; \
r2 = x2 + y2; \
_c3 = r2 < x2; \
r2 += _c2; \
_c3 |= r2 < _c2; \
r3 = x3 + y3 + _c3; \
} while (0)
#endif
#endif
#ifndef __FP_FRAC_SUB_3
#ifndef __FP_FRAC_SUB_3
#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
#define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
(r0 = x0 - y0, \
do { \
r1 = x1 - y1 - (r0 > x0), \
int _c1, _c2; \
r2 = x2 - y2 - (r1 > x1))
r0 = x0 - y0; \
_c1 = r0 > x0; \
r1 = x1 - y1; \
_c2 = r1 > x1; \
r1 -= _c1; \
_c2 |= r1 > _c1; \
r2 = x2 - y2 - _c2; \
} while (0)
#endif
#endif
#ifndef __FP_FRAC_SUB_4
#ifndef __FP_FRAC_SUB_4
#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
(r0 = x0 - y0, \
do { \
r1 = x1 - y1 - (r0 > x0), \
int _c1, _c2, _c3; \
r2 = x2 - y2 - (r1 > x1), \
r0 = x0 - y0; \
r3 = x3 - y3 - (r2 > x2))
_c1 = r0 > x0; \
r1 = x1 - y1; \
_c2 = r1 > x1; \
r1 -= _c1; \
_c2 |= r1 > _c1; \
r2 = x2 - y2; \
_c3 = r2 > x2; \
r2 -= _c2; \
_c3 |= r2 > _c2; \
r3 = x3 - y3 - _c3; \
} while (0)
#endif
#endif
#ifndef __FP_FRAC_DEC_3
#ifndef __FP_FRAC_DEC_3
#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0) \
#define __FP_FRAC_DEC_3(x2,x1,x0,y2,y1,y0) \
do { \
do { \
UWtype _t0, _t1; \
UWtype _t0, _t1, _t2; \
_t0 = x0; \
_t0 = x0, _t1 = x1, _t2 = x2; \
x0 -= y0; \
__FP_FRAC_SUB_3 (x2, x1, x0, _t2, _t1, _t0, y2, y1, y0); \
_t1 = x1; \
x1 -= y1 + (x0 > _t0); \
x2 -= y2 + (x1 > _t1); \
} while (0)
} while (0)
#endif
#endif
#ifndef __FP_FRAC_DEC_4
#ifndef __FP_FRAC_DEC_4
#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0) \
#define __FP_FRAC_DEC_4(x3,x2,x1,x0,y3,y2,y1,y0) \
do { \
do { \
UWtype _t0, _t1; \
UWtype _t0, _t1, _t2, _t3; \
_t0 = x0; \
_t0 = x0, _t1 = x1, _t2 = x2, _t3 = x3; \
x0 -= y0; \
__FP_FRAC_SUB_4 (x3,x2,x1,x0,_t3,_t2,_t1,_t0, y3,y2,y1,y0); \
_t1 = x1; \
x1 -= y1 + (x0 > _t0); \
_t0 = x2; \
x2 -= y2 + (x1 > _t1); \
x3 -= y3 + (x2 > _t0); \
} while (0)
} while (0)
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment