Skip to content

Commit 3a27c84

Browse files
committed
Don't include JIT changes, they were extracted to their own PR
1 parent f225aa0 commit 3a27c84

File tree

1 file changed

+10
-85
lines changed

1 file changed

+10
-85
lines changed

src/coreclr/jit/lowerxarch.cpp

Lines changed: 10 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,55 +1487,24 @@ GenTree* Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node)
14871487
BlockRange().Remove(node);
14881488
op3 = userIntrin->Op(2);
14891489

1490-
// Tracks which two operands get used first
1491-
TernaryLogicUseFlags firstOpUseFlags = TernaryLogicUseFlags::AB;
1492-
14931490
if (op3 == node)
14941491
{
1495-
if (userOper == GT_AND_NOT)
1496-
{
1497-
op3 = op2;
1498-
op2 = op1;
1499-
op1 = userIntrin->Op(1);
1500-
1501-
// AND_NOT isn't commutative so we need to shift parameters down
1502-
firstOpUseFlags = TernaryLogicUseFlags::BC;
1503-
}
1504-
else
1505-
{
1506-
op3 = userIntrin->Op(1);
1507-
}
1492+
op3 = userIntrin->Op(1);
15081493
}
15091494

15101495
uint8_t controlByte = 0x00;
15111496

15121497
if ((userOper == GT_XOR) && op3->IsVectorAllBitsSet())
15131498
{
1514-
// We have XOR(OP(A, B), AllBitsSet)
1515-
// A: op1
1516-
// B: op2
1517-
// C: op3 (AllBitsSet)
1518-
//
1519-
// We want A to be the unused parameter so swap it around
1520-
// A: op3 (AllBitsSet)
1521-
// B: op1
1522-
// C: op2
1523-
//
1524-
// This gives us NOT(OP(B, C))
1525-
1526-
assert(firstOpUseFlags == TernaryLogicUseFlags::AB);
1499+
// We're being used by what is actually GT_NOT, so we
1500+
// need to shift parameters down so that A is unused
15271501

15281502
std::swap(op2, op3);
15291503
std::swap(op1, op2);
15301504

15311505
if (isOperNot)
15321506
{
1533-
// We have NOT(XOR(B, AllBitsSet))
1534-
// A: op3 (AllBitsSet)
1535-
// B: op1
1536-
// C: op2 (AllBitsSet)
1537-
//
1538-
// This represents a double not, so so just return op2
1507+
// We have what is actually a double not, so just return op2
15391508
// which is the only actual value now that the parameters
15401509
// were shifted around
15411510

@@ -1569,64 +1538,20 @@ GenTree* Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node)
15691538
}
15701539
else if (isOperNot)
15711540
{
1572-
if (firstOpUseFlags == TernaryLogicUseFlags::AB)
1573-
{
1574-
// We have OP(XOR(A, AllBitsSet), C)
1575-
// A: op1
1576-
// B: op2 (AllBitsSet)
1577-
// C: op3
1578-
//
1579-
// We want A to be the unused parameter so swap it around
1580-
// A: op2 (AllBitsSet)
1581-
// B: op1
1582-
// C: op3
1583-
//
1584-
// This gives us OP(NOT(B), C)
1541+
// A is unused, so we just want OP(NOT(B), C)
15851542

1586-
assert(op2->IsVectorAllBitsSet());
1587-
std::swap(op1, op2);
1588-
1589-
controlByte = static_cast<uint8_t>(~B);
1590-
controlByte = TernaryLogicInfo::GetTernaryControlByte(userOper, controlByte, C);
1591-
}
1592-
else
1593-
{
1594-
// We have OP(A, XOR(B, AllBitsSet))
1595-
// A: op1
1596-
// B: op2
1597-
// C: op3 (AllBitsSet)
1598-
//
1599-
// We want A to be the unused parameter so swap it around
1600-
// A: op3 (AllBitsSet)
1601-
// B: op1
1602-
// C: op2
1603-
//
1604-
// This gives us OP(B, NOT(C))
1605-
1606-
assert(firstOpUseFlags == TernaryLogicUseFlags::BC);
1607-
1608-
assert(op3->IsVectorAllBitsSet());
1609-
std::swap(op2, op3);
1610-
std::swap(op1, op2);
1543+
assert(op2->IsVectorAllBitsSet());
1544+
std::swap(op1, op2);
16111545

1612-
controlByte = static_cast<uint8_t>(~C);
1613-
controlByte = TernaryLogicInfo::GetTernaryControlByte(userOper, B, controlByte);
1614-
}
1546+
controlByte = static_cast<uint8_t>(~B);
1547+
controlByte = TernaryLogicInfo::GetTernaryControlByte(userOper, controlByte, C);
16151548
}
1616-
else if (firstOpUseFlags == TernaryLogicUseFlags::AB)
1549+
else
16171550
{
16181551
// We have OP2(OP1(A, B), C)
16191552
controlByte = TernaryLogicInfo::GetTernaryControlByte(oper, A, B);
16201553
controlByte = TernaryLogicInfo::GetTernaryControlByte(userOper, controlByte, C);
16211554
}
1622-
else
1623-
{
1624-
// We have OP2(A, OP1(B, C))
1625-
assert(firstOpUseFlags == TernaryLogicUseFlags::BC);
1626-
1627-
controlByte = TernaryLogicInfo::GetTernaryControlByte(oper, B, C);
1628-
controlByte = TernaryLogicInfo::GetTernaryControlByte(userOper, A, controlByte);
1629-
}
16301555

16311556
NamedIntrinsic ternaryLogicId = NI_AVX512F_TernaryLogic;
16321557

0 commit comments

Comments
 (0)