Class PrimitiveSizes
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.type.PrimitiveSizes
- All Implemented Interfaces:
IPrimitiveSizes
Standard implementation for the sizes of C primitives.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PrimitiveSizesTypical primitives sizes on 32-bit arch.: char=1, short=2, int=4, long=4 (!), long-long=8, float=4, double=8, long-double=10.static final PrimitiveSizesTypical primitives sizes on 64-bit arch.: char=1, short=2, int=4, long=8 (!), long-long=8, float=4, double=8, long-double=10.static final PrimitiveSizesGCC primitive sizes for ARM targets.static final PrimitiveSizesGCC primitive sizes for ARM64 targets.static final PrimitiveSizesGCC primitive sizes for MIPS targets.static final PrimitiveSizesGCC primitive sizes for x86 targets.static final PrimitiveSizesGCC primitive sizes for x86-64 targets.static final PrimitiveSizesMSVC primitive sizes for ARM targets.static final PrimitiveSizesMSVC primitive sizes for ARM64 targets.static final PrimitiveSizesGeneric MSVC primitive sizes.static final PrimitiveSizesMSVC primitive sizes for x86 targets.static final PrimitiveSizesMSVC primitive sizes for x86-64 targets. -
Constructor Summary
ConstructorsConstructorDescriptionPrimitiveSizes(int charSize, int shortSize, int intSize, int longSize, int longLongSize, int floatSize, int doubleSize, int longDoubleSize) Create primitive sizes.PrimitiveSizes(IPrimitiveSizes psizes) Copy primitive sizes. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintRetrieve the size ofchar.static PrimitiveSizesgetCommon(ProcessorType proctype, CompilerType comptype) Get common primitive sizes for a processor/compiler pair.intRetrieve the size ofdouble.intRetrieve the size offloat.intRetrieve the size ofint.intRetrieve the size oflong double.intRetrieve the size oflong long.intRetrieve the size oflong.intRetrieve the size ofshort.inthashCode()toString()
-
Field Details
-
GCC_ARM
GCC primitive sizes for ARM targets. -
GCC_ARM64
GCC primitive sizes for ARM64 targets. -
GCC_X86
GCC primitive sizes for x86 targets. -
GCC_X86_64
GCC primitive sizes for x86-64 targets. -
GCC_MIPS
GCC primitive sizes for MIPS targets. -
MSVC_GENERIC
Generic MSVC primitive sizes. -
MSVC_ARM
MSVC primitive sizes for ARM targets. -
MSVC_ARM64
MSVC primitive sizes for ARM64 targets. -
MSVC_X86
MSVC primitive sizes for x86 targets. -
MSVC_X86_64
MSVC primitive sizes for x86-64 targets. -
COMMON_PRIMITIVE_SIZES
Typical primitives sizes on 32-bit arch.: char=1, short=2, int=4, long=4 (!), long-long=8, float=4, double=8, long-double=10. Better to use compiler+processor-specific statics. -
COMMON_PRIMITIVE_SIZES64
Typical primitives sizes on 64-bit arch.: char=1, short=2, int=4, long=8 (!), long-long=8, float=4, double=8, long-double=10. Better to use compiler+processor-specific statics.
-
-
Constructor Details
-
PrimitiveSizes
public PrimitiveSizes(int charSize, int shortSize, int intSize, int longSize, int longLongSize, int floatSize, int doubleSize, int longDoubleSize) Create primitive sizes.- Parameters:
charSize-charsize in bytesshortSize-shortsize in bytesintSize-intsize in byteslongSize-longsize in byteslongLongSize-long longsize in bytesfloatSize-floatsize in bytesdoubleSize-doublesize in byteslongDoubleSize-long doublesize in bytes
-
PrimitiveSizes
Copy primitive sizes.- Parameters:
psizes- source primitive sizes
-
-
Method Details
-
getCommon
Get common primitive sizes for a processor/compiler pair.- Parameters:
proctype- processor type, or null for unknowncomptype- compiler type, or null for unknown- Returns:
- matching primitive sizes
-
getCharSize
public int getCharSize()Description copied from interface:IPrimitiveSizesRetrieve the size ofchar.- Specified by:
getCharSizein interfaceIPrimitiveSizes- Returns:
- size in bytes
-
getShortSize
public int getShortSize()Description copied from interface:IPrimitiveSizesRetrieve the size ofshort.- Specified by:
getShortSizein interfaceIPrimitiveSizes- Returns:
- size in bytes
-
getIntSize
public int getIntSize()Description copied from interface:IPrimitiveSizesRetrieve the size ofint.- Specified by:
getIntSizein interfaceIPrimitiveSizes- Returns:
- size in bytes
-
getLongSize
public int getLongSize()Description copied from interface:IPrimitiveSizesRetrieve the size oflong.- Specified by:
getLongSizein interfaceIPrimitiveSizes- Returns:
- size in bytes
-
getLongLongSize
public int getLongLongSize()Description copied from interface:IPrimitiveSizesRetrieve the size oflong long.- Specified by:
getLongLongSizein interfaceIPrimitiveSizes- Returns:
- size in bytes
-
getFloatSize
public int getFloatSize()Description copied from interface:IPrimitiveSizesRetrieve the size offloat.- Specified by:
getFloatSizein interfaceIPrimitiveSizes- Returns:
- size in bytes
-
getDoubleSize
public int getDoubleSize()Description copied from interface:IPrimitiveSizesRetrieve the size ofdouble.- Specified by:
getDoubleSizein interfaceIPrimitiveSizes- Returns:
- size in bytes
-
getLongDoubleSize
public int getLongDoubleSize()Description copied from interface:IPrimitiveSizesRetrieve the size oflong double.- Specified by:
getLongDoubleSizein interfaceIPrimitiveSizes- Returns:
- size in bytes
-
hashCode
public int hashCode() -
equals
-
toString
-