Skip to content

Commit 8cde5b7

Browse files
authored
Cherrypick and release-notes update for 0.35.1. (#3909)
* Fix uextend on x64 for non-i32-source cases. (#3906) In #3849, I moved uextend over to ISLE in the x64 backend. Unfortunately, the lowering patterns had a bug in the i32-to-i64 special case (when we know the generating instruction zeroes the upper 32 bits): it wasn't actually special casing for an i32 source! This meant that e.g. zero extends of the results of i8 adds did not work properly. This PR fixes the bug and updates the runtest for extends significantly to cover the narrow-value cases. No security impact to Wasm as Wasm does not use narrow integer types. Thanks @bjorn3 for reporting! * Updated RELEASES for 0.35.1 patch release.
1 parent 9137b4a commit 8cde5b7

5 files changed

Lines changed: 321 additions & 114 deletions

File tree

RELEASES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
--------------------------------------------------------------------------------
44

5+
## 0.35.1
6+
7+
Released 2022-03-09.
8+
9+
### Fixed
10+
11+
* Fixed a bug in the x86-64 lowering of the `uextend` opcode for narrow (`i8`,
12+
`i16`) integer sources when the value is produced by one of several
13+
arithmetic instructions.
14+
[#3906](https://github.com/bytecodealliance/wasmtime/pull/3906)
15+
516
## 0.35.0
617

718
Released 2022-03-07.

cranelift/codegen/src/isa/x64/lower.isle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,34 +1894,34 @@
18941894
;; keep these here than write an external extractor containing bits of
18951895
;; the instruction pattern.s)
18961896
(rule (lower (has_type $I64
1897-
(uextend src @ (iadd _ _))))
1897+
(uextend src @ (has_type $I32 (iadd _ _)))))
18981898
src)
18991899
(rule (lower (has_type $I64
1900-
(uextend src @ (iadd_ifcout _ _))))
1900+
(uextend src @ (has_type $I32 (iadd_ifcout _ _)))))
19011901
src)
19021902
(rule (lower (has_type $I64
1903-
(uextend src @ (isub _ _))))
1903+
(uextend src @ (has_type $I32 (isub _ _)))))
19041904
src)
19051905
(rule (lower (has_type $I64
1906-
(uextend src @ (imul _ _))))
1906+
(uextend src @ (has_type $I32 (imul _ _)))))
19071907
src)
19081908
(rule (lower (has_type $I64
1909-
(uextend src @ (band _ _))))
1909+
(uextend src @ (has_type $I32 (band _ _)))))
19101910
src)
19111911
(rule (lower (has_type $I64
1912-
(uextend src @ (bor _ _))))
1912+
(uextend src @ (has_type $I32 (bor _ _)))))
19131913
src)
19141914
(rule (lower (has_type $I64
1915-
(uextend src @ (bxor _ _))))
1915+
(uextend src @ (has_type $I32 (bxor _ _)))))
19161916
src)
19171917
(rule (lower (has_type $I64
1918-
(uextend src @ (ishl _ _))))
1918+
(uextend src @ (has_type $I32 (ishl _ _)))))
19191919
src)
19201920
(rule (lower (has_type $I64
1921-
(uextend src @ (ushr _ _))))
1921+
(uextend src @ (has_type $I32 (ushr _ _)))))
19221922
src)
19231923
(rule (lower (has_type $I64
1924-
(uextend src @ (uload32 _ _ _))))
1924+
(uextend src @ (has_type $I32 (uload32 _ _ _)))))
19251925
src)
19261926

19271927
;; Rules for `sextend` / `bextend` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
src/clif.isle 9ea75a6f790b5c03
22
src/prelude.isle b2bc986bcbbbb77
33
src/isa/x64/inst.isle 40f495d3ca5ae547
4-
src/isa/x64/lower.isle faa2a07bba48a813
4+
src/isa/x64/lower.isle c049f7d36db0e0fb

cranelift/codegen/src/isa/x64/lower/isle/generated_code.rs

Lines changed: 96 additions & 90 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)