13#ifndef LLVM_SUPPORT_BCD_H
14#define LLVM_SUPPORT_BCD_H
27 bool IsSigned =
true) {
28 assert(ByteLen >= 1 && ByteLen <= 9 &&
"Invalid BCD number");
30 size_t RunLen = ByteLen -
static_cast<unsigned>(IsSigned);
31 for (
size_t I = 0;
I < RunLen; ++
I) {
32 uint8_t DecodedByteValue = ((
Ptr[
I] >> 4) & 0x0f) * 10 + (
Ptr[
I] & 0x0f);
36 uint8_t DecodedByteValue = (
Ptr[ByteLen - 1] >> 4) & 0x0f;
37 uint8_t Sign =
Ptr[ByteLen - 1] & 0x0f;
39 if (Sign == 0x0d || Sign == 0x0b)
45template <
typename ResultT,
typename ValT>
48 reinterpret_cast<const uint8_t *
>(&Val),
sizeof(
ValT), IsSigned));
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
int64_t decodePackedBCD(const uint8_t *Ptr, size_t ByteLen, bool IsSigned=true)