45 private final static int[] size_arm_mips_32 = { 4, 4, 4, 8, 8, 4, 4096 };
46 private final static int[] size_x86_32_unix = { 4, 4, 4, 8, 12, 4, 4096 };
47 private final static int[] size_x86_32_android = { 4, 4, 4, 8, 8, 4, 4096 };
48 private final static int[] size_x86_32_macos = { 4, 4, 4, 8, 16, 4, 4096 };
49 private final static int[] size_ppc_32_unix = { 4, 4, 4, 8, 16, 4, 4096 };
50 private final static int[] size_sparc_32_sunos = { 4, 4, 4, 8, 16, 4, 8192 };
51 private final static int[] size_x86_32_windows = { 4, 4, 4, 8, 12, 4, 4096 };
52 private final static int[] size_lp64_unix = { 4, 8, 4, 8, 16, 8, 4096 };
53 private final static int[] size_x86_64_windows = { 4, 4, 4, 8, 16, 8, 4096 };
54 private final static int[] size_arm64_ios = { 4, 8, 4, 8, 8, 8, 8192 };
57 private final static int[] align_arm_mips_32 = { 1, 2, 4, 8, 4, 4, 4, 8, 8, 4 };
58 private final static int[] align_x86_32_unix = { 1, 2, 4, 4, 4, 4, 4, 4, 4, 4 };
59 private final static int[] align_x86_32_macos = { 1, 2, 4, 4, 4, 4, 4, 4, 16, 4 };
60 private final static int[] align_ppc_32_unix = { 1, 2, 4, 8, 4, 4, 4, 8, 16, 4 };
61 private final static int[] align_sparc_32_sunos = { 1, 2, 4, 8, 4, 4, 4, 8, 8, 4 };
62 private final static int[] align_x86_32_windows = { 1, 2, 4, 8, 4, 4, 4, 8, 4, 4 };
63 private final static int[] align_lp64_unix = { 1, 2, 4, 8, 4, 8, 4, 8, 16, 8 };
64 private final static int[] align_x86_64_windows = { 1, 2, 4, 8, 4, 4, 4, 8, 16, 8 };
65 private final static int[] align_arm64_ios = { 1, 2, 4, 8, 4, 8, 4, 8, 8, 8 };
132 public final StringBuilder
toString(StringBuilder sb) {
134 sb =
new StringBuilder();
136 sb.append(
"MachineDataInfoStatic: ").append(this.name()).append(
"(").append(this.ordinal()).append(
"): ");
141 return this.name()+
"("+this.ordinal()+
")";
154 for(
int i=scs.length-1; i>=0; i--) {
156 for(
int j=scs.length-1; j>=0; j--) {
161 final String msg =
"Duplicate/Compatible MachineDataInfo in StaticConfigs: Elements ["+i+
": "+a.
toShortString()+
"] and ["+j+
": "+b.
toShortString()+
"]";
162 System.err.println(msg);
163 System.err.println(a);
164 System.err.println(b);
165 throw new InternalError(msg);
173 for(
int i=scs.length-1; i>=0; i--) {
183 final private boolean runtimeValidated;
185 final private int int8SizeInBytes = 1;
186 final private int int16SizeInBytes = 2;
187 final private int int32SizeInBytes = 4;
188 final private int int64SizeInBytes = 8;
190 final private int intSizeInBytes;
191 final private int longSizeInBytes;
192 final private int floatSizeInBytes;
193 final private int doubleSizeInBytes;
194 final private int ldoubleSizeInBytes;
195 final private int pointerSizeInBytes;
196 final private int pageSizeInBytes;
198 final private int int8AlignmentInBytes;
199 final private int int16AlignmentInBytes;
200 final private int int32AlignmentInBytes;
201 final private int int64AlignmentInBytes;
202 final private int intAlignmentInBytes;
203 final private int longAlignmentInBytes;
204 final private int floatAlignmentInBytes;
205 final private int doubleAlignmentInBytes;
206 final private int ldoubleAlignmentInBytes;
207 final private int pointerAlignmentInBytes;
211 final int intSizeInBytes,
212 final int longSizeInBytes,
213 final int floatSizeInBytes,
214 final int doubleSizeInBytes,
215 final int ldoubleSizeInBytes,
216 final int pointerSizeInBytes,
217 final int pageSizeInBytes,
219 final int int8AlignmentInBytes,
220 final int int16AlignmentInBytes,
221 final int int32AlignmentInBytes,
222 final int int64AlignmentInBytes,
223 final int intAlignmentInBytes,
224 final int longAlignmentInBytes,
225 final int floatAlignmentInBytes,
226 final int doubleAlignmentInBytes,
227 final int ldoubleAlignmentInBytes,
228 final int pointerAlignmentInBytes) {
229 this.runtimeValidated = runtimeValidated;
231 this.intSizeInBytes = intSizeInBytes;
232 this.longSizeInBytes = longSizeInBytes;
233 this.floatSizeInBytes = floatSizeInBytes;
234 this.doubleSizeInBytes = doubleSizeInBytes;
235 this.ldoubleSizeInBytes = ldoubleSizeInBytes;
236 this.pointerSizeInBytes = pointerSizeInBytes;
237 this.pageSizeInBytes = pageSizeInBytes;
239 this.int8AlignmentInBytes = int8AlignmentInBytes;
240 this.int16AlignmentInBytes = int16AlignmentInBytes;
241 this.int32AlignmentInBytes = int32AlignmentInBytes;
242 this.int64AlignmentInBytes = int64AlignmentInBytes;
243 this.intAlignmentInBytes = intAlignmentInBytes;
244 this.longAlignmentInBytes = longAlignmentInBytes;
245 this.floatAlignmentInBytes = floatAlignmentInBytes;
246 this.doubleAlignmentInBytes = doubleAlignmentInBytes;
247 this.ldoubleAlignmentInBytes = ldoubleAlignmentInBytes;
248 this.pointerAlignmentInBytes = pointerAlignmentInBytes;
255 return runtimeValidated;
285 return ( size + ( pageSizeInBytes - 1) ) / pageSizeInBytes ;
292 return pageCount(size) * pageSizeInBytes;
303 public final boolean equals(
final Object obj) {
304 if (
this == obj) {
return true; }
308 return pageSizeInBytes == md.pageSizeInBytes &&
322 return intSizeInBytes == md.intSizeInBytes &&
323 longSizeInBytes == md.longSizeInBytes &&
324 floatSizeInBytes == md.floatSizeInBytes &&
325 doubleSizeInBytes == md.doubleSizeInBytes &&
326 ldoubleSizeInBytes == md.ldoubleSizeInBytes &&
327 pointerSizeInBytes == md.pointerSizeInBytes &&
329 int8AlignmentInBytes == md.int8AlignmentInBytes &&
330 int16AlignmentInBytes == md.int16AlignmentInBytes &&
331 int32AlignmentInBytes == md.int32AlignmentInBytes &&
332 int64AlignmentInBytes == md.int64AlignmentInBytes &&
333 intAlignmentInBytes == md.intAlignmentInBytes &&
334 longAlignmentInBytes == md.longAlignmentInBytes &&
335 floatAlignmentInBytes == md.floatAlignmentInBytes &&
336 doubleAlignmentInBytes == md.doubleAlignmentInBytes &&
337 ldoubleAlignmentInBytes == md.ldoubleAlignmentInBytes &&
338 pointerAlignmentInBytes == md.pointerAlignmentInBytes ;
343 sb =
new StringBuilder();
345 sb.append(
"MachineDataInfo: runtimeValidated ").append(
isRuntimeValidated()).append(
", 32Bit ").append(4 == pointerAlignmentInBytes).append(
", primitive size / alignment:").append(
PlatformProps.
NEWLINE);
346 sb.append(
" int8 ").append(int8SizeInBytes) .append(
" / ").append(int8AlignmentInBytes);
347 sb.append(
", int16 ").append(int16SizeInBytes) .append(
" / ").append(int16AlignmentInBytes).append(
PlatformProps.
NEWLINE);
348 sb.append(
" int ").append(intSizeInBytes) .append(
" / ").append(intAlignmentInBytes);
349 sb.append(
", long ").append(longSizeInBytes) .append(
" / ").append(longAlignmentInBytes).append(
PlatformProps.
NEWLINE);
350 sb.append(
" int32 ").append(int32SizeInBytes) .append(
" / ").append(int32AlignmentInBytes);
351 sb.append(
", int64 ").append(int64SizeInBytes) .append(
" / ").append(int64AlignmentInBytes).append(
PlatformProps.
NEWLINE);
352 sb.append(
" float ").append(floatSizeInBytes) .append(
" / ").append(floatAlignmentInBytes);
353 sb.append(
", double ").append(doubleSizeInBytes) .append(
" / ").append(doubleAlignmentInBytes);
354 sb.append(
", ldouble ").append(ldoubleSizeInBytes).append(
" / ").append(ldoubleAlignmentInBytes).append(
PlatformProps.
NEWLINE);
355 sb.append(
" pointer ").append(pointerSizeInBytes).append(
" / ").append(pointerAlignmentInBytes);
356 sb.append(
", page ").append(pageSizeInBytes);
366 if( cpuType.is32Bit ) {
Machine data description for alignment and size onle, see com.jogamp.gluegen.
final int ldoubleAlignmentInBytes()
final int int64SizeInBytes()
static StaticConfig guessStaticMachineDataInfo(final PlatformTypes.OSType osType, final PlatformTypes.CPUType cpuType)
final int ldoubleSizeInBytes()
int pageCount(final int size)
final boolean equals(final Object obj)
Checks whether two size objects are equal.
final boolean compatible(final MachineDataInfo md)
Checks whether two MachineDataInfo objects are equal.
MachineDataInfo(final boolean runtimeValidated, final int intSizeInBytes, final int longSizeInBytes, final int floatSizeInBytes, final int doubleSizeInBytes, final int ldoubleSizeInBytes, final int pointerSizeInBytes, final int pageSizeInBytes, final int int8AlignmentInBytes, final int int16AlignmentInBytes, final int int32AlignmentInBytes, final int int64AlignmentInBytes, final int intAlignmentInBytes, final int longAlignmentInBytes, final int floatAlignmentInBytes, final int doubleAlignmentInBytes, final int ldoubleAlignmentInBytes, final int pointerAlignmentInBytes)
final int int8SizeInBytes()
StringBuilder toString(StringBuilder sb)
final int pointerSizeInBytes()
int pageAlignedSize(final int size)
final int floatSizeInBytes()
final int intAlignmentInBytes()
final int int32SizeInBytes()
final int floatAlignmentInBytes()
final int longSizeInBytes()
final int doubleSizeInBytes()
final int int64AlignmentInBytes()
final int int8AlignmentInBytes()
final int doubleAlignmentInBytes()
final int int16SizeInBytes()
final int longAlignmentInBytes()
final boolean isRuntimeValidated()
final int pointerAlignmentInBytes()
final int pageSizeInBytes()
final int int16AlignmentInBytes()
final int int32AlignmentInBytes()
final int intSizeInBytes()
Static enumeration of MachineDataInfo instances used for high performance data size and alignment loo...
final String toShortString()
static final StaticConfig findCompatible(final MachineDataInfo md)
final StringBuilder toString(StringBuilder sb)
X86_32_ANDROID
Platform.CPUType#X86_32 Android/Bionic
ARM_MIPS_32
Platform.CPUType#ARM or Platform.CPUType#MIPS_32
ARM64_IOS
Platform.CPUType#ARM64 iOS
X86_32_MACOS
Platform.CPUType#X86_32 MacOS (Special case gcc4/OSX)
StaticConfig(final int[] sizes, final int[] alignments)
X86_64_WINDOWS
Platform.CPUType#X86_64 Windows
SPARC_32_SUNOS
Platform.CPUType#SPARC_32 Solaris
static final void validateUniqueMachineDataInfo()
Static's MachineDataInfo shall be unique by the compatible criteria.
X86_32_WINDOWS
Platform.CPUType#X86_32 Windows
X86_32_UNIX
Platform.CPUType#X86_32 Unix
PPC_32_UNIX
Platform.CPUType#PPC Unix