Details
-
Bug
-
Resolution: Duplicate
-
P3
-
17, 18, 19
-
arm
-
generic
Description
The issue was found during the test of arm32 (see JDK-8279300). getObjectSize intrinsic generates logic_and operation with constant that is not acceptable by arm32 instruction.
1412 │ #else
1413 │ __ add(length_int, header_size, length_int);
1414 │ if (round_mask != 0) {
1415 │ __ logical_and(length_int, LIR_OprFact::intConst(~round_mask), length_int); // <<------ ~round mask (-8) can't be encoded into and instruction
1416 │ }
1417 │ __ convert(Bytecodes::_i2l, length_int, result_reg);
1418 │ #endif
Hence for arm32 the constant should be preloaded to a register by separate instruction. Suggest fix is a safer way to generate AND op, it still allows to encode the mask into instruction where it is possible (x86?), and generate load instruction for other platforms.
__ add(length_int, header_size, length_int);
if (round_mask != 0) {
// generate LIR_Const if mask fits instruction requirement
LIR_Opr round_mask_opr = load_immediate((~round_mask), T_INT);
__ logical_and(length_int, round_mask_opr, length_int);
}
__ convert(Bytecodes::_i2l, length_int, result_reg);
1412 │ #else
1413 │ __ add(length_int, header_size, length_int);
1414 │ if (round_mask != 0) {
1415 │ __ logical_and(length_int, LIR_OprFact::intConst(~round_mask), length_int); // <<------ ~round mask (-8) can't be encoded into and instruction
1416 │ }
1417 │ __ convert(Bytecodes::_i2l, length_int, result_reg);
1418 │ #endif
Hence for arm32 the constant should be preloaded to a register by separate instruction. Suggest fix is a safer way to generate AND op, it still allows to encode the mask into instruction where it is possible (x86?), and generate load instruction for other platforms.
__ add(length_int, header_size, length_int);
if (round_mask != 0) {
// generate LIR_Const if mask fits instruction requirement
LIR_Opr round_mask_opr = load_immediate((~round_mask), T_INT);
__ logical_and(length_int, round_mask_opr, length_int);
}
__ convert(Bytecodes::_i2l, length_int, result_reg);
Attachments
Issue Links
- duplicates
-
JDK-8280003 C1: Reconsider uses of logical_and immediates in LIRGenerator::do_getObjectSize
- Resolved
- relates to
-
JDK-8279300 [arm32] SIGILL when running GetObjectSizeIntrinsicsTest
- Resolved
-
JDK-8253525 Implement getInstanceSize/sizeOf intrinsics
- Resolved
- links to
-
Review openjdk/jdk/7076