GNU lightning

Last updated
GNU lightning
Developer(s) GNU Project
Initial releaseJanuary 19, 2001;22 years ago (2001-01-19) [1]
Stable release
2.2.2 [2]   OOjs UI icon edit-ltr-progressive.svg / 27 April 2023
Repository
Operating system Cross-platform
Platform GNU
Type Just-in-time compilation
License 2007: LGPL-3.0-or-later [lower-alpha 1]
2002: LGPL-2.1-or-later [lower-alpha 2]
Website Official website

GNU lightning is a free-software library for generating assembly language code at run-time. Version 2.1.3, released in September 2019, supports backends for SPARC (32-bit), x86 (32- and 64-bit), MIPS, ARM (32- and 64-bit), ia64, HPPA, PowerPC (32-bit), Alpha, S390 and RISC-V (64-bit). [5] [6]

Contents

Advantages over other libraries

The features GNU lightning provides make it useful for Just-in-Time Compilation. In comparison to libraries such as LLVM or libJIT, GNU lightning provides only a low-level interface for assembling from a standardized RISC assembly language—loosely based on the SPARC and MIPS architectures [7] —into the target architecture's machine language.

Disadvantages

It does not provide register allocation, data-flow or control-flow analysis, or optimization.[ citation needed ] Starting from 2.x, It generates code via intermediate graph, rather than one by one from each It's standardized instruction. This change allows inter-instruction optimization such as register allocation and dead code elimination .

Instruction set

GNU lightning's instruction set is based loosely on existing RISC architectures.

Types

When required instructions handle data with these 9 types:

TypeC equivalent
csigned char
ucunsigned char
sshort
usunsigned short
iint
uiunsigned int
llong
ffloat
ddouble

Projects that use GNU lightning

GNU Smalltalk, [8] GNU Guile, [9] and CLISP [10] make use of GNU lightning for just-in-time compilation. GNU lightning was first developed as a tool to be used in GNU Smalltalk's dynamic translator from bytecodes to native code. [11] GNU Guile 2.9.2 and later stop using GNU lightning 2.x instead their own fork based on GNU lightning 1.4 for native code generation, because GNU lightning 2.x devotes more complexity to inter-instruction optimization. [12]

Notes

  1. LGPL-3.0-or-later since 2007-07-01. [3]
  2. LGPL-2.1-or-later from 2002-06-25 until 2007-07-01. [4]

Related Research Articles

<span class="mw-page-title-main">Executable and Linkable Format</span> Standard file format for executables, object code, shared libraries, and core dumps.

In computing, the Executable and Linkable Format, is a common standard file format for executable files, object code, shared libraries, and core dumps. First published in the specification for the application binary interface (ABI) of the Unix operating system version named System V Release 4 (SVR4), and later in the Tool Interface Standard, it was quickly accepted among different vendors of Unix systems. In 1999, it was chosen as the standard binary file format for Unix and Unix-like systems on x86 processors by the 86open project.

<span class="mw-page-title-main">GNU Compiler Collection</span> Free and open-source compiler for various programming languages

The GNU Compiler Collection (GCC) is an optimizing compiler produced by the GNU Project supporting various programming languages, hardware architectures and operating systems. The Free Software Foundation (FSF) distributes GCC as free software under the GNU General Public License. GCC is a key component of the GNU toolchain and the standard compiler for most projects related to GNU and the Linux kernel. With roughly 15 million lines of code in 2019, GCC is one of the biggest free programs in existence. It has played an important role in the growth of free software, as both a tool and an example.

<span class="mw-page-title-main">GNU Debugger</span> Source-level debugger

The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, C, C++, Objective-C, Free Pascal, Fortran, Go, and partially others.

MIPS is a family of reduced instruction set computer (RISC) instruction set architectures (ISA) developed by MIPS Computer Systems, now MIPS Technologies, based in the United States.

<span class="mw-page-title-main">Reduced instruction set computer</span> Processor executing one instruction in minimal clock cycles

In computer engineering, a reduced instruction set computer (RISC) is a computer architecture designed to simplify the individual instructions given to the computer to accomplish tasks. Compared to the instructions given to a complex instruction set computer (CISC), a RISC computer might require more instructions in order to accomplish a task because the individual instructions are written in simpler code. The goal is to offset the need to process more instructions by increasing the speed of each instruction, in particular by implementing an instruction pipeline, which may be simpler to achieve given simpler instructions.

<span class="mw-page-title-main">SPARC</span> RISC instruction set architecture

SPARC is a reduced instruction set computer (RISC) instruction set architecture originally developed by Sun Microsystems. Its design was strongly influenced by the experimental Berkeley RISC system developed in the early 1980s. First developed in 1986 and released in 1987, SPARC was one of the most successful early commercial RISC systems, and its success led to the introduction of similar RISC designs from many vendors through the 1980s and 1990s.

<span class="mw-page-title-main">Single instruction, multiple data</span> Type of parallel processing

Single instruction, multiple data (SIMD) is a type of parallel processing in Flynn's taxonomy. SIMD can be internal and it can be directly accessible through an instruction set architecture (ISA), but it should not be confused with an ISA. SIMD describes computers with multiple processing elements that perform the same operation on multiple data points simultaneously.

In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit CPUs and ALUs are those that are based on processor registers, address buses, or data buses of that size. A computer that uses such a processor is a 64-bit computer.

The GNU C Library, commonly known as glibc, is the GNU Project's implementation of the C standard library. Despite its name, it now also directly supports C++. It was started in the 1980s by the Free Software Foundation (FSF) for the GNU operating system.

OpenRISC is a project to develop a series of open-source hardware based central processing units (CPUs) on established reduced instruction set computer (RISC) principles. It includes an instruction set architecture (ISA) using an open-source license. It is the original flagship project of the OpenCores community.

<span class="mw-page-title-main">LLVM</span> Compiler backend for multiple programming languages

LLVM is a set of compiler and toolchain technologies that can be used to develop a frontend for any programming language and a backend for any instruction set architecture. LLVM is designed around a language-independent intermediate representation (IR) that serves as a portable, high-level assembly language that can be optimized with a variety of transformations over multiple passes. The name LLVM originally stood for Low Level Virtual Machine, though the project has expanded and the name is no longer officially an acronym.

The NX bit (no-execute) is a technology used in CPUs to segregate areas of a virtual address space for use by either storage of processor instructions or for storage of data. An operating system with support for the NX bit may mark certain areas of an address space as non-executable. The processor will then refuse to execute any code residing in these areas of the address space. The general technique, known as executable space protection, also called Write XOR Execute, is used to prevent certain types of malicious software from taking over computers by inserting their code into another program's data storage area and running their own code from within this section; one class of such attacks is known as the buffer overflow attack.

LEON is a radiation-tolerant 32-bit central processing unit (CPU) microprocessor core that implements the SPARC V8 instruction set architecture (ISA) developed by Sun Microsystems. It was originally designed by the European Space Research and Technology Centre (ESTEC), part of the European Space Agency (ESA), without any involvement by Sun. Later versions have been designed by Gaisler Research, under a variety of owners. It is described in synthesizable VHSIC Hardware Description Language (VHDL). LEON has a dual license model: An GNU Lesser General Public License (LGPL) and GNU General Public License (GPL) free and open-source software (FOSS) license that can be used without licensing fee, or a proprietary license that can be purchased for integration in a proprietary product. The core is configurable through VHDL generics, and is used in system on a chip (SOC) designs both in research and commercial settings.

Berkeley RISC is one of two seminal research projects into reduced instruction set computer (RISC) based microprocessor design taking place under the Defense Advanced Research Projects Agency VLSI Project. RISC was led by David Patterson at the University of California, Berkeley between 1980 and 1984. The other project took place a short distance away at Stanford University under their MIPS effort starting in 1981 and running until 1984.

<span class="mw-page-title-main">QEMU</span> Free virtualization and emulation software

QEMU is a free and open-source emulator. It emulates the machine's processor through dynamic binary translation and provides a set of different hardware and device models for the machine, enabling it to run a variety of guest operating systems. It can interoperate with Kernel-based Virtual Machine (KVM) to run virtual machines at near-native speed. QEMU can also do emulation for user-level processes, allowing applications compiled for one architecture to run on another.

<span class="mw-page-title-main">RTEMS</span> Real-time operating system

Real-Time Executive for Multiprocessor Systems (RTEMS), formerly Real-Time Executive for Missile Systems, and then Real-Time Executive for Military Systems, is a real-time operating system (RTOS) designed for embedded systems. It is free and open-source software.

An instruction set architecture (ISA) is an abstract model of a computer, also referred to as computer architecture. A realization of an ISA is called an implementation. An ISA permits multiple implementations that may vary in performance, physical size, and monetary cost ; because the ISA serves as the interface between software and hardware. Software that has been written for an ISA can run on different implementations of the same ISA. This has enabled binary compatibility between different generations of computers to be easily achieved, and the development of computer families. Both of these developments have helped to lower the cost of computers and to increase their applicability. For these reasons, the ISA is one of the most important abstractions in computing today.

In computing, quadruple precision is a binary floating point–based computer number format that occupies 16 bytes with precision at least twice the 53-bit double precision.

RISC-V is an open standard instruction set architecture (ISA) based on established reduced instruction set computer (RISC) principles. Unlike most other ISA designs, RISC-V is provided under royalty-free open-source licenses. A number of companies are offering or have announced RISC-V hardware, open source operating systems with RISC-V support are available, and the instruction set is supported in several popular software toolchains.

References

  1. "ChangeLog". GNU Project. Retrieved 2009-02-22.
  2. Paulo César Pereira de Andrade (27 April 2023). "GNU lightning 2.2.2 released!" . Retrieved 17 May 2023.
  3. "README-hacking".
  4. "lightning-1.1.1.tar.gz".
  5. "GNU lightning" . Retrieved 2020-01-15.
  6. "GNU lightning 2.1.3 released!". 2019-09-18.
  7. "Using and porting GNU lightning" . Retrieved 2009-02-22.
  8. "GNU Smalltalk project page" . Retrieved 2014-05-17.
  9. "Just-In-Time Native Code". Archived from the original on 2020-05-13. Retrieved 2019-03-11.
  10. "Implementation notes for GNU CLISP" . Retrieved 2009-02-23.
  11. "GNU lightning user manual, acknowledgements" . Retrieved 2014-05-17.
  12. "lightening run-time code generation -- wingolog" . Retrieved 2021-12-10.