blob: 2c5e8ea7b4ced44908ed26a8e45490a02b85cd8a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<think>
Okay, I'm trying to classify this bug report for QEMU. The issue is about an incorrect result when performing the SDIV operation on negative divisors. From what I understand, SDIV is a signed division instruction in SPARC architecture.
The user provided details that there's a typo in the helper_sdiv() function within target/sparc/helper.c. This typo causes the divisor to be treated as unsigned instead of signed. When they tested with specific values (-1 and -128, etc.), instead of getting 1, they got 0. That definitely points to an issue with how division is handled for negative numbers.
Looking at the provided patch, it seems that in the code, 'a64 /= b;' was changed to 'a64 /= b32;'. The variable names might be related to signed and unsigned handling. This change likely ensures that both operands are treated correctly as signed 32-bit integers during division.
Now, classifying this bug: it's an issue with how the SDIV instruction is implemented in QEMU. Since SDIV is a specific instruction causing incorrect results due to a code typo, this falls under the "instruction" category.
</think>
The bug involves an error in handling the SDIV instruction, specifically when dealing with negative divisors. This is directly related to how instructions are processed and executed.
instruction
|