GNU lightning

Last updated
GNU lightning
Developer(s) GNU Project
Initial releaseJanuary 19, 2001;23 years ago (2001-01-19) [1]
Stable release
2.2.3 [2]   OOjs UI icon edit-ltr-progressive.svg / 8 February 2024
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 of its standardized instructions. 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.

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 electronics and computer science, 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">Endianness</span> Order of bytes in a computer word

In computing, endianness is the order in which bytes within a word of digital data are transmitted over a data communication medium or addressed in computer memory, counting only byte significance compared to earliness. Endianness is primarily expressed as big-endian (BE) or little-endian (LE), terms introduced by Danny Cohen into computer science for data ordering in an Internet Experiment Note published in 1980. The adjective endian has its origin in the writings of 18th century Anglo-Irish writer Jonathan Swift. In the 1726 novel Gulliver's Travels, he portrays the conflict between sects of Lilliputians divided into those breaking the shell of a boiled egg from the big end or from the little end. By analogy, a CPU may read a digital word big end first, or little end first.

In computer science, an instruction set architecture (ISA) is an abstract model that generally defines how software controls the CPU in a computer or a family of computers. A device or program that executes instructions described by that ISA, such as a central processing unit (CPU), is called an implementation of that ISA.

<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.

<span class="mw-page-title-main">64-bit computing</span> Computer architecture bit width

In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit central processing units (CPU) and arithmetic logic units (ALU) 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.

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.

A processor register is a quickly accessible location available to a computer's processor. Registers usually consist of a small amount of fast storage, although some registers have specific hardware functions, and may be read-only or write-only. In computer architecture, registers are typically addressed by mechanisms other than main memory, but may in some cases be assigned a memory address e.g. DEC PDP-10, ICT 1900.

<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 initialism.

The NX bit (no-execute) is a technology used in CPUs to segregate areas of a virtual address space to store either data or processor instructions. 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">V850</span> 32-bit RISC CPU architecture

V850 is a 32-bit RISC CPU architecture produced by Renesas Electronics for embedded microcontrollers. It was designed by NEC as a replacement for their earlier NEC V60 family, and was introduced shortly before NEC sold their designs to Renesas in the early 1990s. It has continued to be developed by Renesas as of 2018.

OpenSPARC is an open-source hardware project, started in December 2005, for CPUs implementing the SPARC instruction architecture. The initial contribution to the project was Sun Microsystems' register-transfer level (RTL) Verilog code for a full 64-bit, 32-thread microprocessor, the UltraSPARC T1 processor. On March 21, 2006, Sun released the source code to the T1 IP core under the GNU General Public License v2. The full OpenSPARC T1 system consists of 8 cores, each one capable of executing four threads concurrently, for a total of 32 threads. Each core executes instruction in order and its logic is split among 6 pipeline stages.

An AES instruction set is a set of instructions that are specifically designed to perform AES encryption and decryption operations efficiently. These instructions are typically found in modern processors and can greatly accelerate AES operations compared to software implementations. An AES instruction set includes instructions for key expansion, encryption, and decryption using various key sizes.

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. The project began in 2010 at the University of California, Berkeley, transferred to the RISC-V Foundation in 2015, and on to RISC-V International, a Swiss non-profit entity, in November 2019. Like several other RISC ISAs, e.g. Amber (ARMv2) or OpenRISC, RISC-V is offered under royalty-free open-source licenses. The documents defining the RISC-V instruction set architecture (ISA) are offered under a Creative Commons license or a BSD License.

References

  1. "ChangeLog". GNU Project. Retrieved 2009-02-22.
  2. Paulo César Pereira de Andrade (8 February 2024). "GNU lightning 2.2.3 released!" . Retrieved 8 March 2024.
  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.