Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 svg: Prevent code with fused instructions (#464)
Add a floating point conversion when multiplying when scaling coordinates so that the multiplication does not get fused with an adjacent addition or subtraction. This causes two instructions to be generated, a MUL and a ADD/SUB, instead of a single FMADD or FMSUB. A fused instruction has different rounding so ends up giving slightly different results to two instructions. This was causing different values in the SVGs generated between AMD64 and ARM64. Revert "labs: Rework random rectangle generation" as we no longer need to work around this by rounding in Evy code. Remove the parens in `randrect.evy` as they are not needed any more due to a recent change. I've tested this on AMD64 and ARM64 and the same SVGs are now generated. This merges the following commits: * svg: Prevent code with fused instructions * Revert "labs: Rework random rectangle generation" * labs: Remove unnecessary parens in randrect frontend/lab/samples/ifs/img/randrect.evy | 16 +- frontend/lab/samples/ifs/img/randrect.svg | 420 ++++++++++++++++++---- pkg/cli/svg/runtime.go | 9 +- 3 files changed, 372 insertions(+), 73 deletions(-) Link: https://go.dev/ref/spec#Floating_point_operators Pull-request: #464
- Loading branch information