Comments (2)
I very much like the idea of standardizing/defining how wide each type is w.r.t. to the target platform! The proposal you made for the different platforms looks reasonable to me!
My impression is that no version of Oberon ever truly targeted a 64-bit platform. For example, I've been looking at Andreas Pirklbauer's Extended Oberon as part of my effort to port some of the standard modules to oberon-lang
. In Texts.WriteInt
the argument is LONGINT
, but is immediately assumed to be 32-bit on line 447.
IF ROR(x, 31) = 1 THEN WriteString(W, " -2147483648")
In dealing with legacy code and Oberon-07, I think it would make sense to have a switch to use 32-bit sizes, even on a 64-bit platform. Depending on how we detect the width of the platform, this could maybe even be achieved by "cross-compilation" based on the target triplet.
from oberon-lang.
Yes, high probability legacy code would fail here anyway this is arranged with 64bit sizes in the mix.
On the XDS compiler the type LONGLONGINT
is introduced to keep LONGINT
32bit.
Then there is need for separate type for SYSTEM.ADR
and LEN
will be limited to 32bit
which is not ideal, but legacy code will continue to work.
Note I changed the size of SHORTINT
to be 8bit on all platforms.
It seems the use cases I could find was operation on ORD(ch)
or SYSTEM.VAL(BYTE, var)
as arithmetic with numbers are not allowed on CHAR and BYTE.
GCC and CLANG have the -m16
.. -m32
flags to select the integer sizes.
This could probably be reused here.
The default width could be taken from the target triple with the possibility of override with the -m
flag.
If LONGINT
is forced to 32bit on a 64bit target with the -m32 flag, obviously SYSTEM.ADR
would not work any more and a warnings probably should be given.
from oberon-lang.
Related Issues (20)
- endian.h not found on Windows platform HOT 2
- Enforce position of module level VAR section? HOT 5
- Output file argument not working HOT 2
- Avoid writing .smb file for JITed main module HOT 2
- Array passed as argument is shorten HOT 2
- Export of CHAR constants not supported HOT 1
- Making Unit Tests Work! HOT 13
- Add MSYS2 page to Wiki HOT 1
- Add Embedded example to wiki HOT 1
- Compilation error due to extra semicolon
- CHAR variable not treated equal to CHAR literal HOT 5
- Bug in name mangling of (un)nested procedures HOT 2
- Undefined behavior due to nested procedure HOT 7
- Crash with assignment of string literal reference returned from procedure HOT 4
- DIV and MOD not in line with Oberon-07 report HOT 3
- Build report ArchLinux HOT 4
- Crash triggered by accessing exported variable HOT 4
- Proposal to make runtime functionality configurable.
- Access to argc & argv
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oberon-lang.