Commit c3a8d37
Fix fast_cast int64/uint64→double under -ffast-math
With -ffast-math (-fassociative-math), the compiler may reassociate
(xH-C)+xL into xH+(xL-C). Since xL<<C this causes catastrophic
cancellation, zeroing the result.
Add an asm register barrier between the sub and add to prevent
reassociation. The barrier forces the intermediate into a register
without emitting any instructions.
Fixes #12641 parent 548b05f commit c3a8d37
2 files changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
531 | 538 | | |
532 | 539 | | |
533 | 540 | | |
| |||
543 | 550 | | |
544 | 551 | | |
545 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
546 | 557 | | |
547 | 558 | | |
548 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| |||
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
67 | 78 | | |
68 | 79 | | |
69 | 80 | | |
| |||
0 commit comments