a front-end for gcc bernhard rabe martin von lwis jan mller operating systems middleware group...
DESCRIPTION
3.NET Technologies'2006, Plzeň May 29 - June 1, 2006 Vision Extending the reach of Middleware Today What else?TRANSCRIPT
![Page 1: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/1.jpg)
A Microsoft .NET Front-End for GCCBernhard RabeMartin von LöwisJan Möller Operating Systems & Middleware GroupHasso-Plattner-Institute, University of Potsdam
![Page 2: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/2.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 2
Outline Motivation GCC CIL Front-End
Targets Internals Example Status
Conclusions
![Page 3: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/3.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 3
Vision Extending the reach of Middleware Today
What else?
![Page 4: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/4.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 4
GNU Compiler Collection
Different programming languages (C, C++, Java, Ada,…)
Various (micro)processor architectures (H8300, ARM, AVR, i386, …)
Easy extensibility to new architectures
C
C++
Java Front-ends
RTL
Back-ends
x86asm
armasm
mipsasm
GCC
![Page 5: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/5.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 5
CIL Front-End
We use the “Portable.NET IL libraries” to read .NET assemblies
Transforms IL code into GCC internal tree representation memory layout of objects vtables and emits RTL code for each method
All .NET concepts except dynamic loading can be supported
C++
C#
VB
.NET Compiler
ILAssembly GCC
x86asm
h8/300asm
![Page 6: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/6.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 6
Target platforms Lego Mindstorm Robots
Lego.NET RCX 2.0 (Renesas H8/300, 16Bit, 16 Mhz) 32K RAM no floating point support
Real-Time Control System Real-Time .Net
Windows CE (x86,600 Mhz) Thread support (delegates) (Hard) real-time constraints (Higher Striker)
![Page 7: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/7.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 7
Implementation Internals Runtime system for each supported target Mono application binary interface (ABI)
object layout (MonoObject) string and array layout vtable layout method calling convention
Floating point support (emulation or hardware if available)
support only beforefieldinit classes anytime before first access initialization is done at program start
![Page 8: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/8.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 8
excerpt from example.csc=a+b*3; tree nodes
ldloc.0ldloc.1ldc.i4.3muladdstloc.2
VAR_DECLLOC0
VAR_DECLLOC1
INTEGER_CST3
MUL_EXPR
![Page 9: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/9.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 9
excerpt from example.csc=a+b*3; tree nodes
ldloc.0ldloc.1ldc.i4.3muladdstloc.2
VAR_DECLLOC0
VAR_DECLLOC1
INTEGER_CST3
MUL_EXPR
ADD_EXPR
![Page 10: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/10.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 10
excerpt from example.csc=a+b*3; tree nodes
ldloc.0ldloc.1ldc.i4.3muladdstloc.2
VAR_DECLLOC0
VAR_DECLLOC1
INTEGER_CST3
MUL_EXPR
ADD_EXPR VAR_DECLLOC2
![Page 11: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/11.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 11
excerpt from example.csc=a+b*3; tree nodes
ldloc.0ldloc.1ldc.i4.3muladdstloc.2
VAR_DECLLOC0
VAR_DECLLOC1
INTEGER_CST3
MUL_EXPR
ADD_EXPR VAR_DECLLOC2
MODIFY_EXPR
![Page 12: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/12.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 12
excerpt from example.csc=a+b*3; tree nodes
ldloc.0ldloc.1ldc.i4.3muladdstloc.2
VAR_DECLLOC0
VAR_DECLLOC1
INTEGER_CST3
MUL_EXPR
expand_expr(MODIFY_EXPR) Backend emits assembly language
ADD_EXPR VAR_DECLLOC2
MODIFY_EXPR
![Page 13: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/13.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 13
gcc –O2 –S example.dll x86 Backend, excerpt from example.s
movl 12(%ebp), %eax ; eax = b leal (%eax,%eax,2), %eax ; eax = eax+2*eaxaddl 8(%ebp), %eax ; eax += a
![Page 14: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/14.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 14
Supported Constructs primitive data types, enums classes, attributes (static, instance), properties,
inheritance methods (static, instance), parameters, local
variables and constructors arrays and strings delegates arithmetic operations control flow operations (conditional, unconditional
branch, switch)
![Page 15: A Front-End for GCC Bernhard Rabe Martin von Lwis Jan Mller Operating Systems Middleware Group Hasso-Plattner-Institute, University of](https://reader034.vdocument.in/reader034/viewer/2022051105/5a4d1b787f8b9ab0599b815b/html5/thumbnails/15.jpg)
.NET Technologies'2006, PlzeňMay 29 - June 1, 2006 15
Conclusions CIL front-end for GCC
Support for target processors not supported otherwise (commercial framework, or compact framework)
Programming Lego Mindstorms Robots http://www.dcl.hpi.uni-potsdam.de/research/lego.NET/
Future Work Real-time extensions (Real-Time .Net) interfaces, reflection, exception handling GC