-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport simd fixes to 0.38.0 (#4334)
* x64: Fix codegen for the `i8x16.swizzle` instruction (#4318) This commit fixes a mistake in the `Swizzle` opcode implementation in the x64 backend of Cranelift. Previously an input register was casted to a writable register and then modified, which I believe instructions are not supposed to do. This was discovered as part of my investigation into #4315. * x64: Fix codegen for the `select` instruction with v128 (#4317) This commit fixes a bug in the previous codegen for the `select` instruction when the operations of the `select` were of the `v128` type. Previously teh `XmmCmove` instruction only stored an `OperandSize` of 32 or 64 for a 64 or 32-bit move, but this was also used for these 128-bit types which meant that when used the wrong move instruction was generated. The fix applied here is to store the whole `Type` being moved so the 128-bit variant can be selected as well.
- Loading branch information
1 parent
99c6463
commit b3ad5f9
Showing
5 changed files
with
53 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(module | ||
(func (export "select") (param v128 v128 i32) (result v128) | ||
local.get 0 | ||
local.get 1 | ||
local.get 2 | ||
select) | ||
) | ||
|
||
(assert_return (invoke "select" | ||
(v128.const i64x2 1 1) | ||
(v128.const i64x2 2 2) | ||
(i32.const 0)) | ||
(v128.const i64x2 2 2)) | ||
|
||
(assert_return (invoke "select" | ||
(v128.const i64x2 1 1) | ||
(v128.const i64x2 2 2) | ||
(i32.const 1)) | ||
(v128.const i64x2 1 1)) |