From b70e60322d87b8859f371dd97d5fbba6d661bc1f Mon Sep 17 00:00:00 2001 From: VincentWu <43398706+Xinlong-Wu@users.noreply.github.com> Date: Sat, 17 Feb 2024 11:32:27 +0000 Subject: [PATCH] address comment --- src/mono/mono/mini/method-to-ir.c | 2 +- src/mono/sample/TestRun/.gdbinit | 30 ---- src/mono/sample/TestRun/Makefile | 149 ------------------ src/mono/sample/TestRun/TestRun.cs | 23 --- src/mono/sample/TestRun/TestRun.csproj | 61 ------- .../sample/TestRun/TestRun.runtimeconfig.json | 9 -- 6 files changed, 1 insertion(+), 273 deletions(-) delete mode 100644 src/mono/sample/TestRun/.gdbinit delete mode 100644 src/mono/sample/TestRun/Makefile delete mode 100644 src/mono/sample/TestRun/TestRun.cs delete mode 100644 src/mono/sample/TestRun/TestRun.csproj delete mode 100644 src/mono/sample/TestRun/TestRun.runtimeconfig.json diff --git a/src/mono/mono/mini/method-to-ir.c b/src/mono/mono/mini/method-to-ir.c index cc5a42b2f191e..9330a5b7f686b 100644 --- a/src/mono/mono/mini/method-to-ir.c +++ b/src/mono/mono/mini/method-to-ir.c @@ -8899,8 +8899,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b ins->sreg2 = sp [1]->dreg; type_from_op (cfg, ins, sp [0], sp [1]); CHECK_TYPE (ins); - // Don't multiply r4 with r8, In RISC-V #ifdef TARGET_RISCV + // Don't multiply r4 with r8 in RISC-V if (((sp [0]->type == STACK_R4 && sp [1]->type == STACK_R8) || (sp [0]->type == STACK_R8 && sp [1]->type == STACK_R4))) add_widen_op (cfg, ins, &sp [0], &sp [1]); diff --git a/src/mono/sample/TestRun/.gdbinit b/src/mono/sample/TestRun/.gdbinit deleted file mode 100644 index 046cd12aa8623..0000000000000 --- a/src/mono/sample/TestRun/.gdbinit +++ /dev/null @@ -1,30 +0,0 @@ -handle SIGXCPU SIG33 SIG35 SIG36 SIG37 SIG38 SIGPWR nostop print - -define mono_backtrace - select-frame 0 - set $i = 0 - while ($i < $arg0) - set $foo = (char*) mono_pmip ($pc) - if ($foo) - printf "#%d %p in %s\n", $i, $pc, $foo - else - frame - end - up-silently - set $i = $i + 1 - end -end - -define mono_stack - set $mono_thread = mono_thread_current () - if ($mono_thread == 0x00) - printf "No mono thread associated with this thread\n" - else - set $ucp = (MonoContext*)malloc (sizeof (MonoContext)) - set $ucp->gregs[0] = $pc - set $ucp->gregs[2] = $sp - set $ucp->gregs[8] = $sp - call (void) mono_print_thread_dump ($ucp) - call (void) free ($ucp) - end -end diff --git a/src/mono/sample/TestRun/Makefile b/src/mono/sample/TestRun/Makefile deleted file mode 100644 index 7a6848cc934db..0000000000000 --- a/src/mono/sample/TestRun/Makefile +++ /dev/null @@ -1,149 +0,0 @@ -TOP=../../../../ -DOTNET:=$(TOP)dotnet.sh -DOTNET_Q_ARGS=--nologo -v:q -consoleloggerparameters:NoSummary - -MONO_CONFIG?=Debug -MONO_ARCH=riscv64 -TARGET_OS=linux -AOT?=false -QEMU=qemu-riscv64-static -SAMPLE_PATH=/home/wuxinlong/workspace/samples/csharp/getting-started/console-webapiclient -CORE_BASELINE_ROOT=/home/wuxinlong/workspace/runtime/artifacts/tests/coreclr/linux.x64.Debug/Tests/Core_Root -ANY_PATH= /home/wuxinlong/workspace/runtime/artifacts/tests/coreclr/linux.riscv64.Debug/JIT/Directed/Directed_3/Directed_3.dll - -GitHubKey=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 - -#NET_TRACE_PATH= -#PGO_BINARY_PATH= -#MIBC_PROFILE_PATH= - -MONO_ENV_DEBUG_OPTIONS = "-v --trace=all --break AliasingRetBuf:TestEntryPoint" -MONO_ENV_RUN_OPTIONS="--trace=N:System.AppContext" - -build: TestRun.cs - @mcs TestRun.cs - -run-baseline: build - COMPlus_DebugWriteToStdErr=1 \ - MONO_ENV_OPTIONS=$(MONO_ENV_RUN_OPTIONS) \ - $(TOP)artifacts/bin/testhost/net8.0-$(TARGET_OS)-Debug-x64/dotnet TestRun.exe - -run-any-baseline: - COMPlus_DebugWriteToStdErr=1 \ - MONO_ENV_OPTIONS=$(MONO_ENV_RUN_OPTIONS) \ - CORE_ROOT=${CORE_BASELINE_ROOT} \ - ${CORE_BASELINE_ROOT}/corerun -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true $(ANY_PATH) - -run: build - @COMPlus_DebugWriteToStdErr=1 \ - MONO_ENV_OPTIONS=$(MONO_ENV_RUN_OPTIONS) \ - $(QEMU) -L $(TOP)/.tools/rootfs/riscv64/ $(TOP)artifacts/bin/testhost/net9.0-$(TARGET_OS)-Debug-$(MONO_ARCH)/dotnet TestRun.exe - -run-any: - COMPlus_DebugWriteToStdErr=1 \ - MONO_ENV_OPTIONS=$(MONO_ENV_RUN_OPTIONS) \ - ${CORE_ROOT}/corerun -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true $(ANY_PATH) - -run-webapiclient-baseline: - COMPlus_DebugWriteToStdErr=1 \ - MONO_ENV_OPTIONS=$(MONO_ENV_RUN_OPTIONS) \ - $(TOP)artifacts/bin/testhost/net8.0-$(TARGET_OS)-Debug-x64/dotnet \ - $(SAMPLE_PATH)/bin/Debug/net8.0/webapiclient.dll - -run-webapiclient: - COMPlus_DebugWriteToStdErr=1 \ - MONO_ENV_OPTIONS=$(MONO_ENV_RUN_OPTIONS) \ - $(QEMU) -L $(TOP).tools/rootfs/riscv64/ \ - $(TOP)artifacts/bin/testhost/net8.0-linux-Debug-riscv64/dotnet \ - $(SAMPLE_PATH)/bin/Debug/net8.0/webapiclient.dll - -debug: build - COMPlus_DebugWriteToStdErr=1 \ - MONO_LOG_LEVEL=debug MONO_LOG_MASK=all \ - MONO_ENV_OPTIONS=$(MONO_ENV_DEBUG_OPTIONS) \ - $(QEMU) -L $(TOP)/.tools/rootfs/riscv64/ \ - -g 12345 \ - $(TOP)artifacts/bin/testhost/net8.0-$(TARGET_OS)-Debug-$(MONO_ARCH)/dotnet TestRun.exe &\ - gdb-multiarch -ex 'target remote localhost:12345' \ - -ex "set sysroot $(TOP).tools/rootfs/riscv64" -ex "set solib-search-path $(TOP)artifacts/bin/testhost/net8.0-linux-Debug-riscv64/shared/Microsoft.NETCore.App/8.0.0" \ - -ex "b mini.c:2156" \ - $(TOP)artifacts/bin/testhost/net8.0-$(TARGET_OS)-Debug-$(MONO_ARCH)/dotnet - -debug-webapiclient: - COMPlus_DebugWriteToStdErr=1 \ - MONO_ENV_OPTIONS=$(MONO_ENV_DEBUG_OPTIONS) \ - $(QEMU) -L $(TOP)/.tools/rootfs/riscv64/ \ - -g 12345 \ - $(TOP)artifacts/bin/testhost/net8.0-$(TARGET_OS)-Debug-$(MONO_ARCH)/dotnet \ - $(SAMPLE_PATH)/bin/Debug/net8.0/webapiclient.dll &\ - gdb-multiarch -ex 'target remote localhost:12345' \ - -ex "set sysroot $(TOP).tools/rootfs/riscv64" \ - -ex "set solib-search-path $(TOP)artifacts/bin/testhost/net8.0-linux-Debug-riscv64/shared/Microsoft.NETCore.App/8.0.0" \ - -ex "b mini.c:2156" \ - $(TOP)artifacts/bin/testhost/net8.0-$(TARGET_OS)-Debug-$(MONO_ARCH)/dotnet - -debug-any: - COMPlus_DebugWriteToStdErr=1 \ - MONO_ENV_OPTIONS=$(MONO_ENV_DEBUG_OPTIONS) \ - $(QEMU) -g 12345 \ - ${CORE_ROOT}/corerun -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true $(ANY_PATH) &\ - gdb-multiarch -ex 'target remote localhost:12345' \ - -iex "add-auto-load-safe-path /home/wuxinlong/workspace/runtime/src/mono/sample/TestRun/" \ - -ex "set sysroot $(TOP).tools/rootfs/riscv64" \ - -ex "set solib-search-path ${CORE_ROOT}" \ - -ex "b mono_break" \ - -ex "handle SIGXCPU SIG33 SIG35 SIG36 SIG37 SIG38 SIGPWR print nostop ignore" \ - ${CORE_ROOT}/corerun - -remote_gdb: - gdb-multiarch -ex 'target remote localhost:32427' \ - -iex "add-auto-load-safe-path /home/wuxinlong/workspace/runtime/src/mono/sample/TestRun/" \ - -ex "set sysroot $(TOP).tools/rootfs/riscv64" \ - -ex "set solib-search-path $(TOP)artifacts/bin/testhost/net8.0-linux-Debug-riscv64/shared/Microsoft.NETCore.App/8.0.0" \ - -ex "b mini.c:2156" \ - -ex "handle SIG35 print nostop ignore" \ - ${CORE_ROOT}/corerun - - -debug-any-baseline: - COMPlus_DebugWriteToStdErr=1 \ - MONO_ENV_OPTIONS=$(MONO_ENV_DEBUG_OPTIONS) \ - gdb \ - -ex "set solib-search-path ${CORE_BASELINE_ROOT}" \ - --args ${CORE_BASELINE_ROOT}/corerun -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true $(ANY_PATH) \ - $(ANY_PATH) \ - -clean: - rm -f *.exe *.exe.mdb - -move: - cp /home/wuxinlong/workspace/runtime/artifacts/obj/mono/linux.riscv64.Debug/out/lib/libcoreclr.so /home/wuxinlong/workspace/dotnet-riscv/.dotnet/shared/Microsoft.NETCore.App/8.0.1/libcoreclr.so - -# ILGEN_0xf64b7da3:Method_0xcb0b0b48 -# 306 - -# converting method PrimitiveVT.VT1B PrimitiveVT.CallConv3:f2 (PrimitiveVT.VT1A,PrimitiveVT.VT1B) - -# COMPlus_DebugWriteToStdErr="1" MONO_LOG_LEVEL="debug" MONO_LOG_MASK="all" COREHOST_TRACE="1" COREHOST_TRACE_VERBOSITY="4" MONO_ENV_OPTIONS="--compile-all --trace=all" qemu-riscv64 -L ../../../..//.tools/rootfs/riscv64/ -g 12345 ../../../../artifacts/bin/testhost/net8.0-Linux-Debug-riscv64/dotnet TestRun.exe - -# ROOTFS_DIR="" ./build.sh mono+libs+host -c Debug -# ./build.sh mono+libs+host -c Debug --cross --arch riscv64 --build - -# ROOTFS_DIR="" ./build.sh clr.hosts -c Debug - -# ROOTFS_DIR="" ./build.sh mono+libs+host -c Debug --ninja /p:KeepNativeSymbols=true -# ./build.sh mono+libs+host+clr.hosts -c Debug --cross --arch riscv64 --ninja /p:KeepNativeSymbols=true --build -# CORT_ROOT=/home/wuxinlong/workspace/runtime/artifacts/tests/coreclr/linux.x64.Debug -# ./build.sh -mono -debug riscv64 -ninja /p:KeepNativeSymbols=true -# ./build.sh clr.hosts --cross --arch riscv64 --ninja /p:KeepNativeSymbols=true - - - -# /home/wuxinlong/workspace/runtime/.tools/rootfs/riscv64/bin/gdb \ -# -ex "set sysroot /home/wuxinlong/workspace/runtime/.tools/rootfs/riscv64" \ -# -ex "set solib-search-path /home/wuxinlong/workspace/dotnet-riscv/.dotnet/shared/Microsoft.NETCore.App/8.0.1:/home/wuxinlong/workspace/dotnet-riscv/.dotnet/host/fxr/8.0.1" - -# MONO_ENV_OPTIONS="-v" qemu-riscv64-static -g 12345 /home/wuxinlong/workspace/dotnet-riscv/.dotnet/dotnet build - -# MONO_ENV_OPTIONS="--break Microsoft.Build.Evaluation.ProjectRootElementCache:GetOrLoad --trace=N:Microsoft.Build.Evaluation,-program,-assembly,-wrapper" qemu-riscv64-static -g 12345 /home/wuxinlong/workspace/dotnet-riscv/.dotnet/dotnet /home/wuxinlong/workspace/dotnet-riscv/.dotnet/sdk/8.0.101/MSBuild.dll -consoleloggerparameters:Summary -maxcpucount -restore -verbosity:diag ./HelloWorld.csproj -# /home/wuxinlong/workspace/runtime/.tools/rootfs/riscv64/bin/gdb -ex "target remote localhost:12345" -ex "set sysroot /home/wuxinlong/workspace/runtime/.tools/rootfs/riscv64" -ex "set solib-search-path /home/wuxinlong/workspace/dotnet-riscv/.dotnet/shared/Microsoft.NETCore.App/8.0.1:/home/wuxinlong/workspace/dotnet-riscv/.dotnet/host/fxr/8.0.1" -ex "handle SIGXCPU SIG33 SIG35 SIG36 SIG37 SIG38 SIGPWR print stop ignore" -ex "b mono_break" diff --git a/src/mono/sample/TestRun/TestRun.cs b/src/mono/sample/TestRun/TestRun.cs deleted file mode 100644 index 6f963afbf91d5..0000000000000 --- a/src/mono/sample/TestRun/TestRun.cs +++ /dev/null @@ -1,23 +0,0 @@ -// C# Hello World - -using System; - -public class Test -{ - public static void TestRun() - { - int i; - int len = 50; - var rand = new Random(); - while (len != 0) - { - i = rand.Next(0, 1); - len /= 2; - } - } - - public static void Main() - { - TestRun(); - } -} \ No newline at end of file diff --git a/src/mono/sample/TestRun/TestRun.csproj b/src/mono/sample/TestRun/TestRun.csproj deleted file mode 100644 index cc052494b398f..0000000000000 --- a/src/mono/sample/TestRun/TestRun.csproj +++ /dev/null @@ -1,61 +0,0 @@ - - - Exe - $(NetCoreAppCurrent) - - true - - - - - - - <_AotOutputType>Library - <_AotLibraryFormat>Dylib - false - - - - - - - - - - - - - - - - true - - - - - - - - - - diff --git a/src/mono/sample/TestRun/TestRun.runtimeconfig.json b/src/mono/sample/TestRun/TestRun.runtimeconfig.json deleted file mode 100644 index ef8c92c382190..0000000000000 --- a/src/mono/sample/TestRun/TestRun.runtimeconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "runtimeOptions": { - "tfm": "net9.0", - "framework": { - "name": "Microsoft.NETCore.App", - "version": "9.0.0" - } - } - } \ No newline at end of file