Skip to content

Commit

Permalink
[LoongArch64] Add 'loongarch64' display in Crossgen2 and ILC cli. (#1…
Browse files Browse the repository at this point in the history
…07130)

* [LoongArch64] Add 'loongarch64' display in Crossgen2 and ILC cli.
* Add missing 'Architecture.LoongArch64' in libraries tests.
  • Loading branch information
LuckyXu-HF committed Aug 30, 2024
1 parent 51ec054 commit f0405a9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/tools/aot/ILCompiler/ILCompilerRootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public static IEnumerable<Func<HelpContext, bool>> GetExtendedHelp(HelpContext _
Console.WriteLine("Use the '--' option to disambiguate between input files that have begin with -- and options. After a '--' option, all arguments are " +
"considered to be input files. If no input files begin with '--' then this option is not necessary.\n");
string[] ValidArchitectures = new string[] { "arm", "arm64", "x86", "x64", "riscv64" };
string[] ValidArchitectures = new string[] { "arm", "arm64", "x86", "x64", "riscv64", "loongarch64" };
string[] ValidOS = new string[] { "windows", "linux", "freebsd", "osx", "maccatalyst", "ios", "iossimulator", "tvos", "tvossimulator" };
Console.WriteLine("Valid switches for {0} are: '{1}'. The default value is '{2}'\n", "--targetos", string.Join("', '", ValidOS), Helpers.GetTargetOS(null).ToString().ToLowerInvariant());
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public static IEnumerable<Func<HelpContext, bool>> GetExtendedHelp(HelpContext _
Console.WriteLine(SR.DashDashHelp);
Console.WriteLine();
string[] ValidArchitectures = new string[] {"arm", "armel", "arm64", "x86", "x64", "riscv64"};
string[] ValidArchitectures = new string[] {"arm", "armel", "arm64", "x86", "x64", "riscv64", "loongarch64"};
string[] ValidOS = new string[] {"windows", "linux", "osx"};
Console.WriteLine(String.Format(SR.SwitchWithDefaultHelp, "--targetos", String.Join("', '", ValidOS), Helpers.GetTargetOS(null).ToString().ToLowerInvariant()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public static partial class PlatformDetection
public static bool IsArmOrArm64Process => IsArmProcess || IsArm64Process;
public static bool IsNotArmNorArm64Process => !IsArmOrArm64Process;
public static bool IsS390xProcess => (int)RuntimeInformation.ProcessArchitecture == 5; // Architecture.S390x
public static bool IsLoongArch64Process => (int)RuntimeInformation.ProcessArchitecture == 6; // Architecture.LoongArch64;
public static bool IsArmv6Process => (int)RuntimeInformation.ProcessArchitecture == 7; // Architecture.Armv6
public static bool IsPpc64leProcess => (int)RuntimeInformation.ProcessArchitecture == 8; // Architecture.Ppc64le
public static bool IsRiscV64Process => (int)RuntimeInformation.ProcessArchitecture == 9; // Architecture.RiscV64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ private static int GetCurrentThreadId()
Architecture.S390x => 236,
Architecture.Ppc64le => 207,
Architecture.RiscV64 => 178,
Architecture.LoongArch64 => 178,
_ => 178,
};

Expand Down

0 comments on commit f0405a9

Please sign in to comment.