70 default:
71 ShouldNotReachHere();
72 }
73 do_non_sethi:;
74 #endif
75 {
76 guarantee(Assembler::inv_immed(inst), "must have a simm13 field");
77 int simm13 = Assembler::low10((intptr_t)x) + o;
78 guarantee(Assembler::is_simm13(simm13), "offset can't overflow simm13");
79 inst &= ~Assembler::simm( -1, 13);
80 inst |= Assembler::simm(simm13, 13);
81 ip->set_long_at(0, inst);
82 }
83 break;
84
85 case Assembler::branch_op:
86 {
87 #ifdef _LP64
88 jint inst2;
89 guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
90 ip->set_data64_sethi( ip->addr_at(0), (intptr_t)x );
91 #ifdef COMPILER2
92 // [RGV] Someone must have missed putting in a reloc entry for the
93 // add in compiler2.
94 inst2 = ip->long_at( NativeMovConstReg::add_offset );
95 guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op");
96 ip->set_long_at(NativeMovConstReg::add_offset,ip->set_data32_simm13( inst2, (intptr_t)x+o));
97 #endif
98 #else
99 guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
100 inst &= ~Assembler::hi22( -1);
101 inst |= Assembler::hi22((intptr_t)x);
102 // (ignore offset; it doesn't play into the sethi)
103 ip->set_long_at(0, inst);
104 #endif
105 }
106 break;
107
108 default:
109 guarantee(false, "instruction must perform arithmetic or memory access");
|
70 default:
71 ShouldNotReachHere();
72 }
73 do_non_sethi:;
74 #endif
75 {
76 guarantee(Assembler::inv_immed(inst), "must have a simm13 field");
77 int simm13 = Assembler::low10((intptr_t)x) + o;
78 guarantee(Assembler::is_simm13(simm13), "offset can't overflow simm13");
79 inst &= ~Assembler::simm( -1, 13);
80 inst |= Assembler::simm(simm13, 13);
81 ip->set_long_at(0, inst);
82 }
83 break;
84
85 case Assembler::branch_op:
86 {
87 #ifdef _LP64
88 jint inst2;
89 guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
90 if (format() != 0) {
91 assert(type() == relocInfo::oop_type, "only narrow oops case");
92 jint np = oopDesc::encode_heap_oop((oop)x);
93 inst &= ~Assembler::hi22(-1);
94 inst |= Assembler::hi22((intptr_t)np);
95 ip->set_long_at(0, inst);
96 inst2 = ip->long_at( NativeInstruction::nop_instruction_size );
97 guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op");
98 ip->set_long_at(NativeInstruction::nop_instruction_size, ip->set_data32_simm13( inst2, (intptr_t)np));
99 break;
100 }
101 ip->set_data64_sethi( ip->addr_at(0), (intptr_t)x );
102 #ifdef COMPILER2
103 // [RGV] Someone must have missed putting in a reloc entry for the
104 // add in compiler2.
105 inst2 = ip->long_at( NativeMovConstReg::add_offset );
106 guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op");
107 ip->set_long_at(NativeMovConstReg::add_offset,ip->set_data32_simm13( inst2, (intptr_t)x+o));
108 #endif
109 #else
110 guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
111 inst &= ~Assembler::hi22( -1);
112 inst |= Assembler::hi22((intptr_t)x);
113 // (ignore offset; it doesn't play into the sethi)
114 ip->set_long_at(0, inst);
115 #endif
116 }
117 break;
118
119 default:
120 guarantee(false, "instruction must perform arithmetic or memory access");
|