Compare commits
5 Commits
master
...
mir-nonssa
Author | SHA1 | Date |
---|---|---|
Dibyendu Majumdar | cadee5563f | 4 years ago |
Dibyendu Majumdar | 66bf2c6c17 | 4 years ago |
Dibyendu Majumdar | faff7902b3 | 4 years ago |
Dibyendu Majumdar | 4b9c746526 | 4 years ago |
Dibyendu Majumdar | ba0c697c9a | 4 years ago |
@ -1,7 +0,0 @@
|
||||
# [Choice] Debian / Ubuntu version: debian-10, debian-9, ubuntu-20.04, ubuntu-18.04
|
||||
ARG VARIANT=buster
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/cpp:dev-${VARIANT}
|
||||
|
||||
# [Optional] Uncomment this section to install additional packages.
|
||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
@ -1,12 +0,0 @@
|
||||
# [Choice] Debian / Ubuntu version: debian-10, debian-9, ubuntu-20.04, ubuntu-18.04
|
||||
ARG VARIANT=buster
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
|
||||
|
||||
# Install needed packages. Use a separate RUN statement to add your own dependencies.
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install build-essential cmake cppcheck valgrind clang lldb llvm gdb \
|
||||
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# [Optional] Uncomment this section to install additional OS packages.
|
||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
@ -1,28 +0,0 @@
|
||||
{
|
||||
"name": "C++",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
// Update 'VARIANT' to pick an Debian / Ubuntu OS version: debian-10, debian-9, ubuntu-20.04, ubuntu-18.04
|
||||
"args": { "VARIANT": "debian-10" }
|
||||
},
|
||||
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-vscode.cpptools"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "gcc -v",
|
||||
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode"
|
||||
}
|
@ -1,195 +0,0 @@
|
||||
Ravi Programming Language
|
||||
=========================
|
||||
|
||||
![image](https://travis-ci.org/dibyendumajumdar/ravi.svg?branch=master%0A%20:target:%20https://travis-ci.org/dibyendumajumdar/ravi)
|
||||
|
||||
Ravi is a dialect of [Lua](http://www.lua.org/) with limited optional
|
||||
static typing and features [MIR](https://github.com/vnmakarov/mir)
|
||||
powered JIT compilers. The name Ravi comes from the Sanskrit word for
|
||||
the Sun. Interestingly a precursor to Lua was
|
||||
[Sol](http://www.lua.org/history.html) which had support for static
|
||||
types; Sol means the Sun in Portugese.
|
||||
|
||||
Lua is perfect as a small embeddable dynamic language so why a
|
||||
derivative? Ravi extends Lua with static typing for improved performance
|
||||
when JIT compilation is enabled. However, the static typing is optional
|
||||
and therefore Lua programs are also valid Ravi programs.
|
||||
|
||||
There are other attempts to add static typing to Lua - e.g. [Typed
|
||||
Lua](https://github.com/andremm/typedlua) but these efforts are mostly
|
||||
about adding static type checks in the language while leaving the VM
|
||||
unmodified. The Typed Lua effort is very similar to the approach taken
|
||||
by Typescript in the JavaScript world. The static typing is to aid
|
||||
programming in the large - the code is eventually translated to standard
|
||||
Lua and executed in the unmodified Lua VM.
|
||||
|
||||
My motivation is somewhat different - I want to enhance the VM to
|
||||
support more efficient operations when types are known. Type information
|
||||
can be exploited by JIT compilation technology to improve performance.
|
||||
At the same time, I want to keep the language safe and therefore usable
|
||||
by non-expert programmers.
|
||||
|
||||
Of course there is the fantastic [LuaJIT](http://luajit.org)
|
||||
implementation. Ravi has a different goal compared to LuaJIT. Ravi
|
||||
prioritizes ease of maintenance and support, language safety, and
|
||||
compatibility with Lua 5.3, over maximum performance. For more detailed
|
||||
comparison please refer to the documentation links below.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
- Optional static typing - for details [see the reference
|
||||
manual](https://the-ravi-programming-language.readthedocs.io/en/latest/ravi-reference.html).
|
||||
- Type specific bytecodes to improve performance
|
||||
- Compatibility with Lua 5.3 (see Compatibility section below)
|
||||
- Generational GC from Lua 5.4
|
||||
- `defer` statement for releasing resources
|
||||
- Compact JIT backend [MIR](https://github.com/vnmakarov/mir).
|
||||
- A [distribution with
|
||||
batteries](https://github.com/dibyendumajumdar/Suravi).
|
||||
- A [Visual Studio Code debugger
|
||||
extension](https://marketplace.visualstudio.com/items?itemName=ravilang.ravi-debug)
|
||||
- interpreted mode debugger.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
- For the Lua extensions in Ravi see the [Reference
|
||||
Manual](https://the-ravi-programming-language.readthedocs.io/en/latest/ravi-reference.html).
|
||||
- [MIR JIT Build
|
||||
instructions](https://the-ravi-programming-language.readthedocs.io/en/latest/ravi-mir-instructions.html).
|
||||
- Also see [Ravi
|
||||
Documentation](http://the-ravi-programming-language.readthedocs.org/en/latest/index.html).
|
||||
- and the slides I presented at the [Lua 2015
|
||||
Workshop](http://www.lua.org/wshop15.html).
|
||||
|
||||
Lua Goodies
|
||||
-----------
|
||||
|
||||
- [An Introduction to
|
||||
Lua](http://the-ravi-programming-language.readthedocs.io/en/latest/lua-introduction.html)
|
||||
attempts to provide a quick overview of Lua for folks coming from
|
||||
other languages.
|
||||
- [Lua 5.3 Bytecode
|
||||
Reference](http://the-ravi-programming-language.readthedocs.io/en/latest/lua_bytecode_reference.html)
|
||||
is my attempt to bring up to date the [Lua 5.1 Bytecode
|
||||
Reference](http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInstructions.pdf).
|
||||
- A [patch for Lua
|
||||
5.3](https://github.com/dibyendumajumdar/ravi/blob/master/patches/defer_statement_for_Lua_5_3.patch)
|
||||
implements the 'defer' statement.
|
||||
- A [patch for Lua
|
||||
5.4.[0-2]](https://github.com/dibyendumajumdar/ravi/blob/master/patches/defer_statement_for_Lua_5_4.patch)
|
||||
implements the 'defer' statement.
|
||||
- Updated [patch for Lua
|
||||
5.4.3](https://github.com/dibyendumajumdar/ravi/blob/master/patches/defer_statement_patch_for_Lua_5_4_3.patch)
|
||||
implements the 'defer' statement.
|
||||
|
||||
Lua 5.4 Position Statement
|
||||
--------------------------
|
||||
|
||||
Lua 5.4 relationship to Ravi is as follows:
|
||||
|
||||
- Generational GC - back-ported to Ravi.
|
||||
- New random number generator - back-ported to Ravi.
|
||||
- Multiple user values can be associated with userdata - under
|
||||
consideration.
|
||||
- `<const>` variables - not planned.
|
||||
- `<close>` variables - Ravi has `'defer'` statement which is the
|
||||
better option in my opinion, hence no plans to support `<close>`
|
||||
variables.
|
||||
- Interpreter performance improvements - these are beneficial to Lua
|
||||
interpreter but not to the JIT backends, hence not much point in
|
||||
back-porting.
|
||||
- Table implementation changes - under consideration.
|
||||
- String to number coercion is now part of string library metamethods
|
||||
- back-ported to Ravi.
|
||||
- utf8 library accepts codepoints up to 2\^31 - back-ported to Ravi.
|
||||
- Removal of compatibility layers for 5.1, and 5.2 - not implemented
|
||||
as Ravi continues to provide these layers as per Lua 5.3.
|
||||
|
||||
Compatibility with Lua 5.3
|
||||
--------------------------
|
||||
|
||||
Ravi should be able to run all Lua 5.3 programs in interpreted mode, but
|
||||
following should be noted:
|
||||
|
||||
- Ravi supports optional typing and enhanced types such as arrays (see
|
||||
the documentation). Programs using these features cannot be run by
|
||||
standard Lua. However all types in Ravi can be passed to Lua
|
||||
functions; operations on Ravi arrays within Lua code will be subject
|
||||
to restrictions as described in the section above on arrays.
|
||||
- Values crossing from Lua to Ravi will be subjected to typechecks
|
||||
should these values be assigned to typed variables.
|
||||
- Upvalues cannot subvert the static typing of local variables (issue
|
||||
\#26) when types are annotated.
|
||||
- Certain Lua limits are reduced due to changed byte code structure.
|
||||
These are described below.
|
||||
- Ravi uses an extended bytecode which means it is not compatible with
|
||||
Lua 5.x bytecode.
|
||||
- Ravi incorporates the new Generational GC from Lua 5.4, hence the GC
|
||||
interface has changed.
|
||||
|
||||
Limit name Lua value Ravi value
|
||||
------------------ -------------- --------------
|
||||
MAXUPVAL 255 125
|
||||
LUAI\_MAXCCALLS 200 125
|
||||
MAXREGS 255 125
|
||||
MAXVARS 200 125
|
||||
MAXARGLINE 250 120
|
||||
|
||||
When JIT compilation is enabled there are following additional
|
||||
constraints:
|
||||
|
||||
- Ravi will only execute JITed code from the main Lua thread; any
|
||||
secondary threads (coroutines) execute in interpreter mode.
|
||||
- In JITed code tailcalls are implemented as regular calls so unlike
|
||||
the interpreter VM which supports infinite tail recursion JIT
|
||||
compiled code only supports tail recursion to a depth of about 110
|
||||
(issue \#17)
|
||||
- Debug api and hooks are not supported in JIT mode
|
||||
|
||||
History
|
||||
-------
|
||||
|
||||
- 2015
|
||||
: - Implemented JIT compilation using LLVM
|
||||
- Implemented [libgccjit based alternative
|
||||
JIT](https://github.com/dibyendumajumdar/ravi/tree/gccjit-ravi534)
|
||||
(now discontinued)
|
||||
|
||||
- 2016
|
||||
: - Implemented debugger for Ravi and Lua 5.3 for [Visual Studio
|
||||
Code](https://github.com/dibyendumajumdar/ravi/tree/master/vscode-debugger)
|
||||
|
||||
- 2017
|
||||
: - Embedded C compiler using dmrC project (C JIT compiler) (now
|
||||
discontinued)
|
||||
- Additional type-annotations
|
||||
|
||||
- 2018
|
||||
: - Implemented [Eclipse OMR JIT
|
||||
backend](https://github.com/dibyendumajumdar/ravi/tree/omrjit)
|
||||
(now discontinued)
|
||||
- Created [Ravi with
|
||||
batteries](https://github.com/dibyendumajumdar/Suravi).
|
||||
|
||||
- 2019
|
||||
: - New language feature - defer statement
|
||||
- New JIT backend [MIR](https://github.com/vnmakarov/mir).
|
||||
|
||||
- 2020
|
||||
: - [New parser / type checker /
|
||||
compiler](https://github.com/dibyendumajumdar/ravi-compiler)
|
||||
- Generational GC back-ported from Lua 5.4
|
||||
- Support for [LLVM
|
||||
backend](https://github.com/dibyendumajumdar/ravi/tree/llvm)
|
||||
archived
|
||||
|
||||
- 2021 (Plan)
|
||||
: - Integrated AOT and JIT compilation support
|
||||
- Ravi 1.0 release
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
MIT License
|
@ -0,0 +1,127 @@
|
||||
=========================
|
||||
Ravi Programming Language
|
||||
=========================
|
||||
.. image:: https://travis-ci.org/dibyendumajumdar/ravi.svg?branch=master
|
||||
:target: https://travis-ci.org/dibyendumajumdar/ravi
|
||||
|
||||
Ravi is a dialect of `Lua <http://www.lua.org/>`_ with limited optional static typing and
|
||||
features `MIR <https://github.com/vnmakarov/mir>`_ and `LLVM <http://www.llvm.org/>`_ powered JIT compilers.
|
||||
The name Ravi comes from the Sanskrit word for the Sun.
|
||||
Interestingly a precursor to Lua was `Sol <http://www.lua.org/history.html>`_ which had support for
|
||||
static types; Sol means the Sun in Portugese.
|
||||
|
||||
Lua is perfect as a small embeddable dynamic language so why a derivative? Ravi extends Lua with
|
||||
static typing for improved performance when JIT compilation is enabled. However, the static typing is
|
||||
optional and therefore Lua programs are also valid Ravi programs.
|
||||
|
||||
There are other attempts to add static typing to Lua - e.g. `Typed Lua <https://github.com/andremm/typedlua>`_ but
|
||||
these efforts are mostly about adding static type checks in the language while leaving the VM unmodified.
|
||||
The Typed Lua effort is very similar to the approach taken by Typescript in the JavaScript world.
|
||||
The static typing is to aid programming in the large - the code is eventually translated to standard Lua
|
||||
and executed in the unmodified Lua VM.
|
||||
|
||||
My motivation is somewhat different - I want to enhance the VM to support more efficient operations when types are
|
||||
known. Type information can be exploited by JIT compilation technology to improve performance. At the same time,
|
||||
I want to keep the language safe and therefore usable by non-expert programmers.
|
||||
|
||||
Of course there is the fantastic `LuaJIT <http://luajit.org>`_ implementation. Ravi has a different goal compared to
|
||||
LuaJIT. Ravi prioritizes ease of maintenance and support, language safety, and compatibility with Lua 5.3,
|
||||
over maximum performance. For more detailed comparison please refer to the documentation links below.
|
||||
|
||||
Features
|
||||
========
|
||||
* Optional static typing - for details `see the reference manual <https://the-ravi-programming-language.readthedocs.io/en/latest/ravi-reference.html>`_.
|
||||
* Type specific bytecodes to improve performance
|
||||
* Compatibility with Lua 5.3 (see Compatibility section below)
|
||||
* Generational GC from Lua 5.4
|
||||
* ``defer`` statement for releasing resources
|
||||
* Compact JIT backend `MIR <https://github.com/vnmakarov/mir>`_; only Linux and x86-64 supported for now.
|
||||
* `LLVM <http://www.llvm.org/>`_ supported as alternative JIT backend.
|
||||
* A `distribution with batteries <https://github.com/dibyendumajumdar/Suravi>`_.
|
||||
* A `Visual Studio Code debugger extension <https://marketplace.visualstudio.com/items?itemName=ravilang.ravi-debug>`_ - interpreted mode debugger.
|
||||
|
||||
Documentation
|
||||
=============
|
||||
* For the Lua extensions in Ravi see the `Reference Manual <https://the-ravi-programming-language.readthedocs.io/en/latest/ravi-reference.html>`_.
|
||||
* `MIR JIT Build instructions <https://the-ravi-programming-language.readthedocs.io/en/latest/ravi-mir-instructions.html>`_.
|
||||
* `LLVM JIT Build instructions <https://the-ravi-programming-language.readthedocs.io/en/latest/ravi-llvm-instructions.html>`_.
|
||||
* Also see `Ravi Documentation <http://the-ravi-programming-language.readthedocs.org/en/latest/index.html>`_.
|
||||
* and the slides I presented at the `Lua 2015 Workshop <http://www.lua.org/wshop15.html>`_.
|
||||
|
||||
Lua Goodies
|
||||
===========
|
||||
* `An Introduction to Lua <http://the-ravi-programming-language.readthedocs.io/en/latest/lua-introduction.html>`_ attempts to provide a quick overview of Lua for folks coming from other languages.
|
||||
* `Lua 5.3 Bytecode Reference <http://the-ravi-programming-language.readthedocs.io/en/latest/lua_bytecode_reference.html>`_ is my attempt to bring up to date the `Lua 5.1 Bytecode Reference <http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInstructions.pdf>`_.
|
||||
* A `patch for Lua 5.3 <https://github.com/dibyendumajumdar/ravi/blob/master/patches/defer_statement_for_Lua_5_3.patch>`_ implements the 'defer' statement.
|
||||
* A `patch for Lua 5.4 <https://github.com/dibyendumajumdar/ravi/blob/master/patches/defer_statement_for_Lua_5_4.patch>`_ implements the 'defer' statement.
|
||||
|
||||
Lua 5.4 Position Statement
|
||||
==========================
|
||||
Lua 5.4 relationship to Ravi is as follows:
|
||||
|
||||
* Generational GC - back-ported to Ravi.
|
||||
* New random number generator - back-ported to Ravi.
|
||||
* Multiple user values can be associated with userdata - under consideration.
|
||||
* ``<const>`` variables - not planned.
|
||||
* ``<close>`` variables - Ravi has ``'defer'`` statement which is the better option in my opinion, hence no plans to support ``<close>`` variables.
|
||||
* Interpreter performance improvements - these are beneficial to Lua interpreter but not to the JIT backends, hence not much point in back-porting.
|
||||
* Table implementation changes - under consideration.
|
||||
* String to number coercion is now part of string library metamethods - back-ported to Ravi.
|
||||
* utf8 library accepts codepoints up to 2^31 - back-ported to Ravi.
|
||||
* Removal of compatibility layers for 5.1, and 5.2 - not implemented as Ravi continues to provide these layers as per Lua 5.3.
|
||||
|
||||
Compatibility with Lua 5.3
|
||||
==========================
|
||||
Ravi should be able to run all Lua 5.3 programs in interpreted mode, but following should be noted:
|
||||
|
||||
* Ravi supports optional typing and enhanced types such as arrays (see the documentation). Programs using these features cannot be run by standard Lua. However all types in Ravi can be passed to Lua functions; operations on Ravi arrays within Lua code will be subject to restrictions as described in the section above on arrays.
|
||||
* Values crossing from Lua to Ravi will be subjected to typechecks should these values be assigned to typed variables.
|
||||
* Upvalues cannot subvert the static typing of local variables (issue #26) when types are annotated.
|
||||
* Certain Lua limits are reduced due to changed byte code structure. These are described below.
|
||||
* Ravi uses an extended bytecode which means it is not compatible with Lua 5.x bytecode.
|
||||
* Ravi incorporates the new Generational GC from Lua 5.4, hence the GC interface has changed.
|
||||
|
||||
+-----------------+-------------+-------------+
|
||||
| Limit name | Lua value | Ravi value |
|
||||
+=================+=============+=============+
|
||||
| MAXUPVAL | 255 | 125 |
|
||||
+-----------------+-------------+-------------+
|
||||
| LUAI_MAXCCALLS | 200 | 125 |
|
||||
+-----------------+-------------+-------------+
|
||||
| MAXREGS | 255 | 125 |
|
||||
+-----------------+-------------+-------------+
|
||||
| MAXVARS | 200 | 125 |
|
||||
+-----------------+-------------+-------------+
|
||||
| MAXARGLINE | 250 | 120 |
|
||||
+-----------------+-------------+-------------+
|
||||
|
||||
When JIT compilation is enabled there are following additional constraints:
|
||||
|
||||
* Ravi will only execute JITed code from the main Lua thread; any secondary threads (coroutines) execute in interpreter mode.
|
||||
* In JITed code tailcalls are implemented as regular calls so unlike the interpreter VM which supports infinite tail recursion JIT compiled code only supports tail recursion to a depth of about 110 (issue #17)
|
||||
|
||||
History
|
||||
=======
|
||||
* 2015
|
||||
- Implemented JIT compilation using LLVM
|
||||
- Implemented `libgccjit based alternative JIT <https://github.com/dibyendumajumdar/ravi/tree/gccjit-ravi534>`_ (now discontinued)
|
||||
* 2016
|
||||
- Implemented debugger for Ravi and Lua 5.3 for `Visual Studio Code <https://github.com/dibyendumajumdar/ravi/tree/master/vscode-debugger>`_
|
||||
* 2017
|
||||
- Embedded C compiler using dmrC project (C JIT compiler) (now discontinued)
|
||||
- Additional type-annotations
|
||||
* 2018
|
||||
- Implemented `Eclipse OMR JIT backend <https://github.com/dibyendumajumdar/ravi/tree/omrjit>`_ (now discontinued)
|
||||
- Created `Ravi with batteries <https://github.com/dibyendumajumdar/Suravi>`_.
|
||||
* 2019
|
||||
- New language feature - `defer` statement
|
||||
- New JIT backend `MIR <https://github.com/vnmakarov/mir>`_.
|
||||
|
||||
* 2020 (Plan)
|
||||
- `New optimizing byte code generator based on new parser / type checker <https://github.com/dibyendumajumdar/ravi-compiler>`_
|
||||
- Generational GC back-ported from Lua 5.4
|
||||
- Ravi 1.0 release
|
||||
|
||||
License
|
||||
=======
|
||||
MIT License
|
@ -0,0 +1,16 @@
|
||||
# Run this on LLVM 10 source dir
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/Software/llvm10 \
|
||||
-DLLVM_TARGETS_TO_BUILD="X86" \
|
||||
-DLLVM_BUILD_TOOLS=OFF \
|
||||
-DLLVM_INCLUDE_TOOLS=OFF \
|
||||
-DLLVM_BUILD_EXAMPLES=OFF \
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
||||
-DLLVM_BUILD_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
-DLLVM_OPTIMIZED_TABLEGEN=ON \
|
||||
..
|
||||
make install
|
@ -0,0 +1,5 @@
|
||||
mkdir llvm32
|
||||
cd llvm32
|
||||
rem cmake -DCMAKE_INSTALL_PREFIX=\d\ravi32 -G "Visual Studio 14" -DLLVM_JIT=ON -DLLVM_DIR=\d\LLVM37_32\share\llvm\cmake -DBUILD_STATIC=OFF ..
|
||||
cmake -DCMAKE_INSTALL_PREFIX=\d\ravi32 -G "Visual Studio 14" -DLLVM_JIT=ON -DLLVM_DIR=\d\LLVM39_32\lib\cmake\llvm -DSTATIC_BUILD=OFF ..
|
||||
cd ..
|
@ -0,0 +1,5 @@
|
||||
mkdir llvm32
|
||||
cd llvm32
|
||||
rem cmake -DCMAKE_INSTALL_PREFIX=\d\ravi32 -G "Visual Studio 14" -DLLVM_JIT=ON -DLLVM_DIR=\d\LLVM37_32\share\llvm\cmake ..
|
||||
cmake -DCMAKE_INSTALL_PREFIX=\d\ravi32 -G "Visual Studio 14" -DLLVM_JIT=ON -DLLVM_DIR=\d\LLVM39\lib\cmake\llvm -DSTATIC_BUILD=ON ..
|
||||
cd ..
|
@ -0,0 +1,5 @@
|
||||
mkdir llvm32d
|
||||
cd llvm32d
|
||||
rem cmake -DCMAKE_INSTALL_PREFIX=\d\ravi32 -G "Visual Studio 14" -DLLVM_JIT=ON -DLLVM_DIR=\d\LLVM37_32\share\llvm\cmake ..
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=\d\ravi32 -G "Visual Studio 14" -DLLVM_JIT=ON -DLLVM_DIR=\d\LLVM39D_32\lib\cmake\llvm -DSTATIC_BUILD=ON ..
|
||||
cd ..
|
@ -0,0 +1,6 @@
|
||||
mkdir llvm64d
|
||||
cd llvm64d
|
||||
rem cmake -DCMAKE_INSTALL_PREFIX=c:\ravi64llvmd -G "Visual Studio 14 Win64" -DLLVM_JIT=ON -DLLVM_DIR=c:\LLVM37debug\share\llvm\cmake ..
|
||||
rem cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=c:\d\ravi64llvmd -G "Visual Studio 15 2017 Win64" -DLLVM_JIT=ON -DEMBEDDED_DMRC=ON -DLLVM_DIR=c:\d\LLVM39D64\lib\cmake\llvm ..
|
||||
cmake -DCMAKE_INSTALL_PREFIX=c:\Software\ravi -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Debug -DLLVM_JIT=ON -DLLVM_DIR=c:\Software\llvm501d\lib\cmake\llvm ..
|
||||
cd ..
|
@ -0,0 +1,7 @@
|
||||
mkdir llvm64
|
||||
cd llvm64
|
||||
rem pre LLVM 3.9
|
||||
rem cmake -DCMAKE_INSTALL_PREFIX=c:\ravi -G "Visual Studio 14 Win64" -DLLVM_JIT=ON -DLLVM_DIR=c:\LLVM37\share\llvm\cmake ..
|
||||
rem cmake -DCMAKE_INSTALL_PREFIX=c:\ravi -G "Visual Studio 15 2017 Win64" -DLLVM_JIT=ON -DLLVM_DIR=c:\d\LLVM40_64\lib\cmake\llvm ..
|
||||
cmake -DCMAKE_INSTALL_PREFIX=c:\Software\ravi -G "Visual Studio 15 2017 Win64" -DSTATIC_BUILD=ON -DLLVM_JIT=ON -DLLVM_DIR=c:\Software\llvm601r\lib\cmake\llvm ..
|
||||
cd ..
|
@ -0,0 +1,5 @@
|
||||
rmdir /s llvm8
|
||||
mkdir llvm8
|
||||
cd llvm8
|
||||
cmake -DCMAKE_INSTALL_PREFIX=c:\Software\ravi -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release -DLLVM_JIT=ON -DLLVM_DIR=c:\Software\llvm801\lib\cmake\llvm ..
|
||||
cd ..
|
@ -0,0 +1,5 @@
|
||||
rmdir /s llvm10d
|
||||
mkdir llvm10d
|
||||
cd llvm10d
|
||||
cmake -DCMAKE_INSTALL_PREFIX=c:\Software\ravi -G "Visual Studio 16 2019" -DLLVM_JIT=ON -DLLVM_DIR=c:\Software\llvm10d\lib\cmake\llvm ..
|
||||
cd ..
|
@ -0,0 +1,6 @@
|
||||
rmdir /s llvm9r
|
||||
mkdir llvm9r
|
||||
cd llvm9r
|
||||
rem cmake -DCMAKE_INSTALL_PREFIX=c:\Software\ravi -G "Visual Studio 15 2017 Win64" -DLLVM_JIT=ON -DLLVM_DIR=c:\Software\llvm900r\lib\cmake\llvm ..
|
||||
cmake -DCMAKE_INSTALL_PREFIX=c:\Software\ravi -G "Visual Studio 16 2019" -DLLVM_JIT=ON -DLLVM_DIR=c:\Software\llvm900r\lib\cmake\llvm ..
|
||||
cd ..
|
@ -0,0 +1,4 @@
|
||||
mkdir omrjit
|
||||
cd omrjit
|
||||
cmake -DCMAKE_INSTALL_PREFIX=c:\Software\ravi -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Debug -DOMR_JIT=ON ..
|
||||
cd ..
|
@ -0,0 +1,4 @@
|
||||
mkdir xcodellvm
|
||||
cd xcodellvm
|
||||
#cmake -DCMAKE_BUILD_TYPE=Debug -G Xcode -DLLVM_JIT=ON -DCMAKE_INSTALL_PREFIX=$HOME/ravi -DLLVM_DIR=$HOME/LLVM/share/llvm/cmake ..
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -G Xcode -DLLVM_JIT=ON -DCMAKE_INSTALL_PREFIX=$HOME/ravi -DLLVM_DIR=$HOME/LLVM5/lib/cmake/llvm ..
|
@ -0,0 +1,5 @@
|
||||
mkdir buildllvmd
|
||||
cd buildllvmd
|
||||
#cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_JIT=ON -DCMAKE_INSTALL_PREFIX=$HOME/ravi -DLLVM_DIR=$HOME/LLVM/share/llvm/cmake ..
|
||||
#cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_JIT=ON -DLTESTS=ON -DCMAKE_INSTALL_PREFIX=$HOME/ravi -DLLVM_DIR=$HOME/LLVM5/lib/cmake/llvm ..
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_JIT=ON -DLTESTS=ON -DCMAKE_INSTALL_PREFIX=$HOME/ravillvm -DLLVM_DIR=$HOME/Software/llvm600/lib/cmake/llvm ..
|
@ -0,0 +1,7 @@
|
||||
rm -rf buildllvm
|
||||
mkdir buildllvm
|
||||
cd buildllvm
|
||||
#cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_JIT=ON -DCMAKE_INSTALL_PREFIX=$HOME/ravi -DLLVM_DIR=$HOME/LLVM/share/llvm/cmake ..
|
||||
#cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_JIT=ON -DCMAKE_INSTALL_PREFIX=$HOME/ravi -DLLVM_DIR=$HOME/LLVM5/lib/cmake/llvm ..
|
||||
#cmake -DCMAKE_BUILD_TYPE=Release -DSTATIC_BUILD=ON -DLLVM_JIT=ON -DCMAKE_INSTALL_PREFIX=$HOME/Software/ravi -DLLVM_DIR=$HOME/Software/llvm801/lib/cmake/llvm ..
|
||||
cmake3 -DCMAKE_BUILD_TYPE=Release -DSTATIC_BUILD=ON -DLLVM_JIT=ON -DCMAKE_INSTALL_PREFIX=$HOME/Software/ravi -DLLVM_DIR=$HOME/Software/llvm10/lib/cmake/llvm ..
|
@ -0,0 +1,3 @@
|
||||
mkdir omrjit
|
||||
cd omrjit
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DOMR_JIT=ON -DCMAKE_INSTALL_PREFIX=$HOME/ravi ..
|
@ -0,0 +1,15 @@
|
||||
find_path(RAVICOMP_INCLUDE_DIRS ravi_compiler.h
|
||||
PATHS
|
||||
c:/Software/ravicomp/include/ravicomp
|
||||
~/Software/ravicomp/include/ravicomp
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(RAVICOMP_LIBRARIES
|
||||
NAMES ravicomp
|
||||
PATHS
|
||||
c:/Software/ravicomp/lib
|
||||
~/Software/ravicomp/lib
|
||||
~/Software/ravicomp/lib64
|
||||
)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2015-2021 Dibyendu Majumdar
|
||||
* Copyright (C) 2015-2020 Dibyendu Majumdar
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
@ -0,0 +1,121 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2015 Dibyendu Majumdar
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
******************************************************************************/
|
||||
#ifndef RAVI_LLVM_H
|
||||
#define RAVI_LLVM_H
|
||||
|
||||
#ifdef USE_LLVM
|
||||
|
||||
#include "llvm/Config/llvm-config.h"
|
||||
|
||||
#if (LLVM_VERSION_MAJOR < 3 || LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 5 || LLVM_VERSION_MAJOR == 7)
|
||||
#error Unsupported LLVM version
|
||||
#endif
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 5
|
||||
#define USE_ORC_JIT 1
|
||||
#else
|
||||
#define USE_ORC_JIT 0
|
||||
#endif
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 8 && !defined(_WIN32)
|
||||
#define USE_ORCv2_JIT 0
|
||||
#else
|
||||
#define USE_ORCv2_JIT 0
|
||||
#endif
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 10
|
||||
#undef USE_ORCv2_JIT
|
||||
#define USE_ORCv2_JIT 1
|
||||
#endif
|
||||
|
||||
// In lua.c we include this just to get version numbers
|
||||
// We cannot have C++ headers in that case
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/Analysis/Passes.h"
|
||||
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
||||
#include "llvm/ExecutionEngine/MCJIT.h"
|
||||
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
|
||||
#include "llvm/ExecutionEngine/GenericValue.h"
|
||||
#include "llvm/IR/DataLayout.h"
|
||||
#include "llvm/IR/DerivedTypes.h"
|
||||
#include "llvm/IR/Intrinsics.h"
|
||||
#include "llvm/IR/IRBuilder.h"
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
#include "llvm/IR/MDBuilder.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/IR/Verifier.h"
|
||||
#include "llvm/IR/Metadata.h"
|
||||
#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7
|
||||
#include "llvm/PassManager.h"
|
||||
#else
|
||||
#include "llvm/IR/LegacyPassManager.h"
|
||||
#endif
|
||||
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
|
||||
#include "llvm/Transforms/Instrumentation.h"
|
||||
#include "llvm/Support/TargetSelect.h"
|
||||
#include "llvm/Support/Host.h"
|
||||
#include "llvm/Support/DynamicLibrary.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Transforms/Scalar.h"
|
||||
#include "llvm/Support/FormattedStream.h"
|
||||
|
||||
|
||||
#if USE_ORC_JIT || USE_ORCv2_JIT
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ExecutionEngine/JITSymbol.h"
|
||||
#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
|
||||
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
|
||||
#include "llvm/ExecutionEngine/Orc/IndirectionUtils.h"
|
||||
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
|
||||
#include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
|
||||
#include "llvm/ExecutionEngine/Orc/LambdaResolver.h"
|
||||
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
|
||||
#include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
|
||||
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
|
||||
#include "llvm/IR/Mangler.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Transforms/Scalar/GVN.h"
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 8
|
||||
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
|
||||
#include "llvm/ExecutionEngine/Orc/Legacy.h"
|
||||
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //USE_LLVM
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
Copyright (C) 2020 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
static char aarch64_mirc[]
|
@ -1,60 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 5.2.4.2.2 */
|
||||
static char float_str[]
|
||||
= "#ifndef __FLOAT_H\n"
|
||||
"#define __FLOAT_H\n"
|
||||
"\n"
|
||||
"#define FLT_RADIX 2\n"
|
||||
"\n"
|
||||
"#define FLT_MANT_DIG 24\n"
|
||||
"#define DBL_MANT_DIG 53\n"
|
||||
"#define LDBL_MANT_DIG DBL_MANT_DIG\n"
|
||||
"\n"
|
||||
"#define FLT_DECIMAL_DIG 9\n"
|
||||
"#define DBL_DECIMAL_DIG 17\n"
|
||||
"#define LDBL_DECIMAL_DIG DBL_DECIMAL_DIG\n"
|
||||
"#define FLT_DIG FLT_DECIMAL_DIG\n"
|
||||
"#define DBL_DIG DBL_DECIMAL_DIG\n"
|
||||
"#define LDBL_DIG LDBL_DECIMAL_DIG\n"
|
||||
"\n"
|
||||
"#define DECIMAL_DIG LDBL_DECIMAL_DIG\n"
|
||||
"\n"
|
||||
"#define FLT_MIN_EXP -125\n"
|
||||
"#define DBL_MIN_EXP -1021\n"
|
||||
"#define LDBL_MIN_EXP DBL_MIN_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MIN_10_EXP -37\n"
|
||||
"#define DBL_MIN_10_EXP -307\n"
|
||||
"#define LDBL_MIN_10_EXP DBL_MIN_10_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MAX_EXP 128\n"
|
||||
"#define DBL_MAX_EXP 1024\n"
|
||||
"#define LDBL_MAX_EXP DBL_MAX_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MAX_10_EXP 38\n"
|
||||
"#define DBL_MAX_10_EXP 308\n"
|
||||
"#define LDBL_MAX_10_EXP DBL_MAX_10_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MAX 0x1.fffffep+127\n"
|
||||
"#define DBL_MAX 0x1.fffffffffffffp+1023\n"
|
||||
"#define LDBL_MAX DBL_MAX\n"
|
||||
"\n"
|
||||
"#define FLT_EPSILON 0x1p-23\n"
|
||||
"#define DBL_EPSILON 0x1p-52\n"
|
||||
"#define LDBL_EPSILON DBL_EPSILON\n"
|
||||
"\n"
|
||||
"#define FLT_MIN 0x1p-126\n"
|
||||
"#define DBL_MIN 0x1p-1022\n"
|
||||
"#define LDBL_MIN DBL_MIN\n"
|
||||
"\n"
|
||||
"#define FLT_TRUE_MIN 0x1p-149\n"
|
||||
"#define DBL_TRUE_MIN 0x0.0000000000001p-1022\n"
|
||||
"#define LDBL_TRUE_MIN DBL_TRUE_MIN\n"
|
||||
"\n"
|
||||
"#define FLT_EVAL_METHOD 0\n"
|
||||
"#define FLT_ROUNDS 1 /* round to the nearest */\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef __FLOAT_H */\n";
|
@ -1,38 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See 5.2.4.2 */
|
||||
static char limits_str[]
|
||||
= "#ifndef __LIMITS_H\n"
|
||||
"#define __LIMITS_H\n"
|
||||
"\n"
|
||||
"#define CHAR_BIT 8\n"
|
||||
"\n"
|
||||
"#define SCHAR_MIN (-SCHAR_MAX - 1)\n"
|
||||
"#define SCHAR_MAX 127\n"
|
||||
"#define UCHAR_MAX (SCHAR_MAX * 2 + 1)\n"
|
||||
"\n"
|
||||
"#define MB_LEN_MAX 1\n"
|
||||
"\n"
|
||||
"#define SHRT_MIN (-SHRT_MAX - 1)\n"
|
||||
"#define SHRT_MAX 32767\n"
|
||||
"#define USHRT_MAX (SHRT_MAX * 2 + 1)\n"
|
||||
"\n"
|
||||
"#define INT_MIN (-INT_MAX - 1)\n"
|
||||
"#define INT_MAX 2147483647\n"
|
||||
"#define UINT_MAX (INT_MAX * 2u + 1u)\n"
|
||||
"\n"
|
||||
"#define LONG_MIN (-LONG_MAX - 1l)\n"
|
||||
"#define LONG_MAX 9223372036854775807l\n"
|
||||
"#define ULONG_MAX (LONG_MAX * 2ul + 1ul)\n"
|
||||
"\n"
|
||||
"#define LLONG_MIN LONG_MIN\n"
|
||||
"#define LLONG_MAX LONG_MAX\n"
|
||||
"#define ULLONG_MAX ULONG_MAX\n"
|
||||
"\n"
|
||||
"/* signed char by default */\n"
|
||||
"#define CHAR_MIN SCHAR_MIN\n"
|
||||
"#define CHAR_MAX SCHAR_MAX\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef __LIMITS_H */\n";
|
@ -1,27 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
static char stdarg_str[]
|
||||
= "#ifndef __STDARG_H\n"
|
||||
"#define __STDARG_H\n"
|
||||
"\n"
|
||||
"typedef struct {\n"
|
||||
" void *__stack;\n"
|
||||
" void *__gr_top;\n"
|
||||
" void *__vr_top;\n"
|
||||
" int __gr_offs;\n"
|
||||
" int __vr_offs;\n"
|
||||
"} va_list;\n"
|
||||
"\n"
|
||||
"#define va_start(ap, param) __builtin_va_start (ap)\n"
|
||||
"#define va_arg(ap, type) __builtin_va_arg(ap, (type *) 0)\n"
|
||||
"#define va_end(ap) 0\n"
|
||||
"#define va_copy(dest, src) ((dest)[0] = (src)[0])\n"
|
||||
"\n"
|
||||
"/* For standard headers of a GNU system: */\n"
|
||||
"#ifndef __GNUC_VA_LIST\n"
|
||||
"#define __GNUC_VA_LIST 1\n"
|
||||
"#endif\n"
|
||||
"typedef va_list __gnuc_va_list;\n"
|
||||
"#endif /* #ifndef __STDARG_H */\n";
|
@ -1,19 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.19 */
|
||||
static char stddef_str[]
|
||||
= "#ifndef __STDDEF_H\n"
|
||||
"#define __STDDEF_H\n"
|
||||
"\n"
|
||||
"typedef long ptrdiff_t;\n"
|
||||
"typedef unsigned long size_t;\n"
|
||||
"typedef long double max_align_t;\n"
|
||||
"typedef unsigned int wchar_t;\n"
|
||||
"\n"
|
||||
"#define NULL ((void *) 0)\n"
|
||||
"\n"
|
||||
"#define offsetof(type, member_designator) ((size_t) & ((type *) 0)->member_designator)\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef __STDDEF_H */\n";
|
@ -1,130 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.20 */
|
||||
static char stdint_str[]
|
||||
= "#ifndef _STDINT_H\n"
|
||||
"#define _STDINT_H 1\n"
|
||||
"\n"
|
||||
"#ifndef __int8_t_defined\n"
|
||||
"#define __int8_t_defined\n"
|
||||
"typedef signed char int8_t;\n"
|
||||
"#endif\n"
|
||||
"typedef short int int16_t;\n"
|
||||
"typedef int int32_t;\n"
|
||||
"typedef long int int64_t;\n"
|
||||
"\n"
|
||||
"typedef unsigned char uint8_t;\n"
|
||||
"typedef unsigned short int uint16_t;\n"
|
||||
"typedef unsigned int uint32_t;\n"
|
||||
"typedef unsigned long int uint64_t;\n"
|
||||
"\n"
|
||||
"typedef signed char int_least8_t;\n"
|
||||
"typedef short int int_least16_t;\n"
|
||||
"typedef int int_least32_t;\n"
|
||||
"typedef long int int_least64_t;\n"
|
||||
"\n"
|
||||
"typedef unsigned char uint_least8_t;\n"
|
||||
"typedef unsigned short int uint_least16_t;\n"
|
||||
"typedef unsigned int uint_least32_t;\n"
|
||||
"typedef unsigned long int uint_least64_t;\n"
|
||||
"\n"
|
||||
"typedef signed char int_fast8_t;\n"
|
||||
"typedef long int int_fast16_t;\n"
|
||||
"typedef long int int_fast32_t;\n"
|
||||
"typedef long int int_fast64_t;\n"
|
||||
"\n"
|
||||
"typedef unsigned char uint_fast8_t;\n"
|
||||
"typedef unsigned long int uint_fast16_t;\n"
|
||||
"typedef unsigned long int uint_fast32_t;\n"
|
||||
"typedef unsigned long int uint_fast64_t;\n"
|
||||
"\n"
|
||||
"#define __intptr_t_defined\n"
|
||||
"typedef long int intptr_t;\n"
|
||||
"typedef unsigned long int uintptr_t;\n"
|
||||
"\n"
|
||||
"typedef long int intmax_t;\n"
|
||||
"typedef unsigned long int uintmax_t;\n"
|
||||
"\n"
|
||||
"#define __INT64_C(c) c##L\n"
|
||||
"#define __UINT64_C(c) c##UL\n"
|
||||
"\n"
|
||||
"#define INT8_MIN (-128)\n"
|
||||
"#define INT16_MIN (-32768)\n"
|
||||
"#define INT32_MIN (-2147483648)\n"
|
||||
"#define INT64_MIN (-9223372036854775808l)\n"
|
||||
"\n"
|
||||
"#define INT8_MAX (127)\n"
|
||||
"#define INT16_MAX (32767)\n"
|
||||
"#define INT32_MAX (2147483647)\n"
|
||||
"#define INT64_MAX (9223372036854775807l)\n"
|
||||
"\n"
|
||||
"#define UINT8_MAX (255)\n"
|
||||
"#define UINT16_MAX (65535)\n"
|
||||
"#define UINT32_MAX (4294967295u)\n"
|
||||
"#define UINT64_MAX (18446744073709551615ul)\n"
|
||||
"\n"
|
||||
"#define INT_LEAST8_MIN (-128)\n"
|
||||
"#define INT_LEAST16_MIN (-32768)\n"
|
||||
"#define INT_LEAST32_MIN (-2147483648)\n"
|
||||
"#define INT_LEAST64_MIN (-9223372036854775808L)\n"
|
||||
"\n"
|
||||
"#define INT_LEAST8_MAX (127)\n"
|
||||
"#define INT_LEAST16_MAX (32767)\n"
|
||||
"#define INT_LEAST32_MAX (2147483647)\n"
|
||||
"#define INT_LEAST64_MAX (9223372036854775807L)\n"
|
||||
"\n"
|
||||
"#define UINT_LEAST8_MAX (255)\n"
|
||||
"#define UINT_LEAST16_MAX (65535)\n"
|
||||
"#define UINT_LEAST32_MAX (4294967295U)\n"
|
||||
"#define UINT_LEAST64_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define INT_FAST8_MIN (-128)\n"
|
||||
"#define INT_FAST16_MIN (-9223372036854775808L)\n"
|
||||
"#define INT_FAST32_MIN (-9223372036854775808L)\n"
|
||||
"#define INT_FAST64_MIN (-9223372036854775808L)\n"
|
||||
"\n"
|
||||
"#define INT_FAST8_MAX (127)\n"
|
||||
"#define INT_FAST16_MAX (9223372036854775807L)\n"
|
||||
"#define INT_FAST32_MAX (9223372036854775807L)\n"
|
||||
"#define INT_FAST64_MAX (9223372036854775807L)\n"
|
||||
"\n"
|
||||
"#define UINT_FAST8_MAX (255)\n"
|
||||
"#define UINT_FAST16_MAX (18446744073709551615UL)\n"
|
||||
"#define UINT_FAST32_MAX (18446744073709551615UL)\n"
|
||||
"#define UINT_FAST64_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define INTPTR_MIN (-9223372036854775808L)\n"
|
||||
"#define INTPTR_MAX (9223372036854775807L)\n"
|
||||
"#define UINTPTR_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define INTMAX_MIN (-9223372036854775808L)\n"
|
||||
"#define INTMAX_MAX (9223372036854775807L)\n"
|
||||
"#define UINTMAX_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define PTRDIFF_MIN (-9223372036854775808L)\n"
|
||||
"#define PTRDIFF_MAX (9223372036854775807L)\n"
|
||||
"\n"
|
||||
"#define SIZE_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"/* For signed wchar_t and wint_t: */\n"
|
||||
"#define WCHAR_MIN INT32_MIN\n"
|
||||
"#define WCHAR_MAX INT32_MAX\n"
|
||||
"#define WINT_MIN WCHAR_MIN\n"
|
||||
"#define WINT_MAX WCHAR_MAX\n"
|
||||
"\n"
|
||||
"#define INT8_C(value) value\n"
|
||||
"#define INT16_C(value) value\n"
|
||||
"#define INT32_C(value) value\n"
|
||||
"#define INT64_C(value) value##L\n"
|
||||
"\n"
|
||||
"#define UINT8_C(value) value\n"
|
||||
"#define UINT16_C(value) value\n"
|
||||
"#define UINT32_C(value) value##U\n"
|
||||
"#define UINT64_C(value) value##UL\n"
|
||||
"\n"
|
||||
"#define INTMAX_C(value) value##L\n"
|
||||
"#define UINTMAX_C(value) value##UL\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef _STDINT_H */\n";
|
File diff suppressed because it is too large
Load Diff
@ -1,21 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.9 */
|
||||
static char iso646_str[]
|
||||
= "#ifndef __ISO646_H\n"
|
||||
"#define __ISO646_H\n"
|
||||
"\n"
|
||||
"#define and &&\n"
|
||||
"#define and_eq &=\n"
|
||||
"#define bitand &\n"
|
||||
"#define bitor |\n"
|
||||
"#define compl ~\n"
|
||||
"#define not !\n"
|
||||
"#define not_eq !=\n"
|
||||
"#define or ||\n"
|
||||
"#define or_eq |=\n"
|
||||
"#define xor ^\n"
|
||||
"#define xor_eq ^=\n"
|
||||
"#endif /* #ifndef __ISO646_H */\n";
|
@ -1,14 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.15 */
|
||||
static char stdalign_str[]
|
||||
= "#ifndef __STDALIGN_H\n"
|
||||
"#define __STDALIGN_H\n"
|
||||
"\n"
|
||||
"#define alignas _Alignas\n"
|
||||
"#define alignof _Alignof\n"
|
||||
"#define __alignas_is_defined 1\n"
|
||||
"#define __alignof_is_defined 1\n"
|
||||
"#endif /* #ifndef __STDALIGN_H */\n";
|
@ -1,14 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.18 */
|
||||
static char stdbool_str[]
|
||||
= "#ifndef __STDBOOL_H\n"
|
||||
"#define __STDBOOL_H\n"
|
||||
"\n"
|
||||
"#define bool _Bool\n"
|
||||
"#define true 1\n"
|
||||
"#define false 0\n"
|
||||
"#define __bool_true_false_are_defined 1\n"
|
||||
"#endif /* #ifndef __STDBOOL_H */\n";
|
@ -1,11 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.23 */
|
||||
static char stdnoreturn_str[]
|
||||
= "#ifndef __STDNORETURN_H\n"
|
||||
"#define __STDNORETURN_H\n"
|
||||
"\n"
|
||||
"#define noreturn _Noreturn\n"
|
||||
"#endif /* #ifndef __STDNORETURN_H */\n";
|
@ -1,60 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 5.2.4.2.2 */
|
||||
static char float_str[]
|
||||
= "#ifndef __FLOAT_H\n"
|
||||
"#define __FLOAT_H\n"
|
||||
"\n"
|
||||
"#define FLT_RADIX 2\n"
|
||||
"\n"
|
||||
"#define FLT_MANT_DIG 24\n"
|
||||
"#define DBL_MANT_DIG 53\n"
|
||||
"#define LDBL_MANT_DIG DBL_MANT_DIG\n"
|
||||
"\n"
|
||||
"#define FLT_DECIMAL_DIG 9\n"
|
||||
"#define DBL_DECIMAL_DIG 17\n"
|
||||
"#define LDBL_DECIMAL_DIG DBL_DECIMAL_DIG\n"
|
||||
"#define FLT_DIG FLT_DECIMAL_DIG\n"
|
||||
"#define DBL_DIG DBL_DECIMAL_DIG\n"
|
||||
"#define LDBL_DIG LDBL_DECIMAL_DIG\n"
|
||||
"\n"
|
||||
"#define DECIMAL_DIG LDBL_DECIMAL_DIG\n"
|
||||
"\n"
|
||||
"#define FLT_MIN_EXP -125\n"
|
||||
"#define DBL_MIN_EXP -1021\n"
|
||||
"#define LDBL_MIN_EXP DBL_MIN_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MIN_10_EXP -37\n"
|
||||
"#define DBL_MIN_10_EXP -307\n"
|
||||
"#define LDBL_MIN_10_EXP DBL_MIN_10_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MAX_EXP 128\n"
|
||||
"#define DBL_MAX_EXP 1024\n"
|
||||
"#define LDBL_MAX_EXP DBL_MAX_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MAX_10_EXP 38\n"
|
||||
"#define DBL_MAX_10_EXP 308\n"
|
||||
"#define LDBL_MAX_10_EXP DBL_MAX_10_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MAX 0x1.fffffep+127\n"
|
||||
"#define DBL_MAX 0x1.fffffffffffffp+1023\n"
|
||||
"#define LDBL_MAX DBL_MAX\n"
|
||||
"\n"
|
||||
"#define FLT_EPSILON 0x1p-23\n"
|
||||
"#define DBL_EPSILON 0x1p-52\n"
|
||||
"#define LDBL_EPSILON DBL_EPSILON\n"
|
||||
"\n"
|
||||
"#define FLT_MIN 0x1p-126\n"
|
||||
"#define DBL_MIN 0x1p-1022\n"
|
||||
"#define LDBL_MIN DBL_MIN\n"
|
||||
"\n"
|
||||
"#define FLT_TRUE_MIN 0x1p-149\n"
|
||||
"#define DBL_TRUE_MIN 0x0.0000000000001p-1022\n"
|
||||
"#define LDBL_TRUE_MIN DBL_TRUE_MIN\n"
|
||||
"\n"
|
||||
"#define FLT_EVAL_METHOD 0\n"
|
||||
"#define FLT_ROUNDS 1 /* round to the nearest */\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef __FLOAT_H */\n";
|
@ -1,38 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See 5.2.4.2 */
|
||||
static char limits_str[]
|
||||
= "#ifndef __LIMITS_H\n"
|
||||
"#define __LIMITS_H\n"
|
||||
"\n"
|
||||
"#define CHAR_BIT 8\n"
|
||||
"\n"
|
||||
"#define SCHAR_MIN (-SCHAR_MAX - 1)\n"
|
||||
"#define SCHAR_MAX 127\n"
|
||||
"#define UCHAR_MAX (SCHAR_MAX * 2 + 1)\n"
|
||||
"\n"
|
||||
"#define MB_LEN_MAX 1\n"
|
||||
"\n"
|
||||
"#define SHRT_MIN (-SHRT_MAX - 1)\n"
|
||||
"#define SHRT_MAX 32767\n"
|
||||
"#define USHRT_MAX (SHRT_MAX * 2 + 1)\n"
|
||||
"\n"
|
||||
"#define INT_MIN (-INT_MAX - 1)\n"
|
||||
"#define INT_MAX 2147483647\n"
|
||||
"#define UINT_MAX (INT_MAX * 2u + 1u)\n"
|
||||
"\n"
|
||||
"#define LONG_MIN (-LONG_MAX - 1l)\n"
|
||||
"#define LONG_MAX 9223372036854775807l\n"
|
||||
"#define ULONG_MAX (LONG_MAX * 2ul + 1ul)\n"
|
||||
"\n"
|
||||
"#define LLONG_MIN LONG_MIN\n"
|
||||
"#define LLONG_MAX LONG_MAX\n"
|
||||
"#define ULLONG_MAX ULONG_MAX\n"
|
||||
"\n"
|
||||
"/* unsigned char by default */\n"
|
||||
"#define CHAR_MIN 0\n"
|
||||
"#define CHAR_MAX UCHAR_MAX\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef __LIMITS_H */\n";
|
@ -1,21 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
static char stdarg_str[]
|
||||
= "#ifndef __STDARG_H\n"
|
||||
"#define __STDARG_H\n"
|
||||
"\n"
|
||||
"typedef void *va_list[1];\n"
|
||||
"\n"
|
||||
"#define va_start(ap, param) __builtin_va_start (ap)\n"
|
||||
"#define va_arg(ap, type) __builtin_va_arg(ap, (type *) 0)\n"
|
||||
"#define va_end(ap) 0\n"
|
||||
"#define va_copy(dest, src) ((dest) = (src))\n"
|
||||
"\n"
|
||||
"/* For standard headers of a GNU system: */\n"
|
||||
"#ifndef __GNUC_VA_LIST\n"
|
||||
"#define __GNUC_VA_LIST 1\n"
|
||||
"#endif\n"
|
||||
"typedef va_list __gnuc_va_list;\n"
|
||||
"#endif /* #ifndef __STDARG_H */\n";
|
@ -1,19 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.19 */
|
||||
static char stddef_str[]
|
||||
= "#ifndef __STDDEF_H\n"
|
||||
"#define __STDDEF_H\n"
|
||||
"\n"
|
||||
"typedef long ptrdiff_t;\n"
|
||||
"typedef unsigned long size_t;\n"
|
||||
"typedef long double max_align_t;\n"
|
||||
"typedef unsigned int wchar_t;\n"
|
||||
"\n"
|
||||
"#define NULL ((void *) 0)\n"
|
||||
"\n"
|
||||
"#define offsetof(type, member_designator) ((size_t) & ((type *) 0)->member_designator)\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef __STDDEF_H */\n";
|
@ -1,130 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.20 */
|
||||
static char stdint_str[]
|
||||
= "#ifndef _STDINT_H\n"
|
||||
"#define _STDINT_H 1\n"
|
||||
"\n"
|
||||
"#ifndef __int8_t_defined\n"
|
||||
"#define __int8_t_defined\n"
|
||||
"typedef signed char int8_t;\n"
|
||||
"#endif\n"
|
||||
"typedef short int int16_t;\n"
|
||||
"typedef int int32_t;\n"
|
||||
"typedef long int int64_t;\n"
|
||||
"\n"
|
||||
"typedef unsigned char uint8_t;\n"
|
||||
"typedef unsigned short int uint16_t;\n"
|
||||
"typedef unsigned int uint32_t;\n"
|
||||
"typedef unsigned long int uint64_t;\n"
|
||||
"\n"
|
||||
"typedef signed char int_least8_t;\n"
|
||||
"typedef short int int_least16_t;\n"
|
||||
"typedef int int_least32_t;\n"
|
||||
"typedef long int int_least64_t;\n"
|
||||
"\n"
|
||||
"typedef unsigned char uint_least8_t;\n"
|
||||
"typedef unsigned short int uint_least16_t;\n"
|
||||
"typedef unsigned int uint_least32_t;\n"
|
||||
"typedef unsigned long int uint_least64_t;\n"
|
||||
"\n"
|
||||
"typedef signed char int_fast8_t;\n"
|
||||
"typedef long int int_fast16_t;\n"
|
||||
"typedef long int int_fast32_t;\n"
|
||||
"typedef long int int_fast64_t;\n"
|
||||
"\n"
|
||||
"typedef unsigned char uint_fast8_t;\n"
|
||||
"typedef unsigned long int uint_fast16_t;\n"
|
||||
"typedef unsigned long int uint_fast32_t;\n"
|
||||
"typedef unsigned long int uint_fast64_t;\n"
|
||||
"\n"
|
||||
"#define __intptr_t_defined\n"
|
||||
"typedef long int intptr_t;\n"
|
||||
"typedef unsigned long int uintptr_t;\n"
|
||||
"\n"
|
||||
"typedef long int intmax_t;\n"
|
||||
"typedef unsigned long int uintmax_t;\n"
|
||||
"\n"
|
||||
"#define __INT64_C(c) c##L\n"
|
||||
"#define __UINT64_C(c) c##UL\n"
|
||||
"\n"
|
||||
"#define INT8_MIN (-128)\n"
|
||||
"#define INT16_MIN (-32768)\n"
|
||||
"#define INT32_MIN (-2147483648)\n"
|
||||
"#define INT64_MIN (-9223372036854775808l)\n"
|
||||
"\n"
|
||||
"#define INT8_MAX (127)\n"
|
||||
"#define INT16_MAX (32767)\n"
|
||||
"#define INT32_MAX (2147483647)\n"
|
||||
"#define INT64_MAX (9223372036854775807l)\n"
|
||||
"\n"
|
||||
"#define UINT8_MAX (255)\n"
|
||||
"#define UINT16_MAX (65535)\n"
|
||||
"#define UINT32_MAX (4294967295u)\n"
|
||||
"#define UINT64_MAX (18446744073709551615ul)\n"
|
||||
"\n"
|
||||
"#define INT_LEAST8_MIN (-128)\n"
|
||||
"#define INT_LEAST16_MIN (-32768)\n"
|
||||
"#define INT_LEAST32_MIN (-2147483648)\n"
|
||||
"#define INT_LEAST64_MIN (-9223372036854775808L)\n"
|
||||
"\n"
|
||||
"#define INT_LEAST8_MAX (127)\n"
|
||||
"#define INT_LEAST16_MAX (32767)\n"
|
||||
"#define INT_LEAST32_MAX (2147483647)\n"
|
||||
"#define INT_LEAST64_MAX (9223372036854775807L)\n"
|
||||
"\n"
|
||||
"#define UINT_LEAST8_MAX (255)\n"
|
||||
"#define UINT_LEAST16_MAX (65535)\n"
|
||||
"#define UINT_LEAST32_MAX (4294967295U)\n"
|
||||
"#define UINT_LEAST64_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define INT_FAST8_MIN (-128)\n"
|
||||
"#define INT_FAST16_MIN (-9223372036854775808L)\n"
|
||||
"#define INT_FAST32_MIN (-9223372036854775808L)\n"
|
||||
"#define INT_FAST64_MIN (-9223372036854775808L)\n"
|
||||
"\n"
|
||||
"#define INT_FAST8_MAX (127)\n"
|
||||
"#define INT_FAST16_MAX (9223372036854775807L)\n"
|
||||
"#define INT_FAST32_MAX (9223372036854775807L)\n"
|
||||
"#define INT_FAST64_MAX (9223372036854775807L)\n"
|
||||
"\n"
|
||||
"#define UINT_FAST8_MAX (255)\n"
|
||||
"#define UINT_FAST16_MAX (18446744073709551615UL)\n"
|
||||
"#define UINT_FAST32_MAX (18446744073709551615UL)\n"
|
||||
"#define UINT_FAST64_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define INTPTR_MIN (-9223372036854775808L)\n"
|
||||
"#define INTPTR_MAX (9223372036854775807L)\n"
|
||||
"#define UINTPTR_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define INTMAX_MIN (-9223372036854775808L)\n"
|
||||
"#define INTMAX_MAX (9223372036854775807L)\n"
|
||||
"#define UINTMAX_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define PTRDIFF_MIN (-9223372036854775808L)\n"
|
||||
"#define PTRDIFF_MAX (9223372036854775807L)\n"
|
||||
"\n"
|
||||
"#define SIZE_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"/* For signed wchar_t and wint_t: */\n"
|
||||
"#define WCHAR_MIN INT32_MIN\n"
|
||||
"#define WCHAR_MAX INT32_MAX\n"
|
||||
"#define WINT_MIN WCHAR_MIN\n"
|
||||
"#define WINT_MAX WCHAR_MAX\n"
|
||||
"\n"
|
||||
"#define INT8_C(value) value\n"
|
||||
"#define INT16_C(value) value\n"
|
||||
"#define INT32_C(value) value\n"
|
||||
"#define INT64_C(value) value##L\n"
|
||||
"\n"
|
||||
"#define UINT8_C(value) value\n"
|
||||
"#define UINT16_C(value) value\n"
|
||||
"#define UINT32_C(value) value##U\n"
|
||||
"#define UINT64_C(value) value##UL\n"
|
||||
"\n"
|
||||
"#define INTMAX_C(value) value##L\n"
|
||||
"#define UINTMAX_C(value) value##UL\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef _STDINT_H */\n";
|
@ -1,60 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 5.2.4.2.2 */
|
||||
static char float_str[]
|
||||
= "#ifndef __FLOAT_H\n"
|
||||
"#define __FLOAT_H\n"
|
||||
"\n"
|
||||
"#define FLT_RADIX 2\n"
|
||||
"\n"
|
||||
"#define FLT_MANT_DIG 24\n"
|
||||
"#define DBL_MANT_DIG 53\n"
|
||||
"#define LDBL_MANT_DIG DBL_MANT_DIG\n"
|
||||
"\n"
|
||||
"#define FLT_DECIMAL_DIG 9\n"
|
||||
"#define DBL_DECIMAL_DIG 17\n"
|
||||
"#define LDBL_DECIMAL_DIG DBL_DECIMAL_DIG\n"
|
||||
"#define FLT_DIG FLT_DECIMAL_DIG\n"
|
||||
"#define DBL_DIG DBL_DECIMAL_DIG\n"
|
||||
"#define LDBL_DIG LDBL_DECIMAL_DIG\n"
|
||||
"\n"
|
||||
"#define DECIMAL_DIG LDBL_DECIMAL_DIG\n"
|
||||
"\n"
|
||||
"#define FLT_MIN_EXP -125\n"
|
||||
"#define DBL_MIN_EXP -1021\n"
|
||||
"#define LDBL_MIN_EXP DBL_MIN_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MIN_10_EXP -37\n"
|
||||
"#define DBL_MIN_10_EXP -307\n"
|
||||
"#define LDBL_MIN_10_EXP DBL_MIN_10_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MAX_EXP 128\n"
|
||||
"#define DBL_MAX_EXP 1024\n"
|
||||
"#define LDBL_MAX_EXP DBL_MAX_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MAX_10_EXP 38\n"
|
||||
"#define DBL_MAX_10_EXP 308\n"
|
||||
"#define LDBL_MAX_10_EXP DBL_MAX_10_EXP\n"
|
||||
"\n"
|
||||
"#define FLT_MAX 0x1.fffffep+127\n"
|
||||
"#define DBL_MAX 0x1.fffffffffffffp+1023\n"
|
||||
"#define LDBL_MAX DBL_MAX\n"
|
||||
"\n"
|
||||
"#define FLT_EPSILON 0x1p-23\n"
|
||||
"#define DBL_EPSILON 0x1p-52\n"
|
||||
"#define LDBL_EPSILON DBL_EPSILON\n"
|
||||
"\n"
|
||||
"#define FLT_MIN 0x1p-126\n"
|
||||
"#define DBL_MIN 0x1p-1022\n"
|
||||
"#define LDBL_MIN DBL_MIN\n"
|
||||
"\n"
|
||||
"#define FLT_TRUE_MIN 0x1p-149\n"
|
||||
"#define DBL_TRUE_MIN 0x0.0000000000001p-1022\n"
|
||||
"#define LDBL_TRUE_MIN DBL_TRUE_MIN\n"
|
||||
"\n"
|
||||
"#define FLT_EVAL_METHOD 0\n"
|
||||
"#define FLT_ROUNDS 1 /* round to the nearest */\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef __FLOAT_H */\n";
|
@ -1,38 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See 5.2.4.2 */
|
||||
static char limits_str[]
|
||||
= "#ifndef __LIMITS_H\n"
|
||||
"#define __LIMITS_H\n"
|
||||
"\n"
|
||||
"#define CHAR_BIT 8\n"
|
||||
"\n"
|
||||
"#define SCHAR_MIN (-SCHAR_MAX - 1)\n"
|
||||
"#define SCHAR_MAX 127\n"
|
||||
"#define UCHAR_MAX (SCHAR_MAX * 2 + 1)\n"
|
||||
"\n"
|
||||
"#define MB_LEN_MAX 1\n"
|
||||
"\n"
|
||||
"#define SHRT_MIN (-SHRT_MAX - 1)\n"
|
||||
"#define SHRT_MAX 32767\n"
|
||||
"#define USHRT_MAX (SHRT_MAX * 2 + 1)\n"
|
||||
"\n"
|
||||
"#define INT_MIN (-INT_MAX - 1)\n"
|
||||
"#define INT_MAX 2147483647\n"
|
||||
"#define UINT_MAX (INT_MAX * 2u + 1u)\n"
|
||||
"\n"
|
||||
"#define LONG_MIN (-LONG_MAX - 1l)\n"
|
||||
"#define LONG_MAX 9223372036854775807l\n"
|
||||
"#define ULONG_MAX (LONG_MAX * 2ul + 1ul)\n"
|
||||
"\n"
|
||||
"#define LLONG_MIN LONG_MIN\n"
|
||||
"#define LLONG_MAX LONG_MAX\n"
|
||||
"#define ULLONG_MAX ULONG_MAX\n"
|
||||
"\n"
|
||||
"/* unsigned char by default */\n"
|
||||
"#define CHAR_MIN 0\n"
|
||||
"#define CHAR_MAX UCHAR_MAX\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef __LIMITS_H */\n";
|
@ -1,25 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
static char stdarg_str[]
|
||||
= "#ifndef __STDARG_H\n"
|
||||
"#define __STDARG_H\n"
|
||||
"\n"
|
||||
"typedef struct {\n"
|
||||
" long __gpr, __fpr;\n"
|
||||
" void *__overflow_arg_area;\n"
|
||||
" void *__reg_save_area;\n"
|
||||
"} va_list[1];\n"
|
||||
"\n"
|
||||
"#define va_start(ap, param) __builtin_va_start (ap)\n"
|
||||
"#define va_arg(ap, type) __builtin_va_arg(ap, (type *) 0)\n"
|
||||
"#define va_end(ap) 0\n"
|
||||
"#define va_copy(dest, src) ((dest) = (src))\n"
|
||||
"\n"
|
||||
"/* For standard headers of a GNU system: */\n"
|
||||
"#ifndef __GNUC_VA_LIST\n"
|
||||
"#define __GNUC_VA_LIST 1\n"
|
||||
"#endif\n"
|
||||
"typedef va_list __gnuc_va_list;\n"
|
||||
"#endif /* #ifndef __STDARG_H */\n";
|
@ -1,19 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.19 */
|
||||
static char stddef_str[]
|
||||
= "#ifndef __STDDEF_H\n"
|
||||
"#define __STDDEF_H\n"
|
||||
"\n"
|
||||
"typedef long ptrdiff_t;\n"
|
||||
"typedef unsigned long size_t;\n"
|
||||
"typedef long double max_align_t;\n"
|
||||
"typedef unsigned int wchar_t;\n"
|
||||
"\n"
|
||||
"#define NULL ((void *) 0)\n"
|
||||
"\n"
|
||||
"#define offsetof(type, member_designator) ((size_t) & ((type *) 0)->member_designator)\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef __STDDEF_H */\n";
|
@ -1,130 +0,0 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2020-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
/* See C11 7.20 */
|
||||
static char stdint_str[]
|
||||
= "#ifndef _STDINT_H\n"
|
||||
"#define _STDINT_H 1\n"
|
||||
"\n"
|
||||
"#ifndef __int8_t_defined\n"
|
||||
"#define __int8_t_defined\n"
|
||||
"typedef signed char int8_t;\n"
|
||||
"#endif\n"
|
||||
"typedef short int int16_t;\n"
|
||||
"typedef int int32_t;\n"
|
||||
"typedef long int int64_t;\n"
|
||||
"\n"
|
||||
"typedef unsigned char uint8_t;\n"
|
||||
"typedef unsigned short int uint16_t;\n"
|
||||
"typedef unsigned int uint32_t;\n"
|
||||
"typedef unsigned long int uint64_t;\n"
|
||||
"\n"
|
||||
"typedef signed char int_least8_t;\n"
|
||||
"typedef short int int_least16_t;\n"
|
||||
"typedef int int_least32_t;\n"
|
||||
"typedef long int int_least64_t;\n"
|
||||
"\n"
|
||||
"typedef unsigned char uint_least8_t;\n"
|
||||
"typedef unsigned short int uint_least16_t;\n"
|
||||
"typedef unsigned int uint_least32_t;\n"
|
||||
"typedef unsigned long int uint_least64_t;\n"
|
||||
"\n"
|
||||
"typedef signed char int_fast8_t;\n"
|
||||
"typedef long int int_fast16_t;\n"
|
||||
"typedef long int int_fast32_t;\n"
|
||||
"typedef long int int_fast64_t;\n"
|
||||
"\n"
|
||||
"typedef unsigned char uint_fast8_t;\n"
|
||||
"typedef unsigned long int uint_fast16_t;\n"
|
||||
"typedef unsigned long int uint_fast32_t;\n"
|
||||
"typedef unsigned long int uint_fast64_t;\n"
|
||||
"\n"
|
||||
"#define __intptr_t_defined\n"
|
||||
"typedef long int intptr_t;\n"
|
||||
"typedef unsigned long int uintptr_t;\n"
|
||||
"\n"
|
||||
"typedef long int intmax_t;\n"
|
||||
"typedef unsigned long int uintmax_t;\n"
|
||||
"\n"
|
||||
"#define __INT64_C(c) c##L\n"
|
||||
"#define __UINT64_C(c) c##UL\n"
|
||||
"\n"
|
||||
"#define INT8_MIN (-128)\n"
|
||||
"#define INT16_MIN (-32768)\n"
|
||||
"#define INT32_MIN (-2147483648)\n"
|
||||
"#define INT64_MIN (-9223372036854775808l)\n"
|
||||
"\n"
|
||||
"#define INT8_MAX (127)\n"
|
||||
"#define INT16_MAX (32767)\n"
|
||||
"#define INT32_MAX (2147483647)\n"
|
||||
"#define INT64_MAX (9223372036854775807l)\n"
|
||||
"\n"
|
||||
"#define UINT8_MAX (255)\n"
|
||||
"#define UINT16_MAX (65535)\n"
|
||||
"#define UINT32_MAX (4294967295u)\n"
|
||||
"#define UINT64_MAX (18446744073709551615ul)\n"
|
||||
"\n"
|
||||
"#define INT_LEAST8_MIN (-128)\n"
|
||||
"#define INT_LEAST16_MIN (-32768)\n"
|
||||
"#define INT_LEAST32_MIN (-2147483648)\n"
|
||||
"#define INT_LEAST64_MIN (-9223372036854775808L)\n"
|
||||
"\n"
|
||||
"#define INT_LEAST8_MAX (127)\n"
|
||||
"#define INT_LEAST16_MAX (32767)\n"
|
||||
"#define INT_LEAST32_MAX (2147483647)\n"
|
||||
"#define INT_LEAST64_MAX (9223372036854775807L)\n"
|
||||
"\n"
|
||||
"#define UINT_LEAST8_MAX (255)\n"
|
||||
"#define UINT_LEAST16_MAX (65535)\n"
|
||||
"#define UINT_LEAST32_MAX (4294967295U)\n"
|
||||
"#define UINT_LEAST64_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define INT_FAST8_MIN (-128)\n"
|
||||
"#define INT_FAST16_MIN (-9223372036854775808L)\n"
|
||||
"#define INT_FAST32_MIN (-9223372036854775808L)\n"
|
||||
"#define INT_FAST64_MIN (-9223372036854775808L)\n"
|
||||
"\n"
|
||||
"#define INT_FAST8_MAX (127)\n"
|
||||
"#define INT_FAST16_MAX (9223372036854775807L)\n"
|
||||
"#define INT_FAST32_MAX (9223372036854775807L)\n"
|
||||
"#define INT_FAST64_MAX (9223372036854775807L)\n"
|
||||
"\n"
|
||||
"#define UINT_FAST8_MAX (255)\n"
|
||||
"#define UINT_FAST16_MAX (18446744073709551615UL)\n"
|
||||
"#define UINT_FAST32_MAX (18446744073709551615UL)\n"
|
||||
"#define UINT_FAST64_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define INTPTR_MIN (-9223372036854775808L)\n"
|
||||
"#define INTPTR_MAX (9223372036854775807L)\n"
|
||||
"#define UINTPTR_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define INTMAX_MIN (-9223372036854775808L)\n"
|
||||
"#define INTMAX_MAX (9223372036854775807L)\n"
|
||||
"#define UINTMAX_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"#define PTRDIFF_MIN (-9223372036854775808L)\n"
|
||||
"#define PTRDIFF_MAX (9223372036854775807L)\n"
|
||||
"\n"
|
||||
"#define SIZE_MAX (18446744073709551615UL)\n"
|
||||
"\n"
|
||||
"/* For signed wchar_t and wint_t: */\n"
|
||||
"#define WCHAR_MIN INT32_MIN\n"
|
||||
"#define WCHAR_MAX INT32_MAX\n"
|
||||
"#define WINT_MIN WCHAR_MIN\n"
|
||||
"#define WINT_MAX WCHAR_MAX\n"
|
||||
"\n"
|
||||
"#define INT8_C(value) value\n"
|
||||
"#define INT16_C(value) value\n"
|
||||
"#define INT32_C(value) value\n"
|
||||
"#define INT64_C(value) value##L\n"
|
||||
"\n"
|
||||
"#define UINT8_C(value) value\n"
|
||||
"#define UINT16_C(value) value\n"
|
||||
"#define UINT32_C(value) value##U\n"
|
||||
"#define UINT64_C(value) value##UL\n"
|
||||
"\n"
|
||||
"#define INTMAX_C(value) value##L\n"
|
||||
"#define UINTMAX_C(value) value##UL\n"
|
||||
"\n"
|
||||
"#endif /* #ifndef _STDINT_H */\n";
|
@ -1,116 +1,101 @@
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2019-2021 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
static char x86_64_mirc[]
|
||||
= "#define __amd64 1\n"
|
||||
"#define __amd64__ 1\n"
|
||||
"#define __x86_64 1\n"
|
||||
"#define __x86_64__ 1\n"
|
||||
"#define _M_AMD64 1\n"
|
||||
"#define _M_X64 1\n"
|
||||
"\n"
|
||||
"#define __SIZEOF_DOUBLE__ 8\n"
|
||||
"#define __SIZEOF_FLOAT__ 4\n"
|
||||
"#define __SIZEOF_INT__ 4\n"
|
||||
#if !defined(_WIN32) && __SIZEOF_LONG_DOUBLE__ == 16
|
||||
"#define __SIZEOF_LONG_DOUBLE__ 16\n"
|
||||
#else
|
||||
"#define __SIZEOF_LONG_DOUBLE__ 8\n"
|
||||
#endif
|
||||
"#define __SIZEOF_LONG_LONG__ 8\n"
|
||||
"#define __SIZEOF_LONG__ 4\n"
|
||||
"#define __SIZEOF_POINTER__ 8\n"
|
||||
"#define __SIZEOF_PTRDIFF_T__ 8\n"
|
||||
"#define __SIZEOF_SHORT__ 2\n"
|
||||
"#define __SIZEOF_SIZE_T__ 8\n"
|
||||
"\n"
|
||||
"#define __BYTE_ORDER__ 1234\n"
|
||||
"#define __ORDER_LITTLE_ENDIAN__ 1234\n"
|
||||
"#define __ORDER_BIG_ENDIAN__ 4321\n"
|
||||
"\n"
|
||||
"/* Some type macros: */\n"
|
||||
"#define __SIZE_TYPE__ long long unsigned int\n"
|
||||
"#define __PTRDIFF_TYPE__ long long int\n"
|
||||
"#define __INTMAX_TYPE__ long long int\n"
|
||||
"#define __UINTMAX_TYPE__ long long unsigned int\n"
|
||||
"#define __INT8_TYPE__ signed char\n"
|
||||
"#define __INT16_TYPE__ short\n"
|
||||
"#define __INT32_TYPE__ int\n"
|
||||
"#define __INT64_TYPE__ long long int\n"
|
||||
"#define __UINT8_TYPE__ unsigned char\n"
|
||||
"#define __UINT16_TYPE__ unsigned short\n"
|
||||
"#define __UINT32_TYPE__ unsigned int\n"
|
||||
"#define __UINT64_TYPE__ long long unsigned int\n"
|
||||
"#define __INTPTR_TYPE__ long long int\n"
|
||||
"#define __UINTPTR_TYPE__ long long unsigned int\n"
|
||||
"\n"
|
||||
"#define __int8 __INT8_TYPE__\n"
|
||||
"#define __int16 __INT16_TYPE__\n"
|
||||
"#define __int32 __INT32_TYPE__\n"
|
||||
"#define __int64 __INT64_TYPE__\n"
|
||||
"\n"
|
||||
"#define __ptr32\n"
|
||||
"#define __ptr64\n"
|
||||
"#define __forceinline inline\n"
|
||||
"#define __cdecl\n"
|
||||
"#define __pragma(p)\n"
|
||||
"#define __declspec(attr)\n"
|
||||
"#define __unaligned\n"
|
||||
"\n"
|
||||
"#define __CHAR_BIT__ 8\n"
|
||||
"#define __INT8_MAX__ 127\n"
|
||||
"#define __INT16_MAX__ 32767\n"
|
||||
"#define __INT32_MAX__ 2147483647\n"
|
||||
"#define __INT64_MAX__ 9223372036854775807LL\n"
|
||||
"#define __UINT8_MAX__ (__INT8_MAX__ * 2u + 1u)\n"
|
||||
"#define __UINT16_MAX__ (__INT16_MAX__ * 2u + 1u)\n"
|
||||
"#define __UINT32_MAX__ (__INT32_MAX__ * 2u + 1u)\n"
|
||||
"#define __UINT64_MAX__ (__INT64_MAX__ * 2u + 1u)\n"
|
||||
"#define __SCHAR_MAX__ __INT8_MAX__\n"
|
||||
"#define __SHRT_MAX__ __INT16_MAX__\n"
|
||||
"#define __INT_MAX__ __INT32_MAX__\n"
|
||||
"#define __LONG_MAX__ __INT32_MAX__\n"
|
||||
"#define __LONG_LONG_MAX__ __INT64_MAX__\n"
|
||||
"#define __SIZE_MAX__ __UINT64_MAX__\n"
|
||||
"#define __PTRDIFF_MAX__ __INT64_MAX__\n"
|
||||
"#define __INTMAX_MAX__ __INT64_MAX__\n"
|
||||
"#define __UINTMAX_MAX__ __UINT64_MAX__\n"
|
||||
"#define __INTPTR_MAX__ __INT64_MAX__\n"
|
||||
"#define __UINTPTR_MAX__ __UINT64_MAX__\n"
|
||||
"\n"
|
||||
"#define __FLT_MIN_EXP__ (-125)\n"
|
||||
"#define __FLT_MAX_EXP__ 128\n"
|
||||
"#define __FLT_DIG__ 6\n"
|
||||
"#define __FLT_DECIMAL_DIG__ 9\n"
|
||||
"#define __FLT_MANT_DIG__ 24\n"
|
||||
"#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F\n"
|
||||
"#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F\n"
|
||||
"#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F\n"
|
||||
"\n"
|
||||
"#define __DBL_MIN_EXP__ (-1021)\n"
|
||||
"#define __DBL_MAX_EXP__ 1024\n"
|
||||
"#define __DBL_DIG__ 15\n"
|
||||
"#define __DBL_DECIMAL_DIG__ 17\n"
|
||||
"#define __DBL_MANT_DIG__ 53\n"
|
||||
"#define __DBL_MAX__ ((double) 1.79769313486231570814527423731704357e+308L)\n"
|
||||
"#define __DBL_MIN__ ((double) 2.22507385850720138309023271733240406e-308L)\n"
|
||||
"#define __DBL_EPSILON__ ((double) 2.22044604925031308084726333618164062e-16L)\n"
|
||||
"\n"
|
||||
"typedef unsigned short char16_t;\n"
|
||||
"typedef unsigned int char32_t;\n"
|
||||
"\n"
|
||||
"#define WIN32 1\n"
|
||||
"#define _WIN32 1\n"
|
||||
"#define __WIN32 1\n"
|
||||
"#define __WIN32__ 1\n"
|
||||
"#define WIN64 1\n"
|
||||
"#define _WIN64 1\n"
|
||||
"#define __WIN64 1\n"
|
||||
"#define __WIN64__ 1\n"
|
||||
"#define WINNT 1\n"
|
||||
"#define __WINNT 1\n"
|
||||
"#define __WINNT__ 1\n"
|
||||
"#define __MSVCRT__ 1\n"
|
||||
"\n"
|
||||
"void *alloca (long long unsigned);\n";
|
||||
/* This file is a part of MIR project.
|
||||
Copyright (C) 2019-2020 Vladimir Makarov <vmakarov.gcc@gmail.com>.
|
||||
*/
|
||||
|
||||
static char x86_64_mirc[]
|
||||
= "#define __amd64 1\n"
|
||||
"#define __amd64__ 1\n"
|
||||
"#define __x86_64 1\n"
|
||||
"#define __x86_64__ 1\n"
|
||||
"\n"
|
||||
"#define __SIZEOF_DOUBLE__ 8\n"
|
||||
"#define __SIZEOF_FLOAT__ 4\n"
|
||||
"#define __SIZEOF_INT__ 4\n"
|
||||
#if __SIZEOF_LONG_DOUBLE__ == 16
|
||||
"#define __SIZEOF_LONG_DOUBLE__ 16\n"
|
||||
#else
|
||||
"#define __SIZEOF_LONG_DOUBLE__ 8\n"
|
||||
#endif
|
||||
"#define __SIZEOF_LONG_LONG__ 8\n"
|
||||
"#define __SIZEOF_LONG__ 4\n"
|
||||
"#define __SIZEOF_POINTER__ 8\n"
|
||||
"#define __SIZEOF_PTRDIFF_T__ 8\n"
|
||||
"#define __SIZEOF_SHORT__ 2\n"
|
||||
"#define __SIZEOF_SIZE_T__ 8\n"
|
||||
"\n"
|
||||
"#define __BYTE_ORDER__ 1234\n"
|
||||
"#define __ORDER_LITTLE_ENDIAN__ 1234\n"
|
||||
"#define __ORDER_BIG_ENDIAN__ 4321\n"
|
||||
"\n"
|
||||
"/* Some type macros: */\n"
|
||||
"#define __SIZE_TYPE__ long long unsigned int\n"
|
||||
"#define __PTRDIFF_TYPE__ long long int\n"
|
||||
"#define __INTMAX_TYPE__ long long int\n"
|
||||
"#define __UINTMAX_TYPE__ long long unsigned int\n"
|
||||
"#define __INT8_TYPE__ signed char\n"
|
||||
"#define __INT16_TYPE__ short\n"
|
||||
"#define __INT32_TYPE__ int\n"
|
||||
"#define __INT64_TYPE__ long long int\n"
|
||||
"#define __UINT8_TYPE__ unsigned char\n"
|
||||
"#define __UINT16_TYPE__ unsigned short\n"
|
||||
"#define __UINT32_TYPE__ unsigned int\n"
|
||||
"#define __UINT64_TYPE__ long long unsigned int\n"
|
||||
"#define __INTPTR_TYPE__ long long int\n"
|
||||
"#define __UINTPTR_TYPE__ long long unsigned int\n"
|
||||
"\n"
|
||||
"#define __CHAR_BIT__ 8\n"
|
||||
"#define __INT8_MAX__ 127\n"
|
||||
"#define __INT16_MAX__ 32767\n"
|
||||
"#define __INT32_MAX__ 2147483647\n"
|
||||
"#define __INT64_MAX__ 9223372036854775807LL\n"
|
||||
"#define __UINT8_MAX__ (__INT8_MAX__ * 2u + 1u)\n"
|
||||
"#define __UINT16_MAX__ (__INT16_MAX__ * 2u + 1u)\n"
|
||||
"#define __UINT32_MAX__ (__INT32_MAX__ * 2u + 1u)\n"
|
||||
"#define __UINT64_MAX__ (__INT64_MAX__ * 2u + 1u)\n"
|
||||
"#define __SCHAR_MAX__ __INT8_MAX__\n"
|
||||
"#define __SHRT_MAX__ __INT16_MAX__\n"
|
||||
"#define __INT_MAX__ __INT32_MAX__\n"
|
||||
"#define __LONG_MAX__ __INT32_MAX__\n"
|
||||
"#define __LONG_LONG_MAX__ __INT64_MAX__\n"
|
||||
"#define __SIZE_MAX__ __UINT64_MAX__\n"
|
||||
"#define __PTRDIFF_MAX__ __INT64_MAX__\n"
|
||||
"#define __INTMAX_MAX__ __INT64_MAX__\n"
|
||||
"#define __UINTMAX_MAX__ __UINT64_MAX__\n"
|
||||
"#define __INTPTR_MAX__ __INT64_MAX__\n"
|
||||
"#define __UINTPTR_MAX__ __UINT64_MAX__\n"
|
||||
"\n"
|
||||
"#define __FLT_MIN_EXP__ (-125)\n"
|
||||
"#define __FLT_MAX_EXP__ 128\n"
|
||||
"#define __FLT_DIG__ 6\n"
|
||||
"#define __FLT_DECIMAL_DIG__ 9\n"
|
||||
"#define __FLT_MANT_DIG__ 24\n"
|
||||
"#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F\n"
|
||||
"#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F\n"
|
||||
"#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F\n"
|
||||
"\n"
|
||||
"#define __DBL_MIN_EXP__ (-1021)\n"
|
||||
"#define __DBL_MAX_EXP__ 1024\n"
|
||||
"#define __DBL_DIG__ 15\n"
|
||||
"#define __DBL_DECIMAL_DIG__ 17\n"
|
||||
"#define __DBL_MANT_DIG__ 53\n"
|
||||
"#define __DBL_MAX__ ((double) 1.79769313486231570814527423731704357e+308L)\n"
|
||||
"#define __DBL_MIN__ ((double) 2.22507385850720138309023271733240406e-308L)\n"
|
||||
"#define __DBL_EPSILON__ ((double) 2.22044604925031308084726333618164062e-16L)\n"
|
||||
"\n"
|
||||
"typedef unsigned short char16_t;\n"
|
||||
"typedef unsigned int char32_t;\n"
|
||||
"\n"
|
||||
"#define WIN32 1\n"
|
||||
"#define _WIN32 1\n"
|
||||
"#define __WIN32 1\n"
|
||||
"#define __WIN32__ 1\n"
|
||||
"#define WIN64 1\n"
|
||||
"#define _WIN64 1\n"
|
||||
"#define __WIN64 1\n"
|
||||
"#define __WIN64__ 1\n"
|
||||
"#define WINNT 1\n"
|
||||
"#define __WINNT 1\n"
|
||||
"#define __WINNT__ 1\n"
|
||||
"#define __MSVCRT__ 1\n"
|
||||
"\n"
|
||||
"void *alloca (long long unsigned);\n";
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue