summary refs log tree commit diff stats
path: root/results/classifier/zero-shot-user-mode/instruction/2318
diff options
context:
space:
mode:
Diffstat (limited to 'results/classifier/zero-shot-user-mode/instruction/2318')
-rw-r--r--results/classifier/zero-shot-user-mode/instruction/231840
1 files changed, 40 insertions, 0 deletions
diff --git a/results/classifier/zero-shot-user-mode/instruction/2318 b/results/classifier/zero-shot-user-mode/instruction/2318
new file mode 100644
index 00000000..ea5b8337
--- /dev/null
+++ b/results/classifier/zero-shot-user-mode/instruction/2318
@@ -0,0 +1,40 @@
+instruction: 0.706
+runtime: 0.182
+syscall: 0.112
+
+
+
+SH4: SUBV instruction not emulated properly
+Description of problem:
+SUBV opcode is emulated incorrectly.
+
+The documentation says:
+
+`SUBV Rm, Rn        Rn - Rm -> Rn, underflow -> T`
+
+Qemu seems to perform the subtraction correctly, but will not detect an underflow.
+Steps to reproduce:
+```c
+#include <stdio.h>
+
+int main(void)
+{
+	register unsigned int a asm("r8") = 0x80000001;
+	register unsigned int b asm("r9") = 0x2;
+	register unsigned int c asm("r10");
+
+	asm volatile("subv %2,%0\n"
+		     "movt %1\n"
+		     : "+r"(a), "=r"(c) : "r"(b) :);
+
+	printf("Values: a=0x%x b=0x%x c=0x%x\n", a, b, c);
+
+	return 0;
+}
+```
+Additional information:
+Tested on real hardware (SEGA Dreamcast, GCC 15.0), the program above prints:
+`Values: a=0x7fffffff b=0x2 c=0x1`
+
+Running with Qemu (and GCC 13.0), the same program prints:
+`Values: a=0x7fffffff b=0x2 c=0x0`