• Home
  • Raw
  • Download

Lines Matching refs:Unit

212 static Unit uarrone[1]={1};   /* Unit array of 1, used for incrementing  */
251 static Int decGetDigits(Unit *, Int);
263 static void decReverse(Unit *, Unit *);
264 static void decSetCoeff(decNumber *, decContext *, const Unit *,
269 static Int decShiftToLeast(Unit *, Int, Int);
270 static Int decShiftToMost(Unit *, Int, Int);
274 static Int decUnitAddSub(const Unit *, Int, const Unit *, Int, Int,
275 Unit *, Int);
276 static Int decUnitCompare(const Unit *, Int, const Unit *, Int, Int);
335 static void decDumpAr(char, const Unit *, Int);
365 Unit *up; /* work pointer */ in uprv_decNumberFromUInt32()
369 *up=(Unit)(uin%(DECDPUNMAX+1)); in uprv_decNumberFromUInt32()
395 const Unit *up; /* .. */ in uprv_decNumberToInt32()
431 const Unit *up; /* .. */ in uprv_decNumberToUInt32()
499 Unit *res; /* where result will be built */ in uprv_decNumberFromString()
500 Unit resbuff[SD2U(DECBUFFER+9)];/* local buffer in case need temporary */ in uprv_decNumberFromString()
502 Unit *allocres=NULL; /* -> allocated result, iff allocated */ in uprv_decNumberFromString()
508 Unit *up; /* .. */ in uprv_decNumberFromString()
659 Int needbytes=D2U(d)*sizeof(Unit);/* bytes needed */ in uprv_decNumberFromString()
662 allocres=(Unit *)malloc(needbytes); in uprv_decNumberFromString()
681 *up=(Unit)out; /* write unit */ in uprv_decNumberFromString()
686 *up=(Unit)out; /* write lsu */ in uprv_decNumberFromString()
693 *up=(Unit)((Int)*c-(Int)'0'); in uprv_decNumberFromString()
804 const Unit *ua, *ub; /* -> operands */ in uprv_decNumberAnd()
805 const Unit *msua, *msub; /* -> operand msus */ in uprv_decNumberAnd()
806 Unit *uc, *msuc; /* -> result and its msu */ in uprv_decNumberAnd()
827 Unit a, b; /* extract units */ in uprv_decNumberAnd()
838 if (a&b&1) *uc=*uc+(Unit)powers[i]; /* effect AND */ in uprv_decNumberAnd()
950 needbytes=sizeof(decNumber)+(D2U(lhs->digits)-1)*sizeof(Unit); in uprv_decNumberCompareTotalMag()
964 needbytes=sizeof(decNumber)+(D2U(rhs->digits)-1)*sizeof(Unit); in uprv_decNumberCompareTotalMag()
1143 needbytes=sizeof(decNumber)+(D2U(dcmul.digits)-1)*sizeof(Unit); in uprv_decNumberFMA()
1202 const Unit *ua, *msua; /* -> operand and its msu */ in uprv_decNumberInvert()
1203 Unit *uc, *msuc; /* -> result and its msu */ in uprv_decNumberInvert()
1220 Unit a; /* extract unit */ in uprv_decNumberInvert()
1228 if ((~a)&1) *uc=*uc+(Unit)powers[i]; /* effect INVERT */ in uprv_decNumberInvert()
1476 needbytes=sizeof(decNumber)+(D2U(p)-1)*sizeof(Unit); in uprv_decNumberLog10()
1499 needbytes=sizeof(decNumber)+(D2U(p)-1)*sizeof(Unit); in uprv_decNumberLog10()
1820 const Unit *ua, *ub; /* -> operands */ in uprv_decNumberOr()
1821 const Unit *msua, *msub; /* -> operand msus */ in uprv_decNumberOr()
1822 Unit *uc, *msuc; /* -> result and its msu */ in uprv_decNumberOr()
1842 Unit a, b; /* extract units */ in uprv_decNumberOr()
1852 if ((a|b)&1) *uc=*uc+(Unit)powers[i]; /* effect OR */ in uprv_decNumberOr()
2146 needbytes=sizeof(decNumber)+(D2U(aset.digits)-1)*sizeof(Unit); in uprv_decNumberPower()
2498 Unit *msu=res->lsu+D2U(res->digits)-1; /* current msu */ in uprv_decNumberRotate()
2499 Unit *msumax=res->lsu+D2U(set->digits)-1; /* rotation msu */ in uprv_decNumberRotate()
2543 *msumax=(Unit)(save/powers[shift-msudigits]); /* and insert */ in uprv_decNumberRotate()
2545 +(Unit)(rem*powers[DECDPUN-(shift-msudigits)]); /* .. */ in uprv_decNumberRotate()
2548 *msumax=*msumax+(Unit)(save*powers[msudigits-shift]); /* [maybe *1] */ in uprv_decNumberRotate()
2561 *msumax=*msumax+(Unit)(save*powers[msudigits]); in uprv_decNumberRotate()
2591 Unit ret=0; /* return value */ in uprv_decNumberSameQuantum()
2907 needbytes=sizeof(decNumber)+(D2U(rhs->digits)-1)*sizeof(Unit); in uprv_decNumberSquareRoot()
2916 needbytes=sizeof(decNumber)+(D2U(maxp)-1)*sizeof(Unit); in uprv_decNumberSquareRoot()
3250 const Unit *ua, *ub; /* -> operands */ in uprv_decNumberXor()
3251 const Unit *msua, *msub; /* -> operand msus */ in uprv_decNumberXor()
3252 Unit *uc, *msuc; /* -> result and its msu */ in uprv_decNumberXor()
3272 Unit a, b; /* extract units */ in uprv_decNumberXor()
3282 if ((a^b)&1) *uc=*uc+(Unit)powers[i]; /* effect XOR */ in uprv_decNumberXor()
3383 const Unit *smsup, *s; /* work */ in uprv_decNumberCopy()
3384 Unit *d; /* .. */ in uprv_decNumberCopy()
3473 const Unit *up=dn->lsu; /* Unit pointer, -> lsu */ in uprv_decNumberGetBCD()
3506 Unit *up=dn->lsu+D2U(dn->digits)-1; /* -> msu [target pointer] */ in uprv_decNumberSetBCD()
3641 const Unit *up=dn->lsu+D2U(dn->digits)-1; /* -> msu [input pointer] */ in decToString()
3830 Unit *acc; /* accumulator for result */ in decAddOp()
3831 Unit accbuff[SD2U(DECBUFFER*2+20)]; /* local buffer [*2+20 reduces many */ in decAddOp()
3834 Unit *allocacc=NULL; /* -> allocated acc buffer, iff allocated */ in decAddOp()
3969 *res->lsu=(Unit)partial; /* [copy could have overwritten RHS] */ in decAddOp()
3978 *res->lsu=(Unit)partial; in decAddOp()
4056 if (need*sizeof(Unit)>sizeof(accbuff)) { in decAddOp()
4058 allocacc=(Unit *)malloc(need*sizeof(Unit)); in decAddOp()
4238 Unit accbuff[SD2U(DECBUFFER+DECDPUN+10)]; /* local buffer */ in decDivideOp()
4239 Unit *acc=accbuff; /* -> accumulator array for result */ in decDivideOp()
4240 Unit *allocacc=NULL; /* -> allocated buffer, iff allocated */ in decDivideOp()
4241 Unit *accnext; /* -> where next digit will go */ in decDivideOp()
4246 Unit varbuff[SD2U(DECBUFFER*2+DECDPUN)]; /* buffer for var1 */ in decDivideOp()
4247 Unit *var1=varbuff; /* -> var1 array for long subtraction */ in decDivideOp()
4248 Unit *varalloc=NULL; /* -> allocated buffer, iff used */ in decDivideOp()
4249 Unit *msu1; /* -> msu of var1 */ in decDivideOp()
4251 const Unit *var2; /* -> var2 array */ in decDivideOp()
4252 const Unit *msu2; /* -> msu of var2 */ in decDivideOp()
4261 Unit thisunit; /* current unit being accumulated */ in decDivideOp()
4267 Unit *target; /* work */ in decDivideOp()
4268 const Unit *source; /* .. */ in decDivideOp()
4419 if (acclength*sizeof(Unit)>sizeof(accbuff)) { in decDivideOp()
4421 allocacc=(Unit *)malloc(acclength*sizeof(Unit)); in decDivideOp()
4444 if ((var1units+1)*sizeof(Unit)>sizeof(varbuff)) { in decDivideOp()
4446 varalloc=(Unit *)malloc((var1units+1)*sizeof(Unit)); in decDivideOp()
4495 Unit *u; /* work */ in decDivideOp()
4532 const Unit *pv1, *pv2; in decDivideOp()
4533 Unit v2; /* units to compare */ in decDivideOp()
4565 thisunit=(Unit)(thisunit+mult); /* accumulate */ in decDivideOp()
4639 Unit lsu=*accnext; in decDivideOp()
4674 Unit *quotlsu; /* for save */ in decDivideOp()
4720 Unit *up; /* .. */ in decDivideOp()
4858 Unit *acc; /* -> accumulator Unit array */ in decMultiplyOp()
4861 Unit accbuff[SD2U(DECBUFFER*4+1)]; /* buffer (+1 for DECBUFFER==0, */ in decMultiplyOp()
4863 const Unit *mer, *mermsup; /* work */ in decMultiplyOp()
4901 const Unit *cup; /* .. */ in decMultiplyOp()
4902 Unit *up; /* .. */ in decMultiplyOp()
5000 acc=(Unit *)zacc; /* -> target Unit array */ in decMultiplyOp()
5076 *up=(Unit)(item-(part*(DECDPUNMAX+1))); in decMultiplyOp()
5079 *up=(Unit)item; up++; /* [final needs no division] */ in decMultiplyOp()
5088 needbytes=(D2U(lhs->digits)+D2U(rhs->digits))*sizeof(Unit); in decMultiplyOp()
5090 allocacc=(Unit *)malloc(needbytes); in decMultiplyOp()
5092 acc=(Unit *)allocacc; /* use the allocated space */ in decMultiplyOp()
5375 needbytes=sizeof(decNumber)+(D2U(rhs->digits)-1)*sizeof(Unit); in decExpOp()
5407 needbytes=sizeof(decNumber)+(D2U(p*2)-1)*sizeof(Unit); in decExpOp()
5419 needbytes=sizeof(decNumber)+(D2U(p+2)-1)*sizeof(Unit); in decExpOp()
5688 needbytes=sizeof(decNumber)+(D2U(MAXI(p,16))-1)*sizeof(Unit);
5697 needbytes=sizeof(decNumber)+(D2U(MAXI(pp,16))-1)*sizeof(Unit);
6254 static Int decUnitCompare(const Unit *a, Int alength,
6255 const Unit *b, Int blength, Int exp) {
6256 Unit *acc; /* accumulator for result */
6257 Unit accbuff[SD2U(DECBUFFER*2+1)]; /* local buffer */
6258 Unit *allocacc=NULL; /* -> allocated acc buffer, iff allocated */
6260 const Unit *l, *r, *u; /* work */
6288 if (need*sizeof(Unit)>sizeof(accbuff)) {
6289 allocacc=(Unit *)malloc(need*sizeof(Unit));
6358 static Int decUnitAddSub(const Unit *a, Int alength,
6359 const Unit *b, Int blength, Int bshift,
6360 Unit *c, Int m) {
6361 const Unit *alsu=a; /* A lsu [need to remember it] */
6362 Unit *clsu=c; /* C ditto */
6363 Unit *minC; /* low water mark for C */
6364 Unit *maxC; /* high water mark for C */
6391 Unit *hold=minC;
6407 *c=(Unit)carry;
6414 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6424 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6432 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6442 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6451 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6458 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6463 *c=(Unit)(carry-(DECDPUNMAX+1)); /* [helps additions] */
6468 *c=(Unit)(carry%(DECDPUNMAX+1));
6474 *c=(Unit)(carry%(DECDPUNMAX+1));
6493 *c=(Unit)carry;
6501 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6511 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6519 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6529 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6537 *c=(Unit)(carry-est*(DECDPUNMAX+1)); /* remainder */
6544 *c=(Unit)(carry-est*(DECDPUNMAX+1));
6548 *c=(Unit)(carry-(DECDPUNMAX+1));
6554 *c=(Unit)(carry%(DECDPUNMAX+1));
6560 *c=(Unit)(carry%(DECDPUNMAX+1));
6569 *c=(Unit)carry; /* place as new unit */
6578 *c=(Unit)add;
6591 *c=(Unit)(add-carry-1);
6616 Unit *up; /* -> current Unit */
6683 static void decReverse(Unit *ulo, Unit *uhi) {
6684 Unit temp;
6706 static Int decShiftToMost(Unit *uar, Int digits, Int shift) {
6707 Unit *target, *source, *first; /* work */
6713 *uar=(Unit)(*uar*powers[shift]);
6736 if (target<=first) *target=(Unit)next; /* write to target iff valid */
6743 *target=(Unit)next;
6762 static Int decShiftToLeast(Unit *uar, Int units, Int shift) {
6763 Unit *target, *up; /* work */
6790 *target=(Unit)quot;
6802 *target=(Unit)(*target+rem*powers[DECDPUN-cut]);
6837 +(D2U(set->digits)-1)*sizeof(Unit));
6910 static void decSetCoeff(decNumber *dn, decContext *set, const Unit *lsu,
6914 const Unit *up; /* work */
6915 Unit *target; /* .. */
6973 Unit half=(Unit)powers[DECDPUN]>>1;
7036 *target=(Unit)quot;
7048 *target=(Unit)(*target+rem*powers[DECDPUN-cut]);
7178 Unit *up; /* work */
7185 *up=(Unit)powers[count-1]; /* here 999 -> 100 etc. */
7202 Unit *up, *sup; /* work */
7210 *up=(Unit)powers[count]-1; /* here 100 in msu -> 999 */
7212 for (up=up-1; up>=dn->lsu; up--) *up=(Unit)powers[DECDPUN]-1;
7223 *sup=(Unit)powers[count-1]-1; /* here 999.. in msu -> 99.. */
7416 Unit *up; /* work */
7423 *up=(Unit)(powers[count]-1);
7565 const Unit *up; /* work */
7653 Unit *msu; /* -> target cut point */
7729 const Unit *ul;
7730 Unit *ur, *uresp1;
7788 static Int decGetDigits(Unit *uar, Int len) {
7789 Unit *up=uar+(len-1); /* -> msu */
7835 const Unit *up; /* work */
7886 static void decDumpAr(char name, const Unit *ar, Int len) {
7978 const Unit *up; /* work */