Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RISC-V] Update TODOs for RiscV64 Machine and Architecture in Crossgen2 #97021

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading