Commit 1801e3e
committed
meshletcodec: Truncate tail offset to 32 bit to improve codegen
clang uses known-bits analysis that has an unfortunate consequence when
using offsets with removed low bits for addressing. Specifically,
instead of generating something like `and rcx, -3`, it notices that the
offset is multiplied by 4/8 in pointer addressing, and as such the top
bits of the offset are not used - and it propagates these top bits into
the and mask, resulting in an extra 10-byte instruction movabs to emit
the mask before and'ing it.
For now work around this problem by using unsigned 32-bit masking, which
improves this without regressing other platforms or compilers.1 parent bbb1314 commit 1801e3e
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
657 | | - | |
| 657 | + | |
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
729 | | - | |
| 729 | + | |
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| |||
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
786 | | - | |
| 786 | + | |
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| |||
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
849 | | - | |
| 849 | + | |
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
| |||
0 commit comments