Skip to content

Commit 01ed7ed

Browse files
Changqing-JINGatc-github
authored andcommitted
[x86_64 backend] fix wrong register selection of f32/f64 max/min (#743)
1 parent 2d1b3b1 commit 01ed7ed

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

RELEASENOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Wasm Compiler Release Notes
22

3+
## 3.0.9
4+
- x86_64 backend: fix wrong register selection of f32/f64 max/min.
5+
36
## 3.0.8
47

58
- Fixed wrong machine type for type_cast instruction
@@ -72,6 +75,11 @@
7275

7376
- Stop supporting of tc1.6 and only support tc1.8
7477

78+
## Release v2 known issues
79+
- [Bug fixed by 3.0.9](#309)
80+
- [Bug fixed by 3.0.4](#304)
81+
82+
7583
## 2.2.3
7684

7785
- Replace `vb_MemUtils` with `vb_libutils` for tricore backend.

src/core/compiler/backend/x86_64/x86_64_backend.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3540,6 +3540,7 @@ StackElement Backend::emitInstrsFloatMinMax(StackElement *const arg0Ptr, StackEl
35403540
}
35413541

35423542
RegAllocTracker regAllocTracker{};
3543+
regAllocTracker.futureLifts = mask(arg1Ptr);
35433544
REG const arg0Reg{common_.liftToRegInPlaceProt(*arg0Ptr, true, targetHint, regAllocTracker).reg};
35443545
REG const arg1Reg{common_.liftToRegInPlaceProt(*arg1Ptr, false, regAllocTracker).reg};
35453546

tests/testsuite/vb_f32_cmp.wast

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2456,4 +2456,24 @@
24562456
(assert_return (invoke "le" (f32.const nan) (f32.const nan)) (i32.const 0))
24572457
(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const nan)) (i32.const 0))
24582458
(assert_return (invoke "le" (f32.const nan) (f32.const nan:0x200000)) (i32.const 0))
2459-
(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const nan:0x200000)) (i32.const 0))
2459+
(assert_return (invoke "le" (f32.const nan:0x200000) (f32.const nan:0x200000)) (i32.const 0))
2460+
2461+
(module
2462+
2463+
(func $foo (result f32)
2464+
(local f32)
2465+
f32.const 0
2466+
local.set 0
2467+
2468+
f32.const 100
2469+
2470+
local.get 0
2471+
f32.min
2472+
local.tee 0
2473+
2474+
)
2475+
2476+
(export "func" (func $foo))
2477+
)
2478+
2479+
(assert_return (invoke "func") (f32.const 0))

0 commit comments

Comments
 (0)