SQLite

Check-in [5d9e9364]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Work around for an apparent GCC bug. See forum post ee7278611394034c for details.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5d9e9364808793d65925d4efbfde0f4246df258758f15e8ce1105070d1018fe6
User & Date: drh 2023-07-05 18:59:52
Context
2023-07-05
19:56
Improved comments on the work-around to the GCC x86 floating point wonkiness. (check-in: 7b4c1673 user: drh tags: trunk)
18:59
Work around for an apparent GCC bug. See forum post ee7278611394034c for details. (check-in: 5d9e9364 user: drh tags: trunk)
15:34
Make the order of operations explicit for the error term of Dekker double-precision multiply. (check-in: 28f57b34 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/util.c.

381
382
383
384
385
386
387










388
389
390
391
392
393
394
  if( z==0 ) return 0;
  while( z[0] ){
    h += UpperToLower[(unsigned char)z[0]];
    z++;
  }
  return h;
}











/* Double-Double multiplication.  (x[0],x[1]) *= (y,yy)
**
** Reference:
**   T. J. Dekker, "A Floating-Point Technique for Extending the
**   Available Precision".  1971-07-26.
*/







>
>
>
>
>
>
>
>
>
>







381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
  if( z==0 ) return 0;
  while( z[0] ){
    h += UpperToLower[(unsigned char)z[0]];
    z++;
  }
  return h;
}

/*
** Work around an apparent bug in GCC.
** https://sqlite.org/forum/info/ee7278611394034c
*/
#ifdef i386
#pragma GCC push_options
#pragma GCC optimize("float-store")
#endif


/* Double-Double multiplication.  (x[0],x[1]) *= (y,yy)
**
** Reference:
**   T. J. Dekker, "A Floating-Point Technique for Extending the
**   Available Precision".  1971-07-26.
*/
408
409
410
411
412
413
414





415
416
417
418
419
420
421
  c = p+q;
  cc = p - c + q + tx*ty;
  cc = x[0]*yy + x[1]*y + cc;
  x[0] = c + cc;
  x[1] = c - x[0];
  x[1] += cc;
}






/*
** The string z[] is an text representation of a real number.
** Convert this string to a double and write it into *pResult.
**
** The string z[] is length bytes in length (bytes, not characters) and
** uses the encoding enc.  The string is not necessarily zero-terminated.







>
>
>
>
>







418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
  c = p+q;
  cc = p - c + q + tx*ty;
  cc = x[0]*yy + x[1]*y + cc;
  x[0] = c + cc;
  x[1] = c - x[0];
  x[1] += cc;
}

/* End of the GCC bug work-around */
#ifdef i386
#pragma GCC pop_options
#endif

/*
** The string z[] is an text representation of a real number.
** Convert this string to a double and write it into *pResult.
**
** The string z[] is length bytes in length (bytes, not characters) and
** uses the encoding enc.  The string is not necessarily zero-terminated.