Some questions about foreign api implement

ziai li zli817357 at gmail.com
Sat Sep 10 07:12:55 UTC 2022


Hi all:

I am very interested in the implementation of foreign api.
While reading the code, I have some questions about the code related to the
architecture.
For example, in file
src/java.base/share/classes/jdk/internal/foreign/abi/x64/X86_64Architecture.java

private static final int VECTOR_REG_SIZE = 16; // size of XMM register
VECTOR_REG_SIZE is assigned 16 bytes, 256-bit vectors and 512-bit vectors
also exist for x86.
So I don't quite understand why VECTOR_REG_SIZE is assigned to 16 bytes,
instead of 16 bytes, 32 bytes or 64 bytes depending on the vector type.
At the same time, in file cpu/x86/foreignGlobals_x86_64.cpp
int RegSpiller::pd_reg_size(VMReg reg) {
  if (reg->is_Register()) {
    return 8;
  } else if (reg->is_XMMRegister()) {
    return 16;
  }
  return 0; // stack and BAD
}
Is the 16 returned by RegSpiller::pd_reg_size set according to the value of
VECTOR_REG_SIZE?

Looking forward to your reply.
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20220910/b6d199ff/attachment.htm>


More information about the panama-dev mailing list