Back end work for short vector SIMD packs
authorPaul Khuong <pvk@pvk.ca>
Tue, 21 May 2013 19:11:26 +0000 (15:11 -0400)
committerPaul Khuong <pvk@pvk.ca>
Tue, 21 May 2013 19:11:26 +0000 (15:11 -0400)
commit3031b264496451e796282d7309c2221d89ee62c1
treebbecc34c656e7d7aa5f16ee1c4043ace146c8f4c
parentb38f10027f48f657f77b290719da4fec30064e25
Back end work for short vector SIMD packs

 * Platform-agnostic changes:
   - Declare type testing/checking routines.
   - Define three primitive types: simd-pack-double for packs
     of doubles, simd-pack-single for packs of singles, and
     simd-pack-int for packs of integer/unknown.
   - Define a heap-representation for 128-bit SIMD packs,
     along with reserving a widetag and filling the corresponding
     entries in gencgc's tables.
   - Make the simd-pack class definition fully concrete.
   - Teach IR1 how to expand SIMD-PACK type checks.
   - IR2-conversion maps SIMD-PACK types to the right primitive type.
   - Increase the limit on the number of storage classes: SIMD packs
     went way past the previous (arbitrary?) limit of 40.

 * Platform-specific changes, in src/compiler/target/simd-pack:
   - Create new storage classes (that are backed by the float-reg [i.e. SSE]
     storage base): one for each of double, single and integer sse packs.
   - Also create the corresponding immediate-constant and stack storage
     classes.
   - Teach the assembler and the inline constant code about this new kind
     of registers/constants, and how to map constant SIMD-PACKs to which SC.
   - Define movement/conversion VOPs for SSE packs, along with VOP routines
     needed for basic creation/manipulation of SSE packs.
   - The type-checking VOP in generic/late-type-vops is extremely
     x86-64-specific... IIRC, there are ordering issues I do not
     want to tangle with.

 * Implementation idiosyncrasy: while type *tests* (i.e. TYPEP calls) consider
   the element type, type *checks* (e.g. THE or DECLARE) only check for
   SIMD-PACKness, without looking at the element type.  This is allowed by the
   standard, is similar to what Python does for FUNCTION types, and helps
   code remain efficient even when type checks can't be fully elided.

The vast majority of the code is verbatim or heavily inspired by Alexander
Gavrilov's branch.
22 files changed:
build-order.lisp-expr
package-data-list.lisp-expr
src/code/class.lisp
src/code/interr.lisp
src/code/pred.lisp
src/code/target-type.lisp
src/code/typecheckfuns.lisp
src/code/typep.lisp
src/compiler/generic/early-objdef.lisp
src/compiler/generic/interr.lisp
src/compiler/generic/objdef.lisp
src/compiler/generic/primtype.lisp
src/compiler/generic/vm-macs.lisp
src/compiler/generic/vm-typetran.lisp
src/compiler/typetran.lisp
src/compiler/x86-64/insts.lisp
src/compiler/x86-64/macros.lisp
src/compiler/x86-64/simd-pack.lisp [new file with mode: 0644]
src/compiler/x86-64/type-vops.lisp
src/compiler/x86-64/vm.lisp
src/runtime/gc-common.c
src/runtime/gencgc.c