[X86] Use PatFrag with hardcoded numbers for FROUND_NO_EXC/FROUND_CURRENT instead of ImmLeafs with predicates where one of the two numbers was hardcoded.

This more efficient for the isel table generator since we can use CheckChildInteger instead of MoveChild, CheckPredicate, MoveParent. This reduced the table size by 1-2K.

I wish there was a way to share the values with X86BaseInfo.h and still use a PatFrag like this. These numbers are fixed by the X86 intrinsic spec going back many years and we should never need to change them. So we shouldn't waste table bytes to support sharing.

llvm-svn: 335806
This commit is contained in:
Craig Topper 2018-06-28 01:45:44 +00:00
parent 0b70de15ac
commit ec5d568ac1
1 changed files with 2 additions and 4 deletions

View File

@ -888,10 +888,8 @@ def I8Imm : SDNodeXForm<imm, [{
return getI8Imm((uint8_t)N->getZExtValue(), SDLoc(N));
}]>;
def FROUND_NO_EXC : ImmLeaf<i32, [{ return Imm == 8; }]>;
def FROUND_CURRENT : ImmLeaf<i32, [{
return Imm == X86::STATIC_ROUNDING::CUR_DIRECTION;
}]>;
def FROUND_NO_EXC : PatLeaf<(i32 8)>;
def FROUND_CURRENT : PatLeaf<(i32 4)>;
// BYTE_imm - Transform bit immediates into byte immediates.
def BYTE_imm : SDNodeXForm<imm, [{