MCPcopy Create free account
hub / github.com/ablab/spades / convertFromSignExtendedInteger

Method convertFromSignExtendedInteger

ext/src/llvm/APFloat.cpp:2451–2474  ·  view source on GitHub ↗

Convert a two's complement integer SRC to a floating point number, rounding according to ROUNDING_MODE. ISSIGNED is true if the integer is signed, in which case it must be sign-extended. */

Source from the content-addressed store, hash-verified

2449 rounding according to ROUNDING_MODE. ISSIGNED is true if the
2450 integer is signed, in which case it must be sign-extended. */
2451IEEEFloat::opStatus
2452IEEEFloat::convertFromSignExtendedInteger(const integerPart *src,
2453 unsigned int srcCount, bool isSigned,
2454 roundingMode rounding_mode) {
2455 opStatus status;
2456
2457 if (isSigned &&
2458 APInt::tcExtractBit(src, srcCount * integerPartWidth - 1)) {
2459 integerPart *copy;
2460
2461 /* If we're signed and negative negate a copy. */
2462 sign = true;
2463 copy = new integerPart[srcCount];
2464 APInt::tcAssign(copy, src, srcCount);
2465 APInt::tcNegate(copy, srcCount);
2466 status = convertFromUnsignedParts(copy, srcCount, rounding_mode);
2467 delete [] copy;
2468 } else {
2469 sign = false;
2470 status = convertFromUnsignedParts(src, srcCount, rounding_mode);
2471 }
2472
2473 return status;
2474}
2475
2476/* FIXME: should this just take a const APInt reference? */
2477IEEEFloat::opStatus

Callers

nothing calls this directly

Calls 3

assertClass · 0.85
DoubleAPFloatClass · 0.85
bitcastToAPIntMethod · 0.45

Tested by

no test coverage detected