Installation
------------
Installation on a Linux machine:
1) Install swiprolog (http://www.swi-prolog.org/), at least version 5.6.62
   The executable "pl" must be called "pl" and be in your path. 
2) ./configure --pl-includepath={path of SWI-Prolog.h} 
   make
   make install

By default, xc will be installed in /usr/local/bin


Xlanguage:
----------
Xlanguage is a pragma language for C, used for exploring various
source to source code transformations. Xlanguage pragmas can describe
either a code transformation or define a parameter range, used in
transformations or in the code.

* begin/end directives:
  #pragma xlang begin
    for (i=..; i<..; i++) {
      ..
    }
  #pragma xlang end

  They surround the outermost loop where all transformations will apply. 
  All loops must be normalized with an affectation i=.., a condition 
  of the kind i<.. and an increment either like i++ or i=i+..

* transformations: all loops are identified by their loop counter. All
  transformations can be put right after the outermost loop and they will
  be applied in sequence.

  #pragma xlang transform interchange(i,j)
    interchange loops i and j. Loops i and j must be perfectly nested
    (either i in j or j in i).

  #pragma xlang transform unroll(i,n)
    makes a partial unroll of loop i, with unroll factor n (n>0)

  #pragma xlang transform fission(i)
    fissions loop i. Several fissions are possible if the loop has more
    than 2 statements. All solutions are explored.

  #pragma xlang transform fusion(i,j)
    fusions loops i and j that must be in sequence. Lower and upper bounds
    must be the same (syntactically), and the increment as well.

  #pragma xlang transform stripmine(i,ii,n)
    strip mines loop i (with factor n) and creates a new inner loop ii.

  #pragma xlang transform tile(i,ii,n)
    same as strip mine, but the new loop ii is created at the innermost 
    position of the loopnest.

  #pragma xlang transform [ transformation1, ... ]
    applies one of the transformations of the list (this is an OR).
    Transformations can be one of the previous ones (unroll(i,n), 
    fission(i,j),fusion(i,j)...).

* parameters
  #pragma xlang parameter X [val1,val2,...]
    defines X with possible values val1,val2...

  #pragma xlang parameter X [lowerval:upperval:stride]
    defines X with all possible values lowerval, lowerval+stride, 
    ..., upperval

There must be one parameter and one transform pragma.

Xlanguage Compiler:
-------------------
The xc compiler is built on top of tcc (tiny C compiler, 
from Fabrice Bellard).

The compiler generates from a C file "filename.c" a file
"filename_kernel.c" containing all versions explored. These are C
files that can be compiled by a production compiler.

License:
-------

XC is distributed under the GNU Lesser General Public License (see
COPYING file).

Denis Barthou.
