Fix lowering issue in x64 vany_true: sinking and using original value. (#4815)
The x64 lowring of `vany_true` both sinks mergeable loads and uses the original register. This PR fixes the lowering to force the value into a register first. Ideally we should solve the issue by catching this in the ISLE type system, as described in #4745, but this resolves the issue for now. Fixes #4807.
This commit is contained in:
@@ -3640,7 +3640,8 @@
|
|||||||
;; Rules for `vany_true` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Rules for `vany_true` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(rule (lower (vany_true val))
|
(rule (lower (vany_true val))
|
||||||
(with_flags (x64_ptest val val) (x64_setcc (CC.NZ))))
|
(let ((val Xmm val))
|
||||||
|
(with_flags (x64_ptest val val) (x64_setcc (CC.NZ)))))
|
||||||
|
|
||||||
;; Rules for `vall_true` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Rules for `vall_true` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|||||||
8
tests/misc_testsuite/simd/issue4807.wast
Normal file
8
tests/misc_testsuite/simd/issue4807.wast
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
(module
|
||||||
|
(func (result i32)
|
||||||
|
global.get 0
|
||||||
|
v128.any_true
|
||||||
|
)
|
||||||
|
(global (;0;) (mut v128) v128.const i64x2 0 0)
|
||||||
|
)
|
||||||
|
|
||||||
Reference in New Issue
Block a user