Version 5 (modified by cameron, 5 years ago) (diff)


The Complete Integer Project

This project involves systematic support for integers and vectors of integers in all power-of-2 configurations up to 256 bits.

In general, this project seeks to "fill in the gaps" of LLVM support, specifically as follows.

  1. Add first class support for short integer types i1, i2, i4.
  2. Add first class support for LongInteger types i128, i256.
  3. Add first class support for vectors of integers of i1, i2 and i4 types up to <256 x i1>, <128 x i2>, <64 x i4>.
  4. Add first class support for vectors of long integers <2 x i128>.

Short Integer Types

Should the i1, i2, i4 types be legalized? They seem to arise in some SIMD operations such as the natural bitcast from <2 x i1> to i2.

The I2Result bug needs to be addressed.

Vectors of short integers may be more important than the short integers themselves.

Long Integer Project

Parabix applications need long stream addition, subtraction and shift operations. There are standard ways of implementing these, including our parallel long-stream addition algorithm. Can these be integrated into LLVM?

The LongInteger project involves systematic support of the i256 type on LLVM, taking advantage of AVX2 instructions on the latest Intel Haswell chips.

Vectors of Short Integers

The types <32 x i1> and <64 x i1> are particularly important to legalize, so that the BitShuffle subproject can be implemented.

Example: 2-bit Fields

There can be some applications of 2-bit integer fields, i.e., the SIMD vector type <64 x i2> for 128-bit SIMD registers.

Can this be implemented in a generic way as follows:

  1. Make it a legal type in the SelectionDAG LegalizeTypes phase.
  2. Create implementations of the standard vector operations and rule out all others in the SelectionDAG Legalize phase.
  3. Implement each operation using bitwise logic on the 2 positions of each field.

We explore this possibility with the i2Vector project.

Vectors of Long Integers

Right now, this seems like the least important of the subjprojects here, but is included for completeness.