diff --git a/Ghidra/Debug/Framework-Debugging/src/main/java/ghidra/dbg/util/TargetDataTypeConverter.java b/Ghidra/Debug/Framework-Debugging/src/main/java/ghidra/dbg/util/TargetDataTypeConverter.java index 9d14d77dcb..7307af57fd 100644 --- a/Ghidra/Debug/Framework-Debugging/src/main/java/ghidra/dbg/util/TargetDataTypeConverter.java +++ b/Ghidra/Debug/Framework-Debugging/src/main/java/ghidra/dbg/util/TargetDataTypeConverter.java @@ -27,7 +27,6 @@ import ghidra.dbg.target.TargetDataTypeMember; import ghidra.dbg.target.TargetNamedDataType; import ghidra.dbg.util.PathUtils.TargetObjectKeyComparator; import ghidra.program.model.data.*; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.util.Msg; public class TargetDataTypeConverter { diff --git a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/symbol/AbstractDBTraceVariableSymbol.java b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/symbol/AbstractDBTraceVariableSymbol.java index e4e6c8675e..61ae964733 100644 --- a/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/symbol/AbstractDBTraceVariableSymbol.java +++ b/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/symbol/AbstractDBTraceVariableSymbol.java @@ -23,8 +23,8 @@ import db.DBRecord; import ghidra.program.database.data.DataTypeUtilities; import ghidra.program.model.address.Address; import ghidra.program.model.address.AddressSpace; +import ghidra.program.model.data.AbstractFloatDataType; import ghidra.program.model.data.DataType; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.program.model.lang.Register; import ghidra.program.model.listing.*; import ghidra.program.model.pcode.Varnode; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorModel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorModel.java index 229dc60db4..a5e078bc95 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorModel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorModel.java @@ -22,7 +22,6 @@ import ghidra.app.util.cparser.C.ParseException; import ghidra.app.util.parser.FunctionSignatureParser; import ghidra.program.model.address.Address; import ghidra.program.model.data.*; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.program.model.lang.*; import ghidra.program.model.listing.*; import ghidra.program.model.listing.Function.FunctionUpdateType; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/StorageAddressEditorDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/StorageAddressEditorDialog.java index d93e25a9bb..ecb59ff7d9 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/StorageAddressEditorDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/StorageAddressEditorDialog.java @@ -33,7 +33,6 @@ import ghidra.app.util.datatype.DataTypeSelectionEditor; import ghidra.app.util.datatype.NavigationDirection; import ghidra.program.model.address.Address; import ghidra.program.model.data.*; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.program.model.lang.Register; import ghidra.program.model.listing.*; import ghidra.util.HelpLocation; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf4/next/DWARFDataTypeManager.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf4/next/DWARFDataTypeManager.java index c1cb3cb9be..39d3b540e3 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf4/next/DWARFDataTypeManager.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf4/next/DWARFDataTypeManager.java @@ -25,7 +25,6 @@ import ghidra.app.util.bin.format.dwarf4.encoding.*; import ghidra.app.util.bin.format.dwarf4.expression.DWARFExpressionException; import ghidra.app.util.bin.format.dwarf4.next.DWARFDataTypeImporter.DWARFDataType; import ghidra.program.model.data.*; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.program.model.lang.CompilerSpec; import ghidra.program.model.listing.Program; import ghidra.util.Msg; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliAbstractSig.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliAbstractSig.java index a0d1d486a6..9897ffc86a 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliAbstractSig.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliAbstractSig.java @@ -25,8 +25,6 @@ import ghidra.app.util.bin.format.pe.cli.streams.CliStreamMetadata; import ghidra.app.util.bin.format.pe.cli.tables.*; import ghidra.app.util.bin.format.pe.cli.tables.indexes.CliIndexTypeDefOrRef; import ghidra.program.model.data.*; -import ghidra.program.model.data.floats.Float32DataType; -import ghidra.program.model.data.floats.Float64DataType; import ghidra.util.exception.InvalidInputException; public abstract class CliAbstractSig extends CliBlob implements CliRepresentable { @@ -141,9 +139,9 @@ public abstract class CliAbstractSig extends CliBlob implements CliRepresentable return UnsignedIntegerDataType.dataType; case ELEMENT_TYPE_R4: - return Float32DataType.dataType; + return Float4DataType.dataType; case ELEMENT_TYPE_R8: - return Float64DataType.dataType; + return Float8DataType.dataType; case ELEMENT_TYPE_I8: return LongLongDataType.dataType; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliBlobCustomAttrib.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliBlobCustomAttrib.java index a28a9fad82..f27e125b47 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliBlobCustomAttrib.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliBlobCustomAttrib.java @@ -32,8 +32,6 @@ import ghidra.app.util.bin.format.pe.cli.tables.CliTableMethodDef.CliMethodDefRo import ghidra.app.util.bin.format.pe.cli.tables.CliTypeTable; import ghidra.app.util.bin.format.pe.cli.tables.indexes.CliIndexCustomAttributeType; import ghidra.program.model.data.*; -import ghidra.program.model.data.floats.Float32DataType; -import ghidra.program.model.data.floats.Float64DataType; import ghidra.util.Msg; import ghidra.util.exception.InvalidInputException; @@ -412,12 +410,12 @@ public class CliBlobCustomAttrib extends CliBlob { case ELEMENT_TYPE_R4: addFixedArg(processFixedArgs, baseTypeCode, - reader.readNextByteArray(Float32DataType.dataType.getLength())); + reader.readNextByteArray(Float4DataType.dataType.getLength())); break; case ELEMENT_TYPE_R8: addFixedArg(processFixedArgs, baseTypeCode, - reader.readNextByteArray(Float64DataType.dataType.getLength())); + reader.readNextByteArray(Float8DataType.dataType.getLength())); break; case ELEMENT_TYPE_STRING: diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledDataType.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledDataType.java index 7c389cda9a..4be03fb360 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledDataType.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledDataType.java @@ -25,7 +25,6 @@ import org.apache.commons.lang3.StringUtils; import ghidra.program.database.data.DataTypeUtilities; import ghidra.program.model.data.*; import ghidra.program.model.data.Enum; -import ghidra.program.model.data.floats.Float128DataType; import ghidra.program.model.symbol.Namespace; /** @@ -284,7 +283,7 @@ public class DemangledDataType extends DemangledType { dt = FloatDataType.dataType; } else if (FLOAT128.equals(name)) { - dt = new TypedefDataType(FLOAT128, Float128DataType.dataType); + dt = new TypedefDataType(FLOAT128, Float16DataType.dataType); } else if (DOUBLE.equals(name)) { dt = DoubleDataType.dataType; diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/PdbPrimitiveTypeApplicator.java b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/PdbPrimitiveTypeApplicator.java index afedefb47d..8934c10f44 100644 --- a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/PdbPrimitiveTypeApplicator.java +++ b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/PdbPrimitiveTypeApplicator.java @@ -20,7 +20,6 @@ import java.util.*; import ghidra.app.util.bin.format.pdb2.pdbreader.PdbLog; import ghidra.app.util.bin.format.pdb2.pdbreader.type.PrimitiveMsType; import ghidra.program.model.data.*; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.util.exception.AssertException; /** diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeUtilities.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeUtilities.java index 1e303fdd64..91f137e655 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeUtilities.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeUtilities.java @@ -23,7 +23,6 @@ import ghidra.app.util.SymbolPathParser; import ghidra.docking.settings.Settings; import ghidra.program.model.data.*; import ghidra.program.model.data.Enum; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.program.model.listing.*; import ghidra.program.model.symbol.Namespace; import ghidra.util.UniversalID; diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AbstractComplexDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AbstractComplexDataType.java index b2c7000d51..3b42335909 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AbstractComplexDataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AbstractComplexDataType.java @@ -19,7 +19,6 @@ import java.math.BigDecimal; import generic.complex.Complex; import ghidra.docking.settings.Settings; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.program.model.mem.MemBuffer; import ghidra.program.model.mem.WrappedMemBuffer; diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/AbstractFloatDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AbstractFloatDataType.java similarity index 96% rename from Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/AbstractFloatDataType.java rename to Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AbstractFloatDataType.java index 37a69a6fb3..c77ca4af02 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/AbstractFloatDataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/AbstractFloatDataType.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.program.model.data.floats; +package ghidra.program.model.data; import java.math.BigInteger; import java.util.TreeMap; @@ -22,7 +22,6 @@ import ghidra.docking.settings.Settings; import ghidra.docking.settings.SettingsDefinition; import ghidra.pcode.floatformat.*; import ghidra.pcode.utils.Utils; -import ghidra.program.model.data.*; import ghidra.program.model.mem.MemBuffer; /** @@ -224,11 +223,11 @@ public abstract class AbstractFloatDataType extends BuiltIn { if (floatTypes == null) { // unsupported sizes filled-in with a null floatTypes = new TreeMap(); + floatTypes.put(Float2DataType.dataType.getLength(), Float2DataType.dataType); + floatTypes.put(Float4DataType.dataType.getLength(), Float4DataType.dataType); + floatTypes.put(Float8DataType.dataType.getLength(), Float8DataType.dataType); + floatTypes.put(Float10DataType.dataType.getLength(), Float10DataType.dataType); floatTypes.put(Float16DataType.dataType.getLength(), Float16DataType.dataType); - floatTypes.put(Float32DataType.dataType.getLength(), Float32DataType.dataType); - floatTypes.put(Float64DataType.dataType.getLength(), Float64DataType.dataType); - floatTypes.put(Float80DataType.dataType.getLength(), Float80DataType.dataType); - floatTypes.put(Float128DataType.dataType.getLength(), Float128DataType.dataType); } return floatTypes; } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex16DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex16DataType.java index 22c6f9a6e9..b8fbcfe862 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex16DataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex16DataType.java @@ -15,8 +15,6 @@ */ package ghidra.program.model.data; -import ghidra.program.model.data.floats.Float64DataType; - /** * Provides a definition of a {@code complex} built-in data type consisting of two 64-bit floating point * numbers in the IEEE 754 double precision format. @@ -30,7 +28,7 @@ public class Complex16DataType extends AbstractComplexDataType { } public Complex16DataType(DataTypeManager dtm) { - super("complex16", Float64DataType.dataType, dtm); + super("complex16", Float8DataType.dataType, dtm); } @Override diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex32DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex32DataType.java index 962733da77..03928f1098 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex32DataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex32DataType.java @@ -15,8 +15,6 @@ */ package ghidra.program.model.data; -import ghidra.program.model.data.floats.Float128DataType; - /** * Provides a definition of a {@code complex} built-in data type consisting of two 128-bit floating point * numbers in the IEEE 754 double precision format. @@ -30,7 +28,7 @@ public class Complex32DataType extends AbstractComplexDataType { } public Complex32DataType(DataTypeManager dtm) { - super("complex32", Float128DataType.dataType, dtm); + super("complex32", Float16DataType.dataType, dtm); } @Override diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex8DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex8DataType.java index 9f13ea46de..4441ff464a 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex8DataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Complex8DataType.java @@ -15,8 +15,6 @@ */ package ghidra.program.model.data; -import ghidra.program.model.data.floats.Float32DataType; - /** * Provides a definition of a {@code complex} built-in data type consisting of two 32-bit floating point * numbers in the IEEE 754 double precision format. @@ -31,7 +29,7 @@ public class Complex8DataType extends AbstractComplexDataType { } public Complex8DataType(DataTypeManager dtm) { - super("complex8", Float32DataType.dataType, dtm); + super("complex8", Float4DataType.dataType, dtm); } @Override diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DoubleDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DoubleDataType.java index ca5bd1435a..1066b0c21d 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DoubleDataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DoubleDataType.java @@ -15,8 +15,6 @@ */ package ghidra.program.model.data; -import ghidra.program.model.data.floats.AbstractFloatDataType; - /** * Provides a definition of a Double within a program. */ diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float32DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float10DataType.java similarity index 54% rename from Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float32DataType.java rename to Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float10DataType.java index b474c5e199..8460bdc622 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float32DataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float10DataType.java @@ -13,28 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.program.model.data.floats; +package ghidra.program.model.data; -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.DataTypeManager; -import ghidra.util.classfinder.ClassTranslator; +public class Float10DataType extends AbstractFloatDataType { -public class Float32DataType extends AbstractFloatDataType { + public static final Float10DataType dataType = new Float10DataType(); - static { - // remap old byte-sized float to this bit-sized equivalent - ClassTranslator.put( - "ghidra.program.model.data.Float4DataType", Float32DataType.class.getName()); - } - - public static final Float32DataType dataType = new Float32DataType(); - - public Float32DataType() { + public Float10DataType() { this(null); } - public Float32DataType(DataTypeManager dtm) { - super("float32", 4, dtm); + public Float10DataType(DataTypeManager dtm) { + super("float10", 10, dtm); } @Override @@ -42,7 +32,7 @@ public class Float32DataType extends AbstractFloatDataType { if (dtm == getDataTypeManager()) { return this; } - return new Float32DataType(dtm); + return new Float10DataType(dtm); } } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float16DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float16DataType.java similarity index 71% rename from Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float16DataType.java rename to Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float16DataType.java index ed1eb33309..1ad576cc2e 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float16DataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float16DataType.java @@ -13,20 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.program.model.data.floats; - -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.DataTypeManager; -import ghidra.util.classfinder.ClassTranslator; +package ghidra.program.model.data; public class Float16DataType extends AbstractFloatDataType { - static { - // remap old byte-sized float to this bit-sized equivalent - ClassTranslator.put( - "ghidra.program.model.data.Float2DataType", Float16DataType.class.getName()); - } - public static final Float16DataType dataType = new Float16DataType(); public Float16DataType() { @@ -34,7 +24,7 @@ public class Float16DataType extends AbstractFloatDataType { } public Float16DataType(DataTypeManager dtm) { - super("float16", 2, dtm); + super("float16", 16, dtm); } @Override diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float64DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float2DataType.java similarity index 53% rename from Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float64DataType.java rename to Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float2DataType.java index e47ac698c3..9f854a17be 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float64DataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float2DataType.java @@ -13,28 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.program.model.data.floats; +package ghidra.program.model.data; -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.DataTypeManager; -import ghidra.util.classfinder.ClassTranslator; +public class Float2DataType extends AbstractFloatDataType { -public class Float64DataType extends AbstractFloatDataType { + public static final Float2DataType dataType = new Float2DataType(); - static { - // remap old byte-sized float to this bit-sized equivalent - ClassTranslator.put( - "ghidra.program.model.data.Float8DataType", Float64DataType.class.getName()); - } - - public static final Float64DataType dataType = new Float64DataType(); - - public Float64DataType() { + public Float2DataType() { this(null); } - public Float64DataType(DataTypeManager dtm) { - super("float64", 8, dtm); + public Float2DataType(DataTypeManager dtm) { + super("float2", 2, dtm); } @Override @@ -42,7 +32,7 @@ public class Float64DataType extends AbstractFloatDataType { if (dtm == getDataTypeManager()) { return this; } - return new Float64DataType(dtm); + return new Float2DataType(dtm); } } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float80DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float4DataType.java similarity index 53% rename from Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float80DataType.java rename to Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float4DataType.java index ce44c095b5..1c49f240f7 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float80DataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float4DataType.java @@ -13,28 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.program.model.data.floats; +package ghidra.program.model.data; -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.DataTypeManager; -import ghidra.util.classfinder.ClassTranslator; +public class Float4DataType extends AbstractFloatDataType { -public class Float80DataType extends AbstractFloatDataType { + public static final Float4DataType dataType = new Float4DataType(); - static { - // remap old byte-sized float to this bit-sized equivalent - ClassTranslator.put( - "ghidra.program.model.data.Float10DataType", Float80DataType.class.getName()); - } - - public static final Float80DataType dataType = new Float80DataType(); - - public Float80DataType() { + public Float4DataType() { this(null); } - public Float80DataType(DataTypeManager dtm) { - super("float80", 10, dtm); + public Float4DataType(DataTypeManager dtm) { + super("float4", 4, dtm); } @Override @@ -42,7 +32,7 @@ public class Float80DataType extends AbstractFloatDataType { if (dtm == getDataTypeManager()) { return this; } - return new Float80DataType(dtm); + return new Float4DataType(dtm); } } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float8DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float8DataType.java new file mode 100644 index 0000000000..46bf21db90 --- /dev/null +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/Float8DataType.java @@ -0,0 +1,38 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.program.model.data; + +public class Float8DataType extends AbstractFloatDataType { + + public static final Float8DataType dataType = new Float8DataType(); + + public Float8DataType() { + this(null); + } + + public Float8DataType(DataTypeManager dtm) { + super("float8", 8, dtm); + } + + @Override + public DataType clone(DataTypeManager dtm) { + if (dtm == getDataTypeManager()) { + return this; + } + return new Float8DataType(dtm); + } + +} diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/FloatDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/FloatDataType.java index 8504a7901a..6261f7a88c 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/FloatDataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/FloatDataType.java @@ -15,8 +15,6 @@ */ package ghidra.program.model.data; -import ghidra.program.model.data.floats.AbstractFloatDataType; - /** * Provides a definition of a Float within a program. */ diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/LongDoubleDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/LongDoubleDataType.java index 5ca62c22fa..c8002be9d9 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/LongDoubleDataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/LongDoubleDataType.java @@ -15,8 +15,6 @@ */ package ghidra.program.model.data; -import ghidra.program.model.data.floats.AbstractFloatDataType; - /** * Provides a definition of a Long Double within a program. */ diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/MetaDataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/MetaDataType.java index fe80736638..fccda02918 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/MetaDataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/MetaDataType.java @@ -15,8 +15,6 @@ */ package ghidra.program.model.data; -import ghidra.program.model.data.floats.AbstractFloatDataType; - public enum MetaDataType { // Enumerations are ordered in terms of how "specific" the data-type class is VOID, // "void" data-type diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float128DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float128DataType.java deleted file mode 100644 index 8d2e12c2b2..0000000000 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/floats/Float128DataType.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.program.model.data.floats; - -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.DataTypeManager; -import ghidra.util.classfinder.ClassTranslator; - -public class Float128DataType extends AbstractFloatDataType { - - static { - // remap old byte-sized float to this bit-sized equivalent - ClassTranslator.put( - "ghidra.program.model.data.Float16DataType", Float128DataType.class.getName()); - } - - public static final Float128DataType dataType = new Float128DataType(); - - public Float128DataType() { - this(null); - } - - public Float128DataType(DataTypeManager dtm) { - super("float128", 16, dtm); - } - - @Override - public DataType clone(DataTypeManager dtm) { - if (dtm == getDataTypeManager()) { - return this; - } - return new Float128DataType(dtm); - } - -} diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/ParamEntry.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/ParamEntry.java index bcf5c21328..5e58ed87be 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/ParamEntry.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/ParamEntry.java @@ -26,7 +26,6 @@ import ghidra.app.plugin.processors.sleigh.VarnodeData; import ghidra.program.model.address.Address; import ghidra.program.model.address.AddressSpace; import ghidra.program.model.data.*; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.program.model.pcode.*; import ghidra.util.SystemUtilities; import ghidra.util.xml.SpecXmlUtils; diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java index d8c7c3feb8..8a86f81c15 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java @@ -20,7 +20,6 @@ import java.util.*; import ghidra.program.database.data.DataTypeUtilities; import ghidra.program.model.address.Address; import ghidra.program.model.data.*; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.program.model.lang.*; import ghidra.program.model.pcode.Varnode; import ghidra.program.model.symbol.Namespace; diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/MappedEntry.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/MappedEntry.java index ff84ba3c02..b701cbbe54 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/MappedEntry.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/MappedEntry.java @@ -18,7 +18,7 @@ package ghidra.program.model.pcode; import java.io.IOException; import ghidra.program.model.address.Address; -import ghidra.program.model.data.floats.AbstractFloatDataType; +import ghidra.program.model.data.AbstractFloatDataType; import ghidra.program.model.listing.Program; import ghidra.program.model.listing.VariableStorage; import ghidra.program.model.mem.MemoryBlock; diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java index 816536fbe3..0cd03a5dfa 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeDataTypeManager.java @@ -28,7 +28,6 @@ import ghidra.program.database.data.PointerTypedefInspector; import ghidra.program.model.address.AddressSpace; import ghidra.program.model.data.*; import ghidra.program.model.data.Enum; -import ghidra.program.model.data.floats.AbstractFloatDataType; import ghidra.program.model.lang.CompilerSpec; import ghidra.program.model.lang.DecompilerLanguage; import ghidra.program.model.listing.Program; diff --git a/Ghidra/Framework/SoftwareModeling/src/test.slow/java/ghidra/program/model/data/FloatDataTypeTest.java b/Ghidra/Framework/SoftwareModeling/src/test.slow/java/ghidra/program/model/data/FloatDataTypeTest.java index 4e68231b0d..89b82ce1c6 100644 --- a/Ghidra/Framework/SoftwareModeling/src/test.slow/java/ghidra/program/model/data/FloatDataTypeTest.java +++ b/Ghidra/Framework/SoftwareModeling/src/test.slow/java/ghidra/program/model/data/FloatDataTypeTest.java @@ -21,8 +21,6 @@ import org.junit.Test; import generic.test.AbstractGTest; import ghidra.pcode.floatformat.*; -import ghidra.program.model.data.floats.Float32DataType; -import ghidra.program.model.data.floats.Float64DataType; import ghidra.program.model.mem.ByteMemBufferImpl; import ghidra.util.LittleEndianDataConverter; @@ -42,49 +40,49 @@ public class FloatDataTypeTest extends AbstractGTest { int bits = Float.floatToRawIntBits(Float.NaN); byte[] bytes = getBytes(bits, 4); Object value = - Float32DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float4DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals(ff.getBigNaN(false), value); bits = Float.floatToRawIntBits(Float.POSITIVE_INFINITY); bytes = getBytes(bits, 4); value = - Float32DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float4DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals(ff.getBigInfinity(false), value); bits = Float.floatToRawIntBits(Float.NEGATIVE_INFINITY); bytes = getBytes(bits, 4); value = - Float32DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float4DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals(ff.getBigInfinity(true), value); bits = Float.floatToRawIntBits(0F); bytes = getBytes(bits, 4); value = - Float32DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float4DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("0.0", ff.toDecimalString((BigFloat) value)); bits = Float.floatToRawIntBits(1F); bytes = getBytes(bits, 4); value = - Float32DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float4DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("1.0", ff.toDecimalString((BigFloat) value)); bits = Float.floatToRawIntBits(-1F); bytes = getBytes(bits, 4); value = - Float32DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float4DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("-1.0", ff.toDecimalString((BigFloat) value)); bits = Float.floatToRawIntBits(555.555F); bytes = getBytes(bits, 4); value = - Float32DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float4DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("555.55499", ff.toDecimalString((BigFloat) value, true)); bits = Float.floatToRawIntBits(-555.555F); bytes = getBytes(bits, 4); value = - Float32DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float4DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("-555.55499", ff.toDecimalString((BigFloat) value, true)); } @@ -97,49 +95,49 @@ public class FloatDataTypeTest extends AbstractGTest { long bits = Double.doubleToRawLongBits(Double.NaN); byte[] bytes = getBytes(bits, 8); Object value = - Float64DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float8DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals(ff.getBigNaN(false), value); bits = Double.doubleToRawLongBits(Double.POSITIVE_INFINITY); bytes = getBytes(bits, 8); value = - Float64DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float8DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals(ff.getBigInfinity(false), value); bits = Double.doubleToRawLongBits(Double.NEGATIVE_INFINITY); bytes = getBytes(bits, 8); value = - Float64DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float8DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals(ff.getBigInfinity(true), value); bits = Double.doubleToRawLongBits(0D); bytes = getBytes(bits, 8); value = - Float64DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float8DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("0.0", ff.toDecimalString((BigFloat) value)); bits = Double.doubleToRawLongBits(1D); bytes = getBytes(bits, 8); value = - Float64DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float8DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("1.0", ff.toDecimalString((BigFloat) value)); bits = Double.doubleToRawLongBits(-1D); bytes = getBytes(bits, 8); value = - Float64DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float8DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("-1.0", ff.toDecimalString((BigFloat) value)); bits = Double.doubleToRawLongBits(555.555D); bytes = getBytes(bits, 8); value = - Float64DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float8DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("555.5549999999999", ff.toDecimalString((BigFloat) value, true)); bits = Double.doubleToRawLongBits(-555.555D); bytes = getBytes(bits, 8); value = - Float64DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); + Float8DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, false), null, 10); assertEquals("-555.5549999999999", ff.toDecimalString((BigFloat) value, true)); } diff --git a/Ghidra/Framework/SoftwareModeling/src/test/java/ghidra/program/model/data/Float80DataTypeTest.java b/Ghidra/Framework/SoftwareModeling/src/test/java/ghidra/program/model/data/Float10DataTypeTest.java similarity index 77% rename from Ghidra/Framework/SoftwareModeling/src/test/java/ghidra/program/model/data/Float80DataTypeTest.java rename to Ghidra/Framework/SoftwareModeling/src/test/java/ghidra/program/model/data/Float10DataTypeTest.java index 1d3540c72a..5e2341f5a9 100644 --- a/Ghidra/Framework/SoftwareModeling/src/test/java/ghidra/program/model/data/Float80DataTypeTest.java +++ b/Ghidra/Framework/SoftwareModeling/src/test/java/ghidra/program/model/data/Float10DataTypeTest.java @@ -23,11 +23,10 @@ import org.junit.Test; import generic.test.AbstractGTest; import ghidra.pcode.floatformat.*; import ghidra.program.model.address.Address; -import ghidra.program.model.data.floats.Float80DataType; import ghidra.program.model.mem.ByteMemBufferImpl; import ghidra.program.model.mem.MemBuffer; -public class Float80DataTypeTest extends AbstractGTest { +public class Float10DataTypeTest extends AbstractGTest { @Test public void testGetValue() { @@ -36,19 +35,19 @@ public class Float80DataTypeTest extends AbstractGTest { byte[] bytes = bytes(0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0); // 0x7fff0000000000000000 = +infinity BigFloat value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); Assert.assertEquals(ff.getBigInfinity(false), value); Assert.assertEquals("+Infinity", ff.toDecimalString(value, true)); bytes = bytes(0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0); // 0xffff0000000000000000 = -infinity value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); Assert.assertEquals(ff.getBigInfinity(true), value); Assert.assertEquals("-Infinity", ff.toDecimalString(value, true)); bytes = bytes(0x7f, 0xff, 0x80, 0, 0, 0, 0, 0, 0, 0); // 0x7fff8000000000000000 = NaN value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); Assert.assertEquals(ff.getBigNaN(false), value); Assert.assertEquals("NaN", ff.toDecimalString(value, true)); @@ -57,13 +56,13 @@ public class Float80DataTypeTest extends AbstractGTest { bytes = bytes(0x3c, 1, 0x80, 0, 0, 0, 0, 0, 0, 0); value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); Assert.assertEquals("2.22507385850720138E-308", ff.toDecimalString(value, true)); bytes = bytes(0xbc, 1, 0x80, 0, 0, 0, 0, 0, 0, 0); value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); Assert.assertEquals("-2.22507385850720138E-308", ff.toDecimalString(value, true)); @@ -71,26 +70,26 @@ public class Float80DataTypeTest extends AbstractGTest { bytes = bytes(0, 0, 0, 0, 0, 0, 0, 0, 0, 1); value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); assertEquals(ff.minValue, value); Assert.assertEquals("3.6E-4951", ff.toDecimalString(value, true)); bytes = bytes(0x80, 0, 0, 0, 0, 0, 0, 0, 0, 1); value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); Assert.assertEquals("-3.6E-4951", ff.toDecimalString(value, true)); // Really big values maximum - approaches -infinity bytes = bytes(0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff); value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); assertEquals(ff.maxValue, value); Assert.assertEquals("1.18973149535723177E+4932", ff.toDecimalString(value, true)); bytes = bytes(0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff); value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); Assert.assertEquals("-1.18973149535723177E+4932", ff.toDecimalString(value, true)); // Values within the range of Double @@ -100,12 +99,12 @@ public class Float80DataTypeTest extends AbstractGTest { bytes = bytes(0x40, 0, 0xc9, 0x0f, 0xda, 0xa2, 0x21, 0x68, 0xc0, 0); value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); Assert.assertEquals("3.14159265358979312", ff.toDecimalString(value, true)); bytes = bytes(0xc0, 0, 0xc9, 0x0f, 0xda, 0xa2, 0x21, 0x68, 0xc0, 0); value = - Float80DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); + Float10DataType.dataType.getValue(new ByteMemBufferImpl(null, bytes, true), null, 10); Assert.assertEquals("-3.14159265358979312", ff.toDecimalString(value, true)); } @@ -123,36 +122,36 @@ public class Float80DataTypeTest extends AbstractGTest { byte[] bytes = bytes(0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0); // 0x7fff0000000000000000 = +infinity assertArrayEquals(bytes, - Float80DataType.dataType.encodeValue(ff.getBigFloat("+Infinity"), BE, null, -1)); + Float10DataType.dataType.encodeValue(ff.getBigFloat("+Infinity"), BE, null, -1)); bytes = bytes(0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0); // 0xffff0000000000000000 = -infinity assertArrayEquals(bytes, - Float80DataType.dataType.encodeValue(ff.getBigFloat("-Infinity"), BE, null, -1)); + Float10DataType.dataType.encodeValue(ff.getBigFloat("-Infinity"), BE, null, -1)); bytes = bytes(0x7f, 0xff, 0x80, 0, 0, 0, 0, 0, 0, 0); // 0x7fff8000000000000000 = NaN assertArrayEquals(bytes, - Float80DataType.dataType.encodeValue(ff.getBigFloat("NaN"), BE, null, -1)); + Float10DataType.dataType.encodeValue(ff.getBigFloat("NaN"), BE, null, -1)); // NOTE: Multiple byte[] values can render the same decimal string - bytes = Float80DataType.dataType + bytes = Float10DataType.dataType .encodeValue(ff.getBigFloat("5.04315471466814026E-4932"), BE, null, -1); - assertEquals("5.04315471466814026E-4932", Float80DataType.dataType + assertEquals("5.04315471466814026E-4932", Float10DataType.dataType .getRepresentation(new ByteMemBufferImpl(null, bytes, true), null, -1)); - bytes = Float80DataType.dataType.encodeValue(ff.getBigFloat("-5.04315471466814026E-4932"), + bytes = Float10DataType.dataType.encodeValue(ff.getBigFloat("-5.04315471466814026E-4932"), BE, null, -1); - assertEquals("-5.04315471466814026E-4932", Float80DataType.dataType + assertEquals("-5.04315471466814026E-4932", Float10DataType.dataType .getRepresentation(new ByteMemBufferImpl(null, bytes, true), null, -1)); - bytes = Float80DataType.dataType + bytes = Float10DataType.dataType .encodeValue(ff.getBigFloat("8.92298621517923824E+4931"), BE, null, -1); - assertEquals("8.92298621517923824E+4931", Float80DataType.dataType + assertEquals("8.92298621517923824E+4931", Float10DataType.dataType .getRepresentation(new ByteMemBufferImpl(null, bytes, true), null, -1)); - bytes = Float80DataType.dataType.encodeValue(ff.getBigFloat("-8.92298621517923824E+4931"), + bytes = Float10DataType.dataType.encodeValue(ff.getBigFloat("-8.92298621517923824E+4931"), BE, null, -1); - assertEquals("-8.92298621517923824E+4931", Float80DataType.dataType + assertEquals("-8.92298621517923824E+4931", Float10DataType.dataType .getRepresentation(new ByteMemBufferImpl(null, bytes, true), null, -1)); }