1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
Steam: Fails to launch (2507 regression, possibly incorrect optimization)
**What Game**
Steam (the store itself)
**Describe the bug**
Fails to launch on asahi post de4becc26e0c22a71b6615b3a2f35050e82fded0
**To Reproduce**
Launch steam
**Expected behavior**
The app launches
**System information:**
- OS: Linux 6.14
- CPU/SoC: Apple M1 Pro
- Video driver version: Mesa 25.1.0-r100
- RootFS used: Gentoo Asahi Rootfs
- FEX version: FEX-2507, bisected to de4becc26e0c22a71b6615b3a2f35050e82fded0
- Thunks Enabled: No
**Additional context**
- Is this an x86 or x86-64 game: Both
- Does this reproduce on AArch64 with Radeon/Intel/Nvidia: Untested
- Is this a Vulkan game: N/A
Add any other context about the problem here.
Optimization performed by commit de4becc26e0c22a71b6615b3a2f35050e82fded0 appears to be incorrect:
It transforms
```
"mov w20, w6",
"udiv x22, x0, x20",
"udiv x22, x0, x20",
```
into
```
"udiv x20, x0, x6",
"mov w4, w20",
```
Which is equivalent to transforming `(a // (b % 2**32)) % 2**32 into (a // b) % 2**32`, which is false for example with `a=2 b=1+2**32`.
Reverting the relevant commit fixes the issue.
|