1 #!/bin/bash
   2 
   3 javac -d . ../../../../../../../make/jdk/src/classes/build/tools/spp/Spp.java
   4 
   5 SPP=build.tools.spp.Spp
   6 
   7 typeprefix=
   8 
   9 for type in byte short int long float double
  10 do
  11   Type="$(tr '[:lower:]' '[:upper:]' <<< ${type:0:1})${type:1}"
  12   TYPE="$(tr '[:lower:]' '[:upper:]' <<< ${type})"
  13   args="-K$type -Dtype=$type -DType=$Type -DTYPE=$TYPE"
  14 
  15   Boxtype=$Type
  16   Wideboxtype=$Boxtype
  17 
  18   kind=BITWISE
  19 
  20   bitstype=$type
  21   Bitstype=$Type
  22   Boxbitstype=$Boxtype
  23 
  24   fptype=$type
  25   Fptype=$Type
  26   Boxfptype=$Boxtype
  27 
  28   case $type in
  29     byte)
  30       Wideboxtype=Integer
  31       sizeInBytes=1
  32       args="$args -KbyteOrShort"
  33       ;;
  34     short)
  35       Wideboxtype=Integer
  36       sizeInBytes=2
  37       args="$args -KbyteOrShort"
  38       ;;
  39     int)
  40       Boxtype=Integer
  41       Wideboxtype=Integer
  42       fptype=float
  43       Fptype=Float
  44       Boxfptype=Float
  45       sizeInBytes=4
  46       args="$args -KintOrLong -KintOrFP -KintOrFloat"
  47       ;;
  48     long)
  49       fptype=double
  50       Fptype=Double
  51       Boxfptype=Double
  52       sizeInBytes=8
  53       args="$args -KintOrLong -KlongOrDouble"
  54       ;;
  55     float)
  56       kind=FP
  57       bitstype=int
  58       Bitstype=Int
  59       Boxbitstype=Integer
  60       sizeInBytes=4
  61       args="$args -KintOrFP -KintOrFloat"
  62       ;;
  63     double)
  64       kind=FP
  65       bitstype=long
  66       Bitstype=Long
  67       Boxbitstype=Long
  68       sizeInBytes=8
  69       args="$args -KintOrFP -KlongOrDouble"
  70       ;;
  71   esac
  72 
  73   args="$args -K$kind -DBoxtype=$Boxtype -DWideboxtype=$Wideboxtype"
  74   args="$args -Dbitstype=$bitstype -DBitstype=$Bitstype -DBoxbitstype=$Boxbitstype"
  75   args="$args -Dfptype=$fptype -DFptype=$Fptype -DBoxfptype=$Boxfptype"
  76 
  77   abstractvectortype=${typeprefix}${Type}Vector
  78   abstractbitsvectortype=${typeprefix}${Bitstype}Vector
  79   abstractfpvectortype=${typeprefix}${Fptype}Vector
  80   args="$args -Dabstractvectortype=$abstractvectortype -Dabstractbitsvectortype=$abstractbitsvectortype -Dabstractfpvectortype=$abstractfpvectortype"
  81   echo $args
  82   rm -f $abstractvectortype.java
  83   java $SPP -nel $args \
  84      -iX-Vector.java.template \
  85      -o$abstractvectortype.java
  86 
  87   if [ VAR_OS_ENV==windows.cygwin ]; then
  88     tr -d '\r' < $abstractvectortype.java > temp
  89     mv temp $abstractvectortype.java
  90   fi
  91 
  92   old_args="$args"
  93   for bits in 64 128 256 512 Max
  94   do
  95     vectortype=${typeprefix}${Type}${bits}Vector
  96     masktype=${typeprefix}${Type}${bits}Mask
  97     shuffletype=${typeprefix}${Type}${bits}Shuffle
  98     bitsvectortype=${typeprefix}${Bitstype}${bits}Vector
  99     fpvectortype=${typeprefix}${Fptype}${bits}Vector
 100     vectorindexbits=$((bits * 4 / sizeInBytes))
 101     if [[ "${bits}" == "Max" ]]; then
 102         vectorindextype="vix.getClass()"
 103     else
 104         vectorindextype="Int${vectorindexbits}Vector.class"
 105     fi;
 106 
 107     shape=S${bits}Bit
 108     Shape=S_${bits}_BIT
 109     args="$old_args"
 110     if [[ "${vectortype}" == "Long64Vector" || "${vectortype}" == "Double64Vector" ]]; then
 111       args="$args -KlongOrDouble64"
 112     fi
 113     bitargs="$args -Dbits=$bits -Dvectortype=$vectortype -Dmasktype=$masktype -Dshuffletype=$shuffletype -Dbitsvectortype=$bitsvectortype -Dfpvectortype=$fpvectortype -Dvectorindextype=$vectorindextype -Dshape=$shape -DShape=$Shape"
 114 
 115     echo $bitargs
 116     rm -f $vectortype.java
 117     java $SPP -nel $bitargs \
 118        -iX-VectorBits.java.template \
 119        -o$vectortype.java
 120 
 121     if [[ "x${VAR_OS_ENV}" == "xwindows.cygwin" ]]; then
 122       tr -d  '\r' < $vectortype.java > temp
 123       mv temp $vectortype.java
 124     fi
 125   done
 126 
 127 done
 128 
 129 rm -fr build
 130