[llvm] r356419 - [X86] Disable CQTO and CLTQ instructions in the assembly parser outside 64-bit mode.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 18 15:06:14 PDT 2019
Author: ctopper
Date: Mon Mar 18 15:06:14 2019
New Revision: 356419
URL: http://llvm.org/viewvc/llvm-project?rev=356419&view=rev
Log:
[X86] Disable CQTO and CLTQ instructions in the assembly parser outside 64-bit mode.
Modified:
llvm/trunk/lib/Target/X86/X86InstrExtension.td
llvm/trunk/test/MC/X86/x86_errors.s
Modified: llvm/trunk/lib/Target/X86/X86InstrExtension.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrExtension.td?rev=356419&r1=356418&r2=356419&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrExtension.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrExtension.td Mon Mar 18 15:06:14 2019
@@ -28,11 +28,11 @@ let hasSideEffects = 0 in {
let Defs = [RAX], Uses = [EAX] in // RAX = signext(EAX)
def CDQE : RI<0x98, RawFrm, (outs), (ins),
- "{cltq|cdqe}", []>, Sched<[WriteALU]>;
+ "{cltq|cdqe}", []>, Sched<[WriteALU]>, Requires<[In64BitMode]>;
let Defs = [RAX,RDX], Uses = [RAX] in // RDX:RAX = signext(RAX)
def CQO : RI<0x99, RawFrm, (outs), (ins),
- "{cqto|cqo}", []>, Sched<[WriteALU]>;
+ "{cqto|cqo}", []>, Sched<[WriteALU]>, Requires<[In64BitMode]>;
}
// Sign/Zero extenders
Modified: llvm/trunk/test/MC/X86/x86_errors.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86_errors.s?rev=356419&r1=356418&r2=356419&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86_errors.s (original)
+++ llvm/trunk/test/MC/X86/x86_errors.s Mon Mar 18 15:06:14 2019
@@ -158,3 +158,9 @@ mov v_ecx(%eax), %ecx
// 32: 7: error: invalid operand for instruction
// 64: 7: error: invalid operand for instruction
addb (%dx), %al
+
+// 32: error: instruction requires: 64-bit mode
+cqto
+
+// 32: error: instruction requires: 64-bit mode
+cltq
More information about the llvm-commits
mailing list