[X86] Add proper 64-bit mode checks to jrcxz and jcxz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2015-07-04 00:01:07 +00:00
parent 11528555b1
commit 9a9ee6f550
2 changed files with 10 additions and 2 deletions

View File

@ -105,14 +105,16 @@ let isBranch = 1, isTerminator = 1, hasSideEffects = 0, SchedRW = [WriteJump] in
// jecxz.
let Uses = [CX] in
def JCXZ : Ii8PCRel<0xE3, RawFrm, (outs), (ins brtarget8:$dst),
"jcxz\t$dst", [], IIC_JCXZ>, AdSize16;
"jcxz\t$dst", [], IIC_JCXZ>, AdSize16,
Requires<[Not64BitMode]>;
let Uses = [ECX] in
def JECXZ : Ii8PCRel<0xE3, RawFrm, (outs), (ins brtarget8:$dst),
"jecxz\t$dst", [], IIC_JCXZ>, AdSize32;
let Uses = [RCX] in
def JRCXZ : Ii8PCRel<0xE3, RawFrm, (outs), (ins brtarget8:$dst),
"jrcxz\t$dst", [], IIC_JCXZ>, AdSize64;
"jrcxz\t$dst", [], IIC_JCXZ>, AdSize64,
Requires<[In64BitMode]>;
}
// Indirect branches

View File

@ -58,3 +58,9 @@ cmpps $-129, %xmm0, %xmm0
// 32: error: invalid operand for instruction
// 64: error: invalid operand for instruction
cmppd $256, %xmm0, %xmm0
// 32: error: instruction requires: 64-bit mode
jrcxz 1
// 64: error: instruction requires: Not 64-bit mode
jcxz 1