537 size = 4 << size;
538 guarantee(_offset % size == 0, "bad offset");
539 i->sf(_offset / size, 21, 15);
540 i->srf(_base, 5);
541 }
542
543 void encode_nontemporal_pair(Instruction_aarch64 *i) const {
544 // Only base + offset is allowed
545 i->f(0b000, 25, 23);
546 unsigned size = i->get(31, 31);
547 size = 4 << size;
548 guarantee(_offset % size == 0, "bad offset");
549 i->sf(_offset / size, 21, 15);
550 i->srf(_base, 5);
551 guarantee(_mode == Address::base_plus_offset,
552 "Bad addressing mode for non-temporal op");
553 }
554
555 void lea(MacroAssembler *, Register) const;
556
557 static bool offset_ok_for_immed(long offset, int shift = 0) {
558 unsigned mask = (1 << shift) - 1;
559 if (offset < 0 || offset & mask) {
560 return (uabs(offset) < (1 << (20 - 12))); // Unscaled offset
561 } else {
562 return ((offset >> shift) < (1 << (21 - 10 + 1))); // Scaled, unsigned offset
563 }
564 }
565 };
566
567 // Convience classes
568 class RuntimeAddress: public Address {
569
570 public:
571
572 RuntimeAddress(address target) : Address(target, relocInfo::runtime_call_type) {}
573
574 };
575
576 class OopAddress: public Address {
577
|
537 size = 4 << size;
538 guarantee(_offset % size == 0, "bad offset");
539 i->sf(_offset / size, 21, 15);
540 i->srf(_base, 5);
541 }
542
543 void encode_nontemporal_pair(Instruction_aarch64 *i) const {
544 // Only base + offset is allowed
545 i->f(0b000, 25, 23);
546 unsigned size = i->get(31, 31);
547 size = 4 << size;
548 guarantee(_offset % size == 0, "bad offset");
549 i->sf(_offset / size, 21, 15);
550 i->srf(_base, 5);
551 guarantee(_mode == Address::base_plus_offset,
552 "Bad addressing mode for non-temporal op");
553 }
554
555 void lea(MacroAssembler *, Register) const;
556
557 static bool offset_ok_for_immed(long offset, int shift) {
558 unsigned mask = (1 << shift) - 1;
559 if (offset < 0 || offset & mask) {
560 return (uabs(offset) < (1 << (20 - 12))); // Unscaled offset
561 } else {
562 return ((offset >> shift) < (1 << (21 - 10 + 1))); // Scaled, unsigned offset
563 }
564 }
565 };
566
567 // Convience classes
568 class RuntimeAddress: public Address {
569
570 public:
571
572 RuntimeAddress(address target) : Address(target, relocInfo::runtime_call_type) {}
573
574 };
575
576 class OopAddress: public Address {
577
|