Skip to content

Commit

Permalink
Update TODOs for RiscV64 Machine and Architecture in Crossgen2
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaurtaev committed Feb 6, 2024
1 parent 12db245 commit 73800e9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/tools/Common/CommandLineHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static TargetArchitecture GetTargetArchitecture(string token)
Architecture.Arm => TargetArchitecture.ARM,
Architecture.Arm64 => TargetArchitecture.ARM64,
Architecture.LoongArch64 => TargetArchitecture.LoongArch64,
(Architecture)9 => TargetArchitecture.RiscV64, /* TODO: update with Architecture.RiscV64 */
Architecture.RiscV64 => TargetArchitecture.RiscV64,
_ => throw new NotImplementedException()
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static Machine MachineFromTarget(this TargetDetails target)
return Machine.LoongArch64;

case Internal.TypeSystem.TargetArchitecture.RiscV64:
return (Machine)0x5064; /* TODO: update with RiscV64 */
return Machine.RiscV64;

default:
throw new NotImplementedException(target.Architecture.ToString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ internal GcInfoTypes(Machine machine)
STACK_BASE_REGISTER_ENCBASE = 2;
NUM_REGISTERS_ENCBASE = 3;
break;
case (Machine)0x5064: /* TODO: update with RiscV64 */
case Machine.RiscV64:
SIZE_OF_RETURN_KIND_FAT = 4;
STACK_BASE_REGISTER_ENCBASE = 2;
NUM_REGISTERS_ENCBASE = 3;
Expand All @@ -170,7 +170,7 @@ internal int DenormalizeCodeLength(int x)
return (x << 1);
case Machine.Arm64:
case Machine.LoongArch64:
case (Machine)0x5064: /* TODO: update with RiscV64 */
case Machine.RiscV64:
return (x << 2);
}
return x;
Expand All @@ -186,7 +186,7 @@ internal int DenormalizeStackSlot(int x)
return (x << 2);
case Machine.Arm64:
case Machine.LoongArch64:
case (Machine)0x5064: /* TODO: update with RiscV64 */
case Machine.RiscV64:
return (x << 3);
}
return x;
Expand All @@ -204,7 +204,7 @@ internal uint DenormalizeStackBaseRegister(uint x)
return (x ^ 29);
case Machine.LoongArch64:
return ((x ^ 22) & 0x3);
case (Machine)0x5064: /* TODO: update with RiscV64 */
case Machine.RiscV64:
return (x ^ 8);
}
return x;
Expand All @@ -220,7 +220,7 @@ internal uint DenormalizeSizeOfStackArea(uint x)
return (x << 2);
case Machine.Arm64:
case Machine.LoongArch64:
case (Machine)0x5064: /* TODO: update with RiscV64 */
case Machine.RiscV64:
return (x << 3);
}
return x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ private unsafe void EnsureHeader()
case Machine.Amd64:
case Machine.Arm64:
case Machine.LoongArch64:
case (Machine)0x5064: /* TODO: update with RiscV64 */
case Machine.RiscV64:
_pointerSize = 8;
break;

Expand Down Expand Up @@ -1417,7 +1417,7 @@ private void EnsureImportSections()
case Machine.Amd64:
case Machine.Arm64:
case Machine.LoongArch64:
case (Machine)0x5064: /* TODO: update with RiscV64 */
case Machine.RiscV64:
entrySize = 8;
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static TransitionBlock FromReader(ReadyToRunReader reader)
case Machine.LoongArch64:
return LoongArch64TransitionBlock.Instance;

case (Machine)0x5064: /* TODO: update with RiscV64 */
case Machine.RiscV64:
return RiscV64TransitionBlock.Instance;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static PEHeaderBuilder CreateLibraryHeader()
return new PEHeaderBuilder(imageCharacteristics: Characteristics.ExecutableImage | Characteristics.Dll);
}

internal bool Is32Bit => Machine != Machine.Amd64 && Machine != Machine.IA64 && Machine != Machine.Arm64 && Machine != (Machine)0x5064; /* TODO: update with RiscV64 */
internal bool Is32Bit => Machine != Machine.Amd64 && Machine != Machine.IA64 && Machine != Machine.Arm64 && Machine != Machine.RiscV64;

internal int ComputeSizeOfPEHeaders(int sectionCount) =>
PEBuilder.DosHeaderSize +
Expand Down

0 comments on commit 73800e9

Please sign in to comment.