# Changeset View

Changeset View

# Standalone View

Standalone View

# lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Show First 20 Lines • Show All 2,199 Lines • ▼ Show 20 Lines | if (VT == MVT::i16) | ||||

LC = RTLIB::MUL_I16; | LC = RTLIB::MUL_I16; | ||||

else if (VT == MVT::i32) | else if (VT == MVT::i32) | ||||

LC = RTLIB::MUL_I32; | LC = RTLIB::MUL_I32; | ||||

else if (VT == MVT::i64) | else if (VT == MVT::i64) | ||||

LC = RTLIB::MUL_I64; | LC = RTLIB::MUL_I64; | ||||

else if (VT == MVT::i128) | else if (VT == MVT::i128) | ||||

LC = RTLIB::MUL_I128; | LC = RTLIB::MUL_I128; | ||||

if (LC == RTLIB::UNKNOWN_LIBCALL) { | if (LC == RTLIB::UNKNOWN_LIBCALL || !TLI.getLibcallName(LC)) { | ||||

// We'll expand the multiplication by brute force because we have no other | // We'll expand the multiplication by brute force because we have no other | ||||

// options. This is a trivially-generalized version of the code from | // options. This is a trivially-generalized version of the code from | ||||

// Hacker's Delight (itself derived from Knuth's Algorithm M from section | // Hacker's Delight (itself derived from Knuth's Algorithm M from section | ||||

// 4.3.1). | // 4.3.1). | ||||

unsigned Bits = NVT.getSizeInBits(); | unsigned Bits = NVT.getSizeInBits(); | ||||

unsigned HalfBits = Bits >> 1; | unsigned HalfBits = Bits >> 1; | ||||

SDValue Mask = DAG.getConstant(APInt::getLowBitsSet(Bits, HalfBits), dl, | SDValue Mask = DAG.getConstant(APInt::getLowBitsSet(Bits, HalfBits), dl, | ||||

NVT); | NVT); | ||||

▲ Show 20 Lines • Show All 1,232 Lines • Show Last 20 Lines |