]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add support for fnop instruction on x86 and amd64
authorMark <mark@zbuffer.de>
Sat, 17 Jan 2026 16:22:59 +0000 (17:22 +0100)
committerMark Wielaard <mark@klomp.org>
Sat, 17 Jan 2026 16:57:45 +0000 (17:57 +0100)
This implements FNOP in guest_amd64_toIR.c and guest_x86_toIR.c by
simply skipping the instruction. Which is OK for now since one of the
x87 FP Limitations is no FP exceptions, except for handling stack
over/underflow.

Add fnop to none/tests/{amd64,x86}/insn_fpu.{def,stdout.exp}.

Also update old 3_1_BUGSTATUS.txt to correct bug number.

https://bugs.kde.org/show_bug.cgi?id=126256

NEWS
VEX/priv/guest_amd64_toIR.c
VEX/priv/guest_x86_toIR.c
docs/internals/3_1_BUGSTATUS.txt
none/tests/amd64/insn_fpu.def
none/tests/amd64/insn_fpu.stdout.exp
none/tests/x86/insn_fpu.def
none/tests/x86/insn_fpu.stdout.exp

diff --git a/NEWS b/NEWS
index 10b3c7b4285dd9bbc0b0935e6da992818950c82f..06ef1c82cb5217a0a2e686e059d881f3e2dd2455 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,7 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather
 than mailing the developers (or mailing lists) directly -- bugs that
 are not entered into bugzilla tend to get forgotten about or ignored.
 
+126256  (fnop) vex x86->IR: unhandled instruction bytes: 0xD9 0xD0 0x31 0xC0
 228343  none/tests/darwin/bug228343 fails on OS X
 258140  Valgrind on OS X always reports some memory "still reachable"
 413369  unhandled amd64-darwin syscall: unix:151 (getpgid)
index 34ebcbdf9add369788fc7f8513cb491173ff8185..0319578f2ee5c70cd129eb9cfb66277c47267b2c 100644 (file)
@@ -5967,6 +5967,10 @@ ULong dis_FPU ( /*OUT*/Bool* decode_ok,
                put_ST_UNCHECKED(r_src, mkexpr(t1));
                break;
 
+            case 0xD0: /* FNOP */
+               DIP("fnop\n");
+               break;
+
             case 0xE0: /* FCHS */
                DIP("fchs\n");
                put_ST_UNCHECKED(0, unop(Iop_NegF64, get_ST(0)));
index bd4ccd54bbd813d70e8703d8f57510fd92504463..710905ad17b41c7452382518c0a9a0aa8e6d7ec0 100644 (file)
@@ -4204,6 +4204,10 @@ UInt dis_FPU ( Bool* decode_ok, UChar sorb, Int delta )
                put_ST_UNCHECKED(r_src, mkexpr(t1));
                break;
 
+            case 0xD0: /* FNOP */
+               DIP("fnop\n");
+               break;
+
             case 0xE0: /* FCHS */
                DIP("fchs\n");
                put_ST_UNCHECKED(0, unop(Iop_NegF64, get_ST(0)));
index 6add0ccac01b8dd04ee8fed3bf3b98c29565335c..4134c3cb9ca12b146443c1d9255a4e71c433dedb 100644 (file)
@@ -54,7 +54,7 @@ v5877     fixed   126217  increase # threads
 v5880     fixed   n-i-bz  vectorise copy_address_range_state
                   n-i-bz  mpicc -fpic bug (Goedeken Richard, inbox)
 vx1611    fixed   126243  vex x86->IR: popw mem
-          low     125265  vex x86->IR: 0xD9 0xD0 (fnop)
+          low     126256  vex x86->IR: 0xD9 0xD0 (fnop)
           low     126257  vex x86->IR: 0xF2 0x0F 0xF0 0x40 (lddqu) (sse3)
           low     126258  vex x86->IR: 0xDF 0x4D (fisttp) (sse3)
                   126384  rdpmc
index 525fd1b1bc95cc26fe49ae4ce31ef34e0d3a79fd..219247478851d176ab06b68a9d320e5f13b22d3c 100644 (file)
@@ -1,3 +1,4 @@
+fnop
 fabs st0.ps[1234.5678] : => st0.ps[1234.5678]
 fabs st0.ps[-1234.5678] : => st0.ps[1234.5678]
 fabs st0.pd[12345678.87654321] : => st0.pd[12345678.87654321]
index 67128c13b7a544f6a6bcb3fef984acde371acda2..f5f4a161f97d981911cc9ffcd812b0f97ce422b5 100644 (file)
@@ -1,3 +1,4 @@
+fnop_1 ... ok
 fabs_1 ... ok
 fabs_2 ... ok
 fabs_3 ... ok
index 590f5844cebbf94a4f02007657dd34d3bf51fe4c..f5a8d61c4cf409a009742025451c10a08665c933 100644 (file)
@@ -1,3 +1,4 @@
+fnop
 fabs st0.ps[1234.5678] : => st0.ps[1234.5678]
 fabs st0.ps[-1234.5678] : => st0.ps[1234.5678]
 fabs st0.pd[12345678.87654321] : => st0.pd[12345678.87654321]
index 67128c13b7a544f6a6bcb3fef984acde371acda2..f5f4a161f97d981911cc9ffcd812b0f97ce422b5 100644 (file)
@@ -1,3 +1,4 @@
+fnop_1 ... ok
 fabs_1 ... ok
 fabs_2 ... ok
 fabs_3 ... ok