summary refs log tree commit diff stats
path: root/gitlab/issues/target_sparc/host_missing/accel_TCG/2802.toml
blob: bb6b2ef8f5d9cdf0dd8e6bd9d37b29ba1d2b7c15 (plain) (blame)
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
id = 2802
title = "Sparc: fdtox/fqtox instructions incorrectly select destination register"
state = "closed"
created_at = "2025-02-03T13:33:15.753Z"
closed_at = "2025-02-19T02:48:16.475Z"
labels = ["TestCase", "accel: TCG", "target: sparc", "workflow::Patch available"]
url = "https://gitlab.com/qemu-project/qemu/-/issues/2802"
host-os = "Debian 12 container running on Arch Linux"
host-arch = "x86_64"
qemu-version = "9.2.0"
guest-os = "n/a"
guest-arch = "Sparc64"
description = """This bug report is mostly for informational purposes as I will be posting a fix for the bug.

The `fdtox` and `fqtox` instructions incorrectly select the destination register when the destination register is higher than `f31`."""
reproduce = """1. Install Sparc cross compiler `gcc-12-sparc64-linux-gnu`(in Debian)
2. Compile the test program using `sparc64-linux-gnu-gcc-12 -m64 -o test_program -static test_program.c`
3. Run the test program using `qemu-sparc64-static ./test_program`
4. Expected output is 60. Prints 0 instead."""
additional = """Test program to test the issue:

```c
#include <stdio.h>

int main(int argc, char** argv) {
    long long truncated = 0;
    __asm__("fdtox %0,%%f32\\n\\t" :: "f"(60.0));
    __asm__("fmovd %%f32,%0\\n\\t" : "=f"(truncated));
    printf("%lld\\n", truncated);
    return 0;
}
```

The issue is caused by the commit 0bba7572d4. Where certain changes were made in the way destination registers are selected(moving the DFPREG/QFPREG to decodetree)."""