< prev index next >

src/cpu/x86/vm/templateTable_x86_64.cpp

Print this page
rev 8847 : 8140482: Various minor code improvements (runtime)
Reviewed-by: dholmes, coleenp, sspitsyn, dsamersoff


1360   __ negq(rax);
1361 }
1362 
1363 // Note: 'double' and 'long long' have 32-bits alignment on x86.
1364 static jlong* double_quadword(jlong *adr, jlong lo, jlong hi) {
1365   // Use the expression (adr)&(~0xF) to provide 128-bits aligned address
1366   // of 128-bits operands for SSE instructions.
1367   jlong *operand = (jlong*)(((intptr_t)adr)&((intptr_t)(~0xF)));
1368   // Store the value to a 128-bits operand.
1369   operand[0] = lo;
1370   operand[1] = hi;
1371   return operand;
1372 }
1373 
1374 // Buffer for 128-bits masks used by SSE instructions.
1375 static jlong float_signflip_pool[2*2];
1376 static jlong double_signflip_pool[2*2];
1377 
1378 void TemplateTable::fneg() {
1379   transition(ftos, ftos);
1380   static jlong *float_signflip  = double_quadword(&float_signflip_pool[1], 0x8000000080000000, 0x8000000080000000);
1381   __ xorps(xmm0, ExternalAddress((address) float_signflip));
1382 }
1383 
1384 void TemplateTable::dneg() {
1385   transition(dtos, dtos);
1386   static jlong *double_signflip  = double_quadword(&double_signflip_pool[1], 0x8000000000000000, 0x8000000000000000);

1387   __ xorpd(xmm0, ExternalAddress((address) double_signflip));
1388 }
1389 
1390 void TemplateTable::iinc() {
1391   transition(vtos, vtos);
1392   __ load_signed_byte(rdx, at_bcp(2)); // get constant
1393   locals_index(rbx);
1394   __ addl(iaddress(rbx), rdx);
1395 }
1396 
1397 void TemplateTable::wide_iinc() {
1398   transition(vtos, vtos);
1399   __ movl(rdx, at_bcp(4)); // get constant
1400   locals_index_wide(rbx);
1401   __ bswapl(rdx); // swap bytes & sign-extend constant
1402   __ sarl(rdx, 16);
1403   __ addl(iaddress(rbx), rdx);
1404   // Note: should probably use only one movl to get both
1405   //       the index and the constant -> fix this
1406 }




1360   __ negq(rax);
1361 }
1362 
1363 // Note: 'double' and 'long long' have 32-bits alignment on x86.
1364 static jlong* double_quadword(jlong *adr, jlong lo, jlong hi) {
1365   // Use the expression (adr)&(~0xF) to provide 128-bits aligned address
1366   // of 128-bits operands for SSE instructions.
1367   jlong *operand = (jlong*)(((intptr_t)adr)&((intptr_t)(~0xF)));
1368   // Store the value to a 128-bits operand.
1369   operand[0] = lo;
1370   operand[1] = hi;
1371   return operand;
1372 }
1373 
1374 // Buffer for 128-bits masks used by SSE instructions.
1375 static jlong float_signflip_pool[2*2];
1376 static jlong double_signflip_pool[2*2];
1377 
1378 void TemplateTable::fneg() {
1379   transition(ftos, ftos);
1380   static jlong *float_signflip  = double_quadword(&float_signflip_pool[1],  CONST64(0x8000000080000000),  CONST64(0x8000000080000000));
1381   __ xorps(xmm0, ExternalAddress((address) float_signflip));
1382 }
1383 
1384 void TemplateTable::dneg() {
1385   transition(dtos, dtos);
1386   static jlong *double_signflip =
1387     double_quadword(&double_signflip_pool[1], CONST64(0x8000000000000000), CONST64(0x8000000000000000));
1388   __ xorpd(xmm0, ExternalAddress((address) double_signflip));
1389 }
1390 
1391 void TemplateTable::iinc() {
1392   transition(vtos, vtos);
1393   __ load_signed_byte(rdx, at_bcp(2)); // get constant
1394   locals_index(rbx);
1395   __ addl(iaddress(rbx), rdx);
1396 }
1397 
1398 void TemplateTable::wide_iinc() {
1399   transition(vtos, vtos);
1400   __ movl(rdx, at_bcp(4)); // get constant
1401   locals_index_wide(rbx);
1402   __ bswapl(rdx); // swap bytes & sign-extend constant
1403   __ sarl(rdx, 16);
1404   __ addl(iaddress(rbx), rdx);
1405   // Note: should probably use only one movl to get both
1406   //       the index and the constant -> fix this
1407 }


< prev index next >