Commit 9b57abd
authored
fix: Wrap RHS of SMI shifts to maximum size of type in bits (#1511)
BREAKING CHANGE: When shifting a small integer value of type `i8`/`u8` or `i16`/`u16`, only the 3 respectively 4 least significant bits of the RHS value affect the result, analogous to the result of an `i32.shl` only being affected by the 5 least significant bits of the RHS value. Example: `someI8 << 8` previously produced the value `0`, but now produces `someI8` due to masking the RHS as `8 & 7 = 0` (3 bits).1 parent a0a9da7 commit 9b57abd
File tree
6 files changed
+69
-25
lines changed- src
- tests/compiler
- std
6 files changed
+69
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5128 | 5128 | | |
5129 | 5129 | | |
5130 | 5130 | | |
5131 | | - | |
| 5131 | + | |
5132 | 5132 | | |
5133 | 5133 | | |
5134 | 5134 | | |
| |||
5641 | 5641 | | |
5642 | 5642 | | |
5643 | 5643 | | |
5644 | | - | |
5645 | | - | |
5646 | | - | |
5647 | | - | |
| 5644 | + | |
5648 | 5645 | | |
5649 | 5646 | | |
5650 | 5647 | | |
5651 | | - | |
| 5648 | + | |
| 5649 | + | |
| 5650 | + | |
| 5651 | + | |
| 5652 | + | |
| 5653 | + | |
| 5654 | + | |
| 5655 | + | |
5652 | 5656 | | |
5653 | 5657 | | |
5654 | 5658 | | |
| |||
5677 | 5681 | | |
5678 | 5682 | | |
5679 | 5683 | | |
| 5684 | + | |
5680 | 5685 | | |
5681 | 5686 | | |
5682 | | - | |
5683 | | - | |
| 5687 | + | |
| 5688 | + | |
| 5689 | + | |
| 5690 | + | |
| 5691 | + | |
| 5692 | + | |
| 5693 | + | |
| 5694 | + | |
| 5695 | + | |
| 5696 | + | |
| 5697 | + | |
| 5698 | + | |
| 5699 | + | |
| 5700 | + | |
| 5701 | + | |
5684 | 5702 | | |
5685 | 5703 | | |
5686 | 5704 | | |
| |||
5697 | 5715 | | |
5698 | 5716 | | |
5699 | 5717 | | |
5700 | | - | |
5701 | | - | |
5702 | | - | |
5703 | | - | |
5704 | | - | |
5705 | | - | |
5706 | | - | |
5707 | | - | |
5708 | | - | |
5709 | 5718 | | |
5710 | 5719 | | |
5711 | 5720 | | |
| |||
5730 | 5739 | | |
5731 | 5740 | | |
5732 | 5741 | | |
5733 | | - | |
5734 | | - | |
5735 | | - | |
5736 | | - | |
| 5742 | + | |
5737 | 5743 | | |
5738 | 5744 | | |
5739 | 5745 | | |
5740 | 5746 | | |
5741 | | - | |
5742 | | - | |
| 5747 | + | |
| 5748 | + | |
| 5749 | + | |
| 5750 | + | |
| 5751 | + | |
| 5752 | + | |
5743 | 5753 | | |
5744 | 5754 | | |
5745 | 5755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| 179 | + | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| |||
311 | 315 | | |
312 | 316 | | |
313 | 317 | | |
| 318 | + | |
| 319 | + | |
314 | 320 | | |
315 | 321 | | |
316 | 322 | | |
317 | 323 | | |
318 | 324 | | |
| 325 | + | |
| 326 | + | |
319 | 327 | | |
320 | 328 | | |
321 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2124 | 2124 | | |
2125 | 2125 | | |
2126 | 2126 | | |
| 2127 | + | |
| 2128 | + | |
2127 | 2129 | | |
2128 | 2130 | | |
2129 | 2131 | | |
2130 | 2132 | | |
2131 | 2133 | | |
2132 | 2134 | | |
2133 | 2135 | | |
| 2136 | + | |
| 2137 | + | |
2134 | 2138 | | |
2135 | 2139 | | |
2136 | 2140 | | |
| |||
2344 | 2348 | | |
2345 | 2349 | | |
2346 | 2350 | | |
| 2351 | + | |
| 2352 | + | |
2347 | 2353 | | |
2348 | 2354 | | |
2349 | 2355 | | |
2350 | 2356 | | |
2351 | 2357 | | |
| 2358 | + | |
| 2359 | + | |
2352 | 2360 | | |
2353 | 2361 | | |
2354 | 2362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
| |||
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| 81 | + | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| 90 | + | |
| 91 | + | |
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
| |||
347 | 355 | | |
348 | 356 | | |
349 | 357 | | |
| 358 | + | |
| 359 | + | |
350 | 360 | | |
351 | 361 | | |
352 | 362 | | |
353 | 363 | | |
354 | 364 | | |
| 365 | + | |
| 366 | + | |
355 | 367 | | |
356 | 368 | | |
357 | 369 | | |
| |||
374 | 386 | | |
375 | 387 | | |
376 | 388 | | |
| 389 | + | |
| 390 | + | |
377 | 391 | | |
378 | 392 | | |
379 | 393 | | |
380 | 394 | | |
381 | 395 | | |
382 | 396 | | |
383 | 397 | | |
| 398 | + | |
| 399 | + | |
384 | 400 | | |
385 | 401 | | |
386 | 402 | | |
| |||
0 commit comments