[llvm] [LLVM][X86] Add EFLAGS Defs for VERR/VERW instructions (PR #81824)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 21:54:09 PST 2024


https://github.com/ri-char created https://github.com/llvm/llvm-project/pull/81824

VERR/VERW instructions will define ZF flag.

![image](https://github.com/llvm/llvm-project/assets/17962023/c8a4f8de-bf2e-431b-a0b4-a161e06ff951)


>From f593e794183a9fb00d555d09e7fd1f94dbf2456d Mon Sep 17 00:00:00 2001
From: riChar <wxsychi at 163.com>
Date: Thu, 15 Feb 2024 13:49:10 +0800
Subject: [PATCH] [LLVM][X86] Add EFLAGS Defs for VERR/VERW instructions

---
 llvm/lib/Target/X86/X86InstrSystem.td | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/lib/Target/X86/X86InstrSystem.td b/llvm/lib/Target/X86/X86InstrSystem.td
index 24a334d38f9261..d051047ae46548 100644
--- a/llvm/lib/Target/X86/X86InstrSystem.td
+++ b/llvm/lib/Target/X86/X86InstrSystem.td
@@ -366,12 +366,14 @@ def LGS32rm : I<0xb5, MRMSrcMem, (outs GR32:$dst), (ins opaquemem:$src),
 def LGS64rm : RI<0xb5, MRMSrcMem, (outs GR64:$dst), (ins opaquemem:$src),
                  "lgs{q}\t{$src, $dst|$dst, $src}", []>, TB;
 
+let Defs = [EFLAGS] in {
 def VERRr : I<0x00, MRM4r, (outs), (ins GR16:$seg), "verr\t$seg", []>, TB;
 def VERWr : I<0x00, MRM5r, (outs), (ins GR16:$seg), "verw\t$seg", []>, TB;
 let mayLoad = 1 in {
 def VERRm : I<0x00, MRM4m, (outs), (ins i16mem:$seg), "verr\t$seg", []>, TB;
 def VERWm : I<0x00, MRM5m, (outs), (ins i16mem:$seg), "verw\t$seg", []>, TB;
 }
+} // Defs EFLAGS
 } // SchedRW
 
 //===----------------------------------------------------------------------===//



More information about the llvm-commits mailing list