Commit 554ea2c
committed
[loong64] Fix missing rounding in loong64 scaled_mult implementation
The reference semantics of scaled_mult include rounding, but the
original implementation did not do so. This is triggering an SkASSERT
in the unit test case FilterResult_raster_RescaleWithTransform, from
constrained_add's debug checks.
The fixed implementation bumps the cost of each scaled_mult from 2
to 5 instruction-count-wise (5 to 8 clock-cycle-wise with the LA464
and LA664 micro-architectures), due to unavailability of rounding
multiply operations in current LoongArch spec. However the computation
now matches the reference scalar semantics, and proper testing of
debug builds is now possible.
Change-Id: I45e43a7a7e6d50b4c32c5e69a6d1d7de341eccf1
[Kaiyang Wu: backport to webkit2gtk]
Link: https://skia-review.googlesource.com/c/skia/+/908136
Signed-off-by: Kaiyang Wu <[email protected]>1 parent c550e97 commit 554ea2c
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5532 | 5532 | | |
5533 | 5533 | | |
5534 | 5534 | | |
5535 | | - | |
5536 | | - | |
| 5535 | + | |
| 5536 | + | |
| 5537 | + | |
| 5538 | + | |
| 5539 | + | |
| 5540 | + | |
5537 | 5541 | | |
5538 | | - | |
5539 | | - | |
| 5542 | + | |
| 5543 | + | |
| 5544 | + | |
| 5545 | + | |
| 5546 | + | |
| 5547 | + | |
5540 | 5548 | | |
5541 | 5549 | | |
5542 | 5550 | | |
| |||
0 commit comments