Bug 440653 - vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0xC2 0xC8 0x8 0x2C 0x0 0x0 0x0 0x3
Summary: vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0xC2 0xC8 0x8 0x2C 0x0 0...
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (other bugs)
Version First Reported In: unspecified
Platform: unspecified Unspecified
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-06 03:04 UTC by Manuel
Modified: 2021-08-06 03:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
A patch that solves the bug (1.37 KB, patch)
2021-08-06 03:10 UTC, Manuel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel 2021-08-06 03:04:41 UTC
uname -a
Linux edfdf05b67cf 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

SUMMARY

vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0xC2 0xC8 0x8 0x2C 0x0 0x0 0x0 0x3

STEPS TO REPRODUCE
1. Try to use the instruction CMPPD with and imm8 greater or equal than 8, for example the following main.asm:

global _start
section .text
_start:
cmppd xmm1, xmm0, 0x8

2. nasm -f elf64 -g -F DWARF main.asm
3. ld -o main main.o
4. valgrind -v ./main

OBSERVED RESULT

vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0xC2 0xC8 0x8 0x2C 0x0 0x0 0x0 0x3
vex amd64->IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F
vex amd64->IR:   PFX.66=1 PFX.F2=0 PFX.F3=0

EXPECTED RESULT

No invalide instruction

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Ubuntu 20.04.2 LTS
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

valgrind version: 3.18.0.GIT
Comment 1 Manuel 2021-08-06 03:10:48 UTC
Created attachment 140556 [details]
A patch that solves the bug

I have been looking at the code that handles this instruction and it's seems like it is preventing any imm8 greater or equal than 8, but for processors with avx the instruction can handle those imm8. 
I think that this patch should solve it, please let me know if I'm missing something.