src/cpu/x86/vm/assembler_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File warning2 Sdiff src/cpu/x86/vm

src/cpu/x86/vm/assembler_x86.cpp

Print this page
rev 3821 : [mq]: unused


 195     // Do not use AbstractAssembler::relocate, which is not intended for
 196     // embedded words.  Instead, relocate to the enclosing instruction.
 197 
 198     // hack. call32 is too wide for mask so use disp32
 199     if (format == call32_operand)
 200       code_section()->relocate(inst_mark(), rspec, disp32_operand);
 201     else
 202       code_section()->relocate(inst_mark(), rspec, format);
 203   }
 204   emit_long(data);
 205 }
 206 
 207 static int encode(Register r) {
 208   int enc = r->encoding();
 209   if (enc >= 8) {
 210     enc -= 8;
 211   }
 212   return enc;
 213 }
 214 
 215 static int encode(XMMRegister r) {
 216   int enc = r->encoding();
 217   if (enc >= 8) {
 218     enc -= 8;
 219   }
 220   return enc;
 221 }
 222 
 223 void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) {
 224   assert(dst->has_byte_register(), "must have byte register");
 225   assert(isByte(op1) && isByte(op2), "wrong opcode");
 226   assert(isByte(imm8), "not a byte");
 227   assert((op1 & 0x01) == 0, "should be 8bit operation");
 228   emit_byte(op1);
 229   emit_byte(op2 | encode(dst));
 230   emit_byte(imm8);
 231 }
 232 
 233 
 234 void Assembler::emit_arith(int op1, int op2, Register dst, int32_t imm32) {
 235   assert(isByte(op1) && isByte(op2), "wrong opcode");
 236   assert((op1 & 0x01) == 1, "should be 32bit operation");
 237   assert((op1 & 0x02) == 0, "sign-extension bit should not be set");
 238   if (is8bit(imm32)) {
 239     emit_byte(op1 | 0x02); // set sign bit
 240     emit_byte(op2 | encode(dst));
 241     emit_byte(imm32 & 0xFF);
 242   } else {




 195     // Do not use AbstractAssembler::relocate, which is not intended for
 196     // embedded words.  Instead, relocate to the enclosing instruction.
 197 
 198     // hack. call32 is too wide for mask so use disp32
 199     if (format == call32_operand)
 200       code_section()->relocate(inst_mark(), rspec, disp32_operand);
 201     else
 202       code_section()->relocate(inst_mark(), rspec, format);
 203   }
 204   emit_long(data);
 205 }
 206 
 207 static int encode(Register r) {
 208   int enc = r->encoding();
 209   if (enc >= 8) {
 210     enc -= 8;
 211   }
 212   return enc;
 213 }
 214 








 215 void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) {
 216   assert(dst->has_byte_register(), "must have byte register");
 217   assert(isByte(op1) && isByte(op2), "wrong opcode");
 218   assert(isByte(imm8), "not a byte");
 219   assert((op1 & 0x01) == 0, "should be 8bit operation");
 220   emit_byte(op1);
 221   emit_byte(op2 | encode(dst));
 222   emit_byte(imm8);
 223 }
 224 
 225 
 226 void Assembler::emit_arith(int op1, int op2, Register dst, int32_t imm32) {
 227   assert(isByte(op1) && isByte(op2), "wrong opcode");
 228   assert((op1 & 0x01) == 1, "should be 32bit operation");
 229   assert((op1 & 0x02) == 0, "sign-extension bit should not be set");
 230   if (is8bit(imm32)) {
 231     emit_byte(op1 | 0x02); // set sign bit
 232     emit_byte(op2 | encode(dst));
 233     emit_byte(imm32 & 0xFF);
 234   } else {


src/cpu/x86/vm/assembler_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File