Lines Matching defs:Contents

259 static bool skipRelocationProcessX86(uint64_t &Type, uint64_t Contents) {
263 static bool skipRelocationProcessAArch64(uint64_t &Type, uint64_t Contents) {
264 auto IsMov = [](uint64_t Contents) -> bool {
266 return (Contents & 0x1f800000) == 0x12800000;
269 auto IsB = [](uint64_t Contents) -> bool {
271 return (Contents & 0xfc000000) == 0x14000000;
274 auto IsAdr = [](uint64_t Contents) -> bool {
276 return (Contents & 0x9f000000) == 0x10000000;
279 auto IsAddImm = [](uint64_t Contents) -> bool {
281 return (Contents & 0x7F800000) == 0x11000000;
284 auto IsNop = [](uint64_t Contents) -> bool { return Contents == 0xd503201f; };
287 if (IsNop(Contents))
293 if (Type == ELF::R_AARCH64_LD64_GOT_LO12_NC && IsAddImm(Contents)) {
312 if (IsMov(Contents))
330 if (IsB(Contents))
343 if (IsAdr(Contents))
350 static bool skipRelocationProcessRISCV(uint64_t &Type, uint64_t Contents) {
410 static uint64_t extractValueX86(uint64_t Type, uint64_t Contents, uint64_t PC) {
412 return SignExtend64<32>(Contents);
414 return SignExtend64(Contents, 8 * Relocation::getSizeForType(Type));
415 return Contents;
418 static uint64_t extractValueAArch64(uint64_t Type, uint64_t Contents,
427 return Contents;
429 return static_cast<int64_t>(PC) + SignExtend64<16>(Contents & 0xffff);
431 return static_cast<int64_t>(PC) + SignExtend64<32>(Contents & 0xffffffff);
433 return static_cast<int64_t>(PC) + Contents;
438 Contents &= ~0xfffffffffc000000ULL;
439 return static_cast<int64_t>(PC) + SignExtend64<28>(Contents << 2);
442 Contents &= ~0xfffffffffff8001fULL;
443 return static_cast<int64_t>(PC) + SignExtend64<16>(Contents >> 3);
446 Contents &= ~0xffffffffff00001fULL;
447 return static_cast<int64_t>(PC) + SignExtend64<21>(Contents >> 3);
457 bool IsAdr = !!(((Contents >> 31) & 0x1) == 0);
458 Contents &= ~0xffffffff9f00001fUll;
459 uint64_t LowBits = (Contents >> 29) & 0x3;
460 uint64_t HighBits = (Contents >> 5) & 0x7ffff;
461 Contents = LowBits | (HighBits << 2);
463 return static_cast<int64_t>(PC) + SignExtend64<21>(Contents);
466 Contents = static_cast<int64_t>(PC) + SignExtend64<33>(Contents << 12);
467 Contents &= ~0xfffUll;
468 return Contents;
476 Contents &= ~0xffffffffffc003ffU;
477 return Contents >> (10 - 3);
484 Contents &= ~0xffffffffffc003ffU;
485 return Contents >> (10 - 0);
490 Contents &= ~0xffffffffffc003ffU;
491 return Contents >> (10 - 4);
496 Contents &= ~0xffffffffffc003ffU;
497 return Contents >> (10 - 2);
502 Contents &= ~0xffffffffffc003ffU;
503 return Contents >> (10 - 1);
508 Contents &= ~0xffffffffffc003ffU;
509 return Contents >> (10 - 0);
519 uint8_t Shift = (Contents >> 21) & 0x3;
521 Contents = (Contents >> 5) & 0xffff;
522 return Contents << (16 * Shift);
526 static uint64_t extractUImmRISCV(uint32_t Contents) {
527 return SignExtend64<32>(Contents & 0xfffff000);
530 static uint64_t extractIImmRISCV(uint32_t Contents) {
531 return SignExtend64<12>(Contents >> 20);
534 static uint64_t extractSImmRISCV(uint32_t Contents) {
535 return SignExtend64<12>(((Contents >> 7) & 0x1f) | ((Contents >> 25) << 5));
538 static uint64_t extractJImmRISCV(uint32_t Contents) {
540 (((Contents >> 21) & 0x3ff) << 1) | (((Contents >> 20) & 0x1) << 11) |
541 (((Contents >> 12) & 0xff) << 12) | (((Contents >> 31) & 0x1) << 20));
544 static uint64_t extractBImmRISCV(uint32_t Contents) {
546 (((Contents >> 8) & 0xf) << 1) | (((Contents >> 25) & 0x3f) << 5) |
547 (((Contents >> 7) & 0x1) << 11) | (((Contents >> 31) & 0x1) << 12));
550 static uint64_t extractValueRISCV(uint64_t Type, uint64_t Contents,
557 return extractJImmRISCV(Contents);
560 return extractUImmRISCV(Contents);
562 return extractBImmRISCV(Contents);
569 return extractUImmRISCV(Contents & 0xffffffff) +
570 extractIImmRISCV(Contents >> 32);
573 return extractUImmRISCV(Contents);
576 return extractIImmRISCV(Contents);
579 return extractSImmRISCV(Contents);
581 return SignExtend64<11>(Contents >> 2);
583 return SignExtend64<8>(((Contents >> 2) & 0x1f) | ((Contents >> 5) & 0xe0));
587 return Contents;
823 bool Relocation::skipRelocationProcess(uint64_t &Type, uint64_t Contents) {
828 return skipRelocationProcessAArch64(Type, Contents);
830 return skipRelocationProcessRISCV(Type, Contents);
832 return skipRelocationProcessX86(Type, Contents);
849 uint64_t Relocation::extractValue(uint64_t Type, uint64_t Contents,
855 return extractValueAArch64(Type, Contents, PC);
857 return extractValueRISCV(Type, Contents, PC);
859 return extractValueX86(Type, Contents, PC);