August 18, 2021

On Tuesday, 17 August 2021 at 20:39:29 UTC, max haughton wrote:

>

On Tuesday, 17 August 2021 at 18:39:27 UTC, Mahdi wrote:

>

On Monday, 16 August 2021 at 10:05:08 UTC, Iain Buclaw wrote:

>

[...]

Why does a simple or empty Hello program generate a lot of assembly output for the risc-v architecture, but not for the ARM and X86 architectures?

Need an example.

A helloworld program on the X86_64-pc-linux-gnu platform contains 40 lines of assembly code or on the ARM (aarch64-linux-gnu) platform only 34 lines of assembly code, but on the risc-v(riscv64-unknow-gnu-linux) platform contains 871 lines of code on the explore.dgnu.org site!

I'm concerned that this will affect the performance of the risc-v platform.

August 18, 2021

On Wednesday, 18 August 2021 at 07:08:09 UTC, Mahdi wrote:

>

On Tuesday, 17 August 2021 at 20:39:29 UTC, max haughton wrote:

>

On Tuesday, 17 August 2021 at 18:39:27 UTC, Mahdi wrote:

>

On Monday, 16 August 2021 at 10:05:08 UTC, Iain Buclaw wrote:

>

[...]

Why does a simple or empty Hello program generate a lot of assembly output for the risc-v architecture, but not for the ARM and X86 architectures?

Need an example.

A helloworld program on the X86_64-pc-linux-gnu platform contains 40 lines of assembly code or on the ARM (aarch64-linux-gnu) platform only 34 lines of assembly code, but on the risc-v(riscv64-unknow-gnu-linux) platform contains 871 lines of code on the explore.dgnu.org site!

I'm concerned that this will affect the performance of the risc-v platform.

A Phobos helloworld is over 1000 lines of assembly on both x86_64 and ARM64. My guess is that Compiler Explorer isn't smart enough to filter RISC-V assembly in the same way as ARM or X86.

August 23, 2021

On Wednesday, 18 August 2021 at 08:09:36 UTC, Iain Buclaw wrote:

>

On Wednesday, 18 August 2021 at 07:08:09 UTC, Mahdi wrote:

>

A helloworld program on the X86_64-pc-linux-gnu platform contains 40 lines of assembly code or on the ARM (aarch64-linux-gnu) platform only 34 lines of assembly code, but on the risc-v(riscv64-unknow-gnu-linux) platform contains 871 lines of code on the explore.dgnu.org site!

I'm concerned that this will affect the performance of the risc-v platform.

A Phobos helloworld is over 1000 lines of assembly on both x86_64 and ARM64. My guess is that Compiler Explorer isn't smart enough to filter RISC-V assembly in the same way as ARM or X86.

This can be confirmed locally with objdump, to reveal a bunch of code that's filtered out by default:

$ cat hello.d
void main() {
    import std.stdio : writeln;
    writeln("Hello, world!");
}
$ gdc hello.d
$ objdump -dwr --no-show-raw-insn a.out | grep -m1 isValidDchar | ddemangle
   3179a:	call   6b870 <pure nothrow @nogc @safe bool std.utf.isValidDchar(dchar)>

You can also confirm it the Compiler Explorer by opening the Filter menu, below the compiler selection and "Compiler options..." input, and unchecking the 'Directives' filter.

1 2
Next ›   Last »