www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - State of MIPS

reply April <lepidotos gmail.com> writes:
What's the current state of MIPS compiling for bare metal? 
Especially the R4300i processor. I see MIPS on both GDC and LDC 
"partial support/bare metal" lists but them being somewhat vague 
about it I'm not quite sure which it means and I'm sure by now 
the processors and instruction sets are different from what they 
were in 1995.

Thanks,
April.
Feb 18 2020
next sibling parent Petar Kirov [ZombineDev] <petar.p.kirov gmail.com> writes:
On Wednesday, 19 February 2020 at 07:09:02 UTC, April wrote:
 What's the current state of MIPS compiling for bare metal? 
 Especially the R4300i processor. I see MIPS on both GDC and LDC 
 "partial support/bare metal" lists but them being somewhat 
 vague about it I'm not quite sure which it means and I'm sure 
 by now the processors and instruction sets are different from 
 what they were in 1995.

 Thanks,
 April.
Unfortunately, the current state is objectively unknown, as MIPS is not part of the architectures that we do continuous integration testing on. I suggest trying to run the compiler/druntime/phobos tests on MIPS (either real hardware, or emulator) to see what works at this moment. It is likely that for bare metal enough of the language would be stable and working correctly, but we can't know for sure. You can follow the instructions to cross-compile with LDC: https://wiki.dlang.org/Building_LDC_runtime_libraries And for GDC: https://wiki.dlang.org/GDC_Cross_Compiler If you need specific help any of those compilers, I suggest asking for help in their respective sections of the forum/newsgroup.
Feb 19 2020
prev sibling next sibling parent Dennis <dkorpel gmail.com> writes:
On Wednesday, 19 February 2020 at 07:09:02 UTC, April wrote:
 What's the current state of MIPS compiling for bare metal? 
 Especially the R4300i processor.
I've had some success with running D code on Nintendo 64 emulators, which emulate a R4300i processor. I'm compiling with: ldc2 -march=mips -mcpu=mips3 -output-o -betterC -c sourcefile.d And then use a custom linker to inject the segments. Some of the issues I came across: - global variables should be marked __gshared or immutable to avoid thread-local storage. - LDC sometimes inserts calls to memcpy, memset and memcmp, so I provided implementations for those - double precision floating point code does not work, only single precision - functions returning large structs by value was not supported Apart from that it worked decently. I'm not sure what kind of support your looking for exactly, but I suggest just giving it a try and see how far you get.
Feb 19 2020
prev sibling parent reply kinke <kinke gmx.net> writes:
On Wednesday, 19 February 2020 at 07:09:02 UTC, April wrote:
 What's the current state of MIPS compiling for bare metal?
For LDC, bare metal should hardly be a problem; most druntime/Phobos tests apparently pass, see https://github.com/ldc-developers/ldc/issues/2995.
Feb 19 2020
parent April <lepidotos gmail.com> writes:
Thanks all, much appreciated!
Feb 21 2020