diff --git a/Editor/ABI/TypeCreatorBase.cs b/Editor/ABI/TypeCreatorBase.cs index 36cfa41..24e081f 100644 --- a/Editor/ABI/TypeCreatorBase.cs +++ b/Editor/ABI/TypeCreatorBase.cs @@ -70,7 +70,7 @@ namespace HybridCLR.Editor.ABI case ElementType.Module: case ElementType.Var: case ElementType.MVar: - return GetNativeIntTypeInfo(); + return GetNativeIntTypeInfo(); case ElementType.TypedByRef: return CreateValueType(type); case ElementType.ValueType: { @@ -105,7 +105,7 @@ namespace HybridCLR.Editor.ABI private static bool IsNotHFAFastCheck(int typeSize) { - return typeSize != 8 && typeSize != 12 && typeSize != 16 && typeSize != 24 && typeSize != 32; + return typeSize % 4 != 0 || typeSize > 32; } private static bool ComputHFATypeInfo0(TypeSig type, HFATypeInfo typeInfo) @@ -169,7 +169,7 @@ namespace HybridCLR.Editor.ABI return false; } bool ok = ComputHFATypeInfo0(type, typeInfo); - if (ok && typeInfo.Count >= 2 && typeInfo.Count <= 4) + if (ok && typeInfo.Count >= 1 && typeInfo.Count <= 4) { int fieldSize = typeInfo.Type.ElementType == ElementType.R4 ? 4 : 8; return typeSize == fieldSize * typeInfo.Count; @@ -293,6 +293,7 @@ namespace HybridCLR.Editor.ABI bool isFloat = hfaTypeInfo.Type.ElementType == ElementType.R4; switch (hfaTypeInfo.Count) { + case 1: return isFloat ? TypeInfo.s_r4 : TypeInfo.s_r8; case 2: return isFloat ? TypeInfo.s_vf2 : TypeInfo.s_vd2; case 3: return isFloat ? TypeInfo.s_vf3 : TypeInfo.s_vd3; case 4: return isFloat ? TypeInfo.s_vf4 : TypeInfo.s_vd4; diff --git a/Editor/ABI/TypeCreatorUniversal64.cs b/Editor/ABI/TypeCreatorUniversal64.cs index c4808ae..ec6fd6b 100644 --- a/Editor/ABI/TypeCreatorUniversal64.cs +++ b/Editor/ABI/TypeCreatorUniversal64.cs @@ -10,7 +10,7 @@ namespace HybridCLR.Editor.ABI { public override bool IsArch32 => false; - public override bool IsSupportHFA => true; + public override bool IsSupportHFA => false; protected override TypeInfo OptimizeSigType(TypeInfo type, bool returnType) {