4284 }
4285
4286 #ifdef _LP64
4287 // scans rcx 4 byte words at [edi] for occurance of rax,
4288 // generic
4289 void Assembler::repne_scanl() { // repne_scan
4290 // SCASL
4291 emit_int16((unsigned char)0xF2, (unsigned char)0xAF);
4292 }
4293 #endif
4294
4295 void Assembler::ret(int imm16) {
4296 if (imm16 == 0) {
4297 emit_int8((unsigned char)0xC3);
4298 } else {
4299 emit_int8((unsigned char)0xC2);
4300 emit_int16(imm16);
4301 }
4302 }
4303
4304 void Assembler::sahf() {
4305 #ifdef _LP64
4306 // Not supported in 64bit mode
4307 ShouldNotReachHere();
4308 #endif
4309 emit_int8((unsigned char)0x9E);
4310 }
4311
4312 void Assembler::sarl(Register dst, int imm8) {
4313 int encode = prefix_and_encode(dst->encoding());
4314 assert(isShiftCount(imm8), "illegal shift count");
4315 if (imm8 == 1) {
4316 emit_int16((unsigned char)0xD1, (0xF8 | encode));
4317 } else {
4318 emit_int24((unsigned char)0xC1, (0xF8 | encode), imm8);
4319 }
4320 }
4321
4322 void Assembler::sarl(Register dst) {
4323 int encode = prefix_and_encode(dst->encoding());
|
4284 }
4285
4286 #ifdef _LP64
4287 // scans rcx 4 byte words at [edi] for occurance of rax,
4288 // generic
4289 void Assembler::repne_scanl() { // repne_scan
4290 // SCASL
4291 emit_int16((unsigned char)0xF2, (unsigned char)0xAF);
4292 }
4293 #endif
4294
4295 void Assembler::ret(int imm16) {
4296 if (imm16 == 0) {
4297 emit_int8((unsigned char)0xC3);
4298 } else {
4299 emit_int8((unsigned char)0xC2);
4300 emit_int16(imm16);
4301 }
4302 }
4303
4304 void Assembler::roll(Register dst, int imm8) {
4305 assert(isShiftCount(imm8 >> 1), "illegal shift count");
4306 int encode = prefix_and_encode(dst->encoding());
4307 if (imm8 == 1) {
4308 emit_int16((unsigned char)0xD1, (0xC0 | encode));
4309 } else {
4310 emit_int24((unsigned char)0xC1, (0xc0 | encode), imm8);
4311 }
4312 }
4313
4314 void Assembler::sahf() {
4315 #ifdef _LP64
4316 // Not supported in 64bit mode
4317 ShouldNotReachHere();
4318 #endif
4319 emit_int8((unsigned char)0x9E);
4320 }
4321
4322 void Assembler::sarl(Register dst, int imm8) {
4323 int encode = prefix_and_encode(dst->encoding());
4324 assert(isShiftCount(imm8), "illegal shift count");
4325 if (imm8 == 1) {
4326 emit_int16((unsigned char)0xD1, (0xF8 | encode));
4327 } else {
4328 emit_int24((unsigned char)0xC1, (0xF8 | encode), imm8);
4329 }
4330 }
4331
4332 void Assembler::sarl(Register dst) {
4333 int encode = prefix_and_encode(dst->encoding());
|