Commit e3bc3a09 authored by Liu Yu's avatar Liu Yu Committed by Kumar Gala

[POWERPC] Fix carry bug in 128-bit unsigned integer adding

Synchronize it to the definition in include/math-emu/op-4.h for short term.
Signed-off-by: default avatarLiu Yu <Yu.Liu@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent e5091842
...@@ -195,18 +195,38 @@ ...@@ -195,18 +195,38 @@
#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_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_ADDI_4 #ifndef __FP_FRAC_ADDI_4
......
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