Adding new instructions to the hotspot VM

Shiao-Hui Chiu joannechiou at gmail.com
Mon May 9 19:18:50 PDT 2011


Hi, all

I followed this tutorial to add new instructions to hotspot VM.
http://developer.amd.com/zones/java/assets/AddingNewInstructionsToHotspot.pdf

When I test the new instructions and print the assembly out, the
instructions sequences are still same as unmodified hotspot vm.
Does he matcher not select the new rule for the floating point
comparison ? If not, how do I know which rule the matcher select ?


TEST function in java code:
  public static double TEST(double f)
  {
    if( f < 10.78)
      f = 10.00;
    return f;
  }

TEST function in assembly:
000   B1: #     B3 B2 <- BLOCK HEAD IS JUNK   Freq: 1
000     pushq   rbp
        subq    rsp, #16        # Create frame
        nop     # nop for patch_verified_entry
006     # MachConstantBaseNode (empty encoding)
006     movsd   XMM1, [constant table base + #0]        # load from
constant table: double=#10.780000
00e     ucomisd XMM1, XMM0 test
012     jbe,us  B3  P=0.000000 C=2680.000000
012
014   B2: #     B3 <- B1  Freq: 1
014     movsd   XMM0, [constant table base + #8]        # load from
constant table: double=#10.000000
014
01c   B3: #     N1 <- B2 B1  Freq: 1
01c     addq    rsp, 16 # Destroy frame
        popq   rbp
        testl  rax, [rip + #offset_to_poll_page]        # Safepoint: poll for GC

027     ret


More information about the hotspot-dev mailing list