jdk/makefiles/GensrcBuffer.gmk
changeset 20547 453837141fac
parent 17922 d56eec572de5
equal deleted inserted replaced
20546:5e40a295cce2 20547:453837141fac
    21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22 # or visit www.oracle.com if you need additional information or have any
    22 # or visit www.oracle.com if you need additional information or have any
    23 # questions.
    23 # questions.
    24 #
    24 #
    25 
    25 
    26 GENSRC_BUFFER :=
    26 GENSRC_BUFFER := 
    27 
    27 
    28 GENSRC_BUFFER_TMP := $(JDK_OUTPUTDIR)/gensrc
    28 GENSRC_BUFFER_TMP := $(JDK_OUTPUTDIR)/gensrc
    29 GENSRC_BUFFER_DST := $(JDK_OUTPUTDIR)/gensrc/java/nio
    29 GENSRC_BUFFER_DST := $(JDK_OUTPUTDIR)/gensrc/java/nio
    30 
    30 
    31 GENSRC_BUFFER_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
    31 GENSRC_BUFFER_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
    32 
    32 
    33 ###
    33 ###
    34 
    34 
    35 $(GENSRC_BUFFER_DST)/_the.buffer.dir :
    35 $(GENSRC_BUFFER_DST)/_the.buffer.dir: 
    36 	$(ECHO) "Generating buffer classes"
    36 	$(ECHO) "Generating buffer classes"
    37 	$(MKDIR) -p $(@D)
    37 	$(MKDIR) -p $(@D)
    38 	$(TOUCH) $@
    38 	$(TOUCH) $@
    39 
    39 
    40 define fixRw
    40 define fixRw
    41 	$1_RW := $2
    41   $1_RW := $2
    42 	$1_rwkey := rw
    42   $1_rwkey := rw
    43 	ifeq (R,$2)
    43   ifeq (R, $2)
    44 		 $1_rwkey := ro
    44     $1_rwkey := ro
    45 	endif
    45   endif
    46 endef
    46 endef
    47 
    47 
    48 define typesAndBits
    48 define typesAndBits
    49         # param 1 target
    49   # param 1 target
    50         # param 2 type
    50   # param 2 type
    51         # param 3 BO
    51   # param 3 BO
    52 	$1_a := a
    52   $1_a := a
    53 	$1_A := A
    53   $1_A := A
    54 
    54 
    55 	$1_type := $2
    55   $1_type := $2
    56 
    56 
    57 	ifeq ($2, byte)
    57   ifeq ($2, byte)
    58 		$1_x        := b
    58     $1_x        := b
    59 		$1_Type     := Byte
    59     $1_Type     := Byte
    60 		$1_fulltype := byte
    60     $1_fulltype := byte
    61 		$1_Fulltype := Byte
    61     $1_Fulltype := Byte
    62 		$1_category := integralType
    62     $1_category := integralType
    63 		$1_LBPV     := 0
    63     $1_LBPV     := 0
    64 	endif
    64   endif
    65 
    65 
    66 	ifeq ($2, char)
    66   ifeq ($2, char)
    67 		$1_x        := c
    67     $1_x        := c
    68 		$1_Type     := Char
    68     $1_Type     := Char
    69 		$1_fulltype := character
    69     $1_fulltype := character
    70 		$1_Fulltype := Character
    70     $1_Fulltype := Character
    71 		$1_category := integralType
    71     $1_category := integralType
    72                 $1_streams  := streamableType
    72     $1_streams  := streamableType
    73                 $1_streamtype := int
    73     $1_streamtype := int
    74                 $1_Streamtype := Int
    74     $1_Streamtype := Int
    75 		$1_LBPV     := 1
    75     $1_LBPV     := 1
    76 	endif
    76   endif
    77 
    77 
    78 	ifeq ($2, short)
    78   ifeq ($2, short)
    79 		$1_x        := s
    79     $1_x        := s
    80 		$1_Type     := Short
    80     $1_Type     := Short
    81 		$1_fulltype := short
    81     $1_fulltype := short
    82 		$1_Fulltype := Short
    82     $1_Fulltype := Short
    83 		$1_category := integralType
    83     $1_category := integralType
    84 		$1_LBPV     := 1
    84     $1_LBPV     := 1
    85 	endif
    85   endif
    86 
    86 
    87 	ifeq ($2, int)
    87   ifeq ($2, int)
    88 		$1_a := an
    88     $1_a        := an
    89 		$1_A := An
    89     $1_A        := An
    90 		$1_x        := i
    90     $1_x        := i
    91 		$1_Type     := Int
    91     $1_Type     := Int
    92 		$1_fulltype := integer
    92     $1_fulltype := integer
    93 		$1_Fulltype := Integer
    93     $1_Fulltype := Integer
    94 		$1_category := integralType
    94     $1_category := integralType
    95 		$1_LBPV     := 2
    95     $1_LBPV     := 2
    96 	endif
    96   endif
    97 
    97 
    98 	ifeq ($2, long)
    98   ifeq ($2, long)
    99 		$1_x        := l
    99     $1_x        := l
   100 		$1_Type     := Long
   100     $1_Type     := Long
   101 		$1_fulltype := long
   101     $1_fulltype := long
   102 		$1_Fulltype := Long
   102     $1_Fulltype := Long
   103 		$1_category := integralType	
   103     $1_category := integralType
   104 		$1_LBPV     := 3
   104     $1_LBPV     := 3
   105 	endif
   105   endif
   106 
   106 
   107 	ifeq ($2, float)
   107   ifeq ($2, float)
   108 		$1_x        := f
   108     $1_x        := f
   109 		$1_Type     := Float
   109     $1_Type     := Float
   110 		$1_fulltype := float
   110     $1_fulltype := float
   111 		$1_Fulltype := Float
   111     $1_Fulltype := Float
   112 		$1_category := floatingPointType
   112     $1_category := floatingPointType
   113 		$1_LBPV     := 2
   113     $1_LBPV     := 2
   114 	endif
   114   endif
   115 
   115 
   116 	ifeq ($2, double)
   116   ifeq ($2, double)
   117 		$1_x        := d
   117     $1_x        := d
   118 		$1_Type     := Double
   118     $1_Type     := Double
   119 		$1_fulltype := double
   119     $1_fulltype := double
   120 		$1_Fulltype := Double
   120     $1_Fulltype := Double
   121 		$1_category := floatingPointType
   121     $1_category := floatingPointType
   122 		$1_LBPV     := 3
   122     $1_LBPV     := 3
   123 	endif
   123   endif
   124 
   124 
   125 	$1_Swaptype := $$($1_Type)
   125   $1_Swaptype := $$($1_Type)
   126 	$1_memtype := $2
   126   $1_memtype := $2
   127 	$1_Memtype := $$($1_Type)
   127   $1_Memtype := $$($1_Type)
   128 
   128 
   129 	ifeq ($2, float)
   129   ifeq ($2, float)
   130 		$1_memtype := int
   130     $1_memtype := int
   131 		$1_Memtype := Int
   131     $1_Memtype := Int
   132 		ifneq ($3,U)
   132     ifneq ($3, U)
   133 			$1_Swaptype := Int
   133       $1_Swaptype := Int
   134 			$1_fromBits := Float.intBitsToFloat
   134       $1_fromBits := Float.intBitsToFloat
   135 			$1_toBits   := Float.floatToRawIntBits
   135       $1_toBits   := Float.floatToRawIntBits
   136 		endif
   136     endif
   137 	endif
   137   endif
   138 
   138 
   139 	ifeq ($2, double)
   139   ifeq ($2, double)
   140 		$1_memtype := long
   140     $1_memtype := long
   141 		$1_Memtype := Long
   141     $1_Memtype := Long
   142 		ifneq ($3,U)
   142     ifneq ($3, U)
   143 			$1_Swaptype := Long
   143       $1_Swaptype := Long
   144 			$1_fromBits := Double.longBitsToDouble
   144       $1_fromBits := Double.longBitsToDouble
   145 			$1_toBits   := Double.doubleToRawLongBits
   145       $1_toBits   := Double.doubleToRawLongBits
   146 		endif
   146     endif
   147 	endif
   147   endif
   148 
   148 
   149 	ifeq ($3, S)
   149   ifeq ($3, S)
   150 		$1_swap := Bits.swap
   150     $1_swap := Bits.swap
   151 	endif
   151   endif
   152 endef
   152 endef
   153 
   153 
   154 define genBinOps
   154 define genBinOps
   155         # param 1 target
   155   # param 1 target
   156         # param 2 type
   156   # param 2 type
   157         # param 3 BO
   157   # param 3 BO
   158         # param 4 RW
   158   # param 4 RW
   159         # param 5 nbytes
   159   # param 5 nbytes
   160         # param 6 nbytesButOne
   160   # param 6 nbytesButOne
   161 	$(call typesAndBits,$1,$2,$3)
   161   $(call typesAndBits,$1,$2,$3)
   162 	$(call fixRw,$1,$4)
   162   $(call fixRw,$1,$4)
   163 	$1_nbytes := $5
   163   $1_nbytes := $5
   164 	$1_nbytesButOne := $6
   164   $1_nbytesButOne := $6
   165 	$1_CMD := $(TOOL_SPP) \
   165   $1_CMD := $(TOOL_SPP) \
   166 		-Dtype=$$($1_type) \
   166     -Dtype=$$($1_type) \
   167 		-DType=$$($1_Type) \
   167     -DType=$$($1_Type) \
   168 		-Dfulltype=$$($1_fulltype) \
   168     -Dfulltype=$$($1_fulltype) \
   169 		-Dmemtype=$$($1_memtype) \
   169     -Dmemtype=$$($1_memtype) \
   170 		-DMemtype=$$($1_Memtype) \
   170     -DMemtype=$$($1_Memtype) \
   171 		-DfromBits=$$($1_fromBits) \
   171     -DfromBits=$$($1_fromBits) \
   172 		-DtoBits=$$($1_toBits) \
   172     -DtoBits=$$($1_toBits) \
   173 		-DLG_BYTES_PER_VALUE=$$($1_LBPV) \
   173     -DLG_BYTES_PER_VALUE=$$($1_LBPV) \
   174 		-DBYTES_PER_VALUE="(1 << $$($1_LBPV))" \
   174     -DBYTES_PER_VALUE="(1 << $$($1_LBPV))" \
   175 		-Dnbytes=$$($1_nbytes) \
   175     -Dnbytes=$$($1_nbytes) \
   176 		-DnbytesButOne=$$($1_nbytesButOne) \
   176     -DnbytesButOne=$$($1_nbytesButOne) \
   177 		-DRW=$$($1_RW) \
   177     -DRW=$$($1_RW) \
   178 		-K$$($1_rwkey) \
   178     -K$$($1_rwkey) \
   179 		-Da=$$($1_a) \
   179     -Da=$$($1_a) \
   180 		-be
   180     -be
   181 endef
   181 endef
   182 
   182 
   183 define SetupGenBuffer
   183 define SetupGenBuffer
   184         # param 1 is for output file
   184   # param 1 is for output file
   185         # param 2 is template dependency
   185   # param 2 is template dependency
   186         # param 3-9 are named args.
   186   # param 3-9 are named args.
   187         #   type :=
   187   #   type :=
   188         #   BIN  :=
   188   #   BIN :=
   189         #   RW   := Mutability (R)ead-only (W)ritable
   189   #   RW := Mutability (R)ead-only (W)ritable
   190         #   BO   := (U)nswapped/(S)wapped/(L)ittle/(B)ig
   190   #   BO := (U)nswapped/(S)wapped/(L)ittle/(B)ig
   191         #
   191   #
   192 	$(if $3,$1_$(strip $3))
   192   $(if $3,$1_$(strip $3))
   193 	$(if $4,$1_$(strip $4))
   193   $(if $4,$1_$(strip $4))
   194 	$(if $5,$1_$(strip $5))
   194   $(if $5,$1_$(strip $5))
   195 	$(if $6,$1_$(strip $6))
   195   $(if $6,$1_$(strip $6))
   196 	$(if $7,$1_$(strip $7))
   196   $(if $7,$1_$(strip $7))
   197 	$(if $8,$1_$(strip $8))
   197   $(if $8,$1_$(strip $8))
   198 	$(if $9,$1_$(strip $9))
   198   $(if $9,$1_$(strip $9))
   199 	$(if $(10),$1_$(strip $(10)))
   199   $(if $(10),$1_$(strip $(10)))
   200 	$(if $(11),$1_$(strip $(11)))
   200   $(if $(11),$1_$(strip $(11)))
   201 	$(if $(12),$1_$(strip $(12)))
   201   $(if $(12),$1_$(strip $(12)))
   202 	$(if $(13),$1_$(strip $(13)))
   202   $(if $(13),$1_$(strip $(13)))
   203 	$(if $(14),$1_$(strip $(14)))
   203   $(if $(14),$1_$(strip $(14)))
   204 	$(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15,$(if $($i),$1_$(strip $($i)))$(NEWLINE))
   204   $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15,$(if $($i),$1_$(strip $($i)))$(NEWLINE))
   205 	$(call LogSetupMacroEntry,SetupGenBuffer($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
   205   $(call LogSetupMacroEntry,SetupGenBuffer($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
   206 	$(if $(16),$(error Internal makefile error: Too many arguments to SetupGenBuffer, please update GensrcBuffer.gmk))
   206   $(if $(16),$(error Internal makefile error: Too many arguments to SetupGenBuffer, please update GensrcBuffer.gmk))
   207 
   207 
   208 	$(call fixRw,$1,$$($1_RW))
   208   $(call fixRw,$1,$$($1_RW))
   209 	$(call typesAndBits,$1,$$($1_type),$$($1_BO))
   209   $(call typesAndBits,$1,$$($1_type),$$($1_BO))
   210 
   210 
   211 	$1_DST     := $(GENSRC_BUFFER_DST)/$1.java
   211   $1_DST := $(GENSRC_BUFFER_DST)/$1.java
   212 	$1_SRC     := $(GENSRC_BUFFER_SRC)/$(strip $2).java.template
   212   $1_SRC := $(GENSRC_BUFFER_SRC)/$(strip $2).java.template
   213 	$1_SRC_BIN := $(GENSRC_BUFFER_SRC)/$(strip $2)-bin.java.template
   213   $1_SRC_BIN := $(GENSRC_BUFFER_SRC)/$(strip $2)-bin.java.template
   214 
   214 
   215 	$1_DEP := $$($1_SRC)
   215   $1_DEP := $$($1_SRC)
   216 	ifneq ($$($1_BIN),1)
   216   ifneq ($$($1_BIN), 1)
   217 		$1_DEP := $$($1_SRC)
   217     $1_DEP := $$($1_SRC)
   218 		$1_OUT := $$($1_DST)
   218     $1_OUT := $$($1_DST)
   219 	else
   219   else
   220 		$1_DEP += $$($1_SRC) $$($1_SRC_BIN)
   220     $1_DEP += $$($1_SRC) $$($1_SRC_BIN)
   221 		$1_OUT := $(GENSRC_BUFFER_DST)/$1.binop.0.java
   221     $1_OUT := $(GENSRC_BUFFER_DST)/$1.binop.0.java
   222 	endif
   222   endif
   223 
   223 
   224 	ifeq ($$($1_BIN),1)
   224   ifeq ($$($1_BIN), 1)
   225 		$(call genBinOps,$1_char,char,$$($1_BO),$$($1_RW),two,one)
   225     $(call genBinOps,$1_char,char,$$($1_BO),$$($1_RW),two,one)
   226 		$(call genBinOps,$1_short,short,$$($1_BO),$$($1_RW),two,one)
   226     $(call genBinOps,$1_short,short,$$($1_BO),$$($1_RW),two,one)
   227 		$(call genBinOps,$1_int,int,$$($1_BO),$$($1_RW),four,three)
   227     $(call genBinOps,$1_int,int,$$($1_BO),$$($1_RW),four,three)
   228 		$(call genBinOps,$1_long,long,$$($1_BO),$$($1_RW),eight,seven)
   228     $(call genBinOps,$1_long,long,$$($1_BO),$$($1_RW),eight,seven)
   229 		$(call genBinOps,$1_float,float,$$($1_BO),$$($1_RW),four,three)
   229     $(call genBinOps,$1_float,float,$$($1_BO),$$($1_RW),four,three)
   230 		$(call genBinOps,$1_double,double,$$($1_BO),$$($1_RW),eight,seven)
   230     $(call genBinOps,$1_double,double,$$($1_BO),$$($1_RW),eight,seven)
   231 	endif
   231   endif
   232 
   232 
   233 $$($1_DST) : $$($1_DEP) $(GENSRC_BUFFER_DST)/_the.buffer.dir
   233   $$($1_DST): $$($1_DEP) $(GENSRC_BUFFER_DST)/_the.buffer.dir
   234 	$(TOOL_SPP) < $$($1_SRC) > $$($1_OUT).tmp \
   234 	$(TOOL_SPP) < $$($1_SRC) > $$($1_OUT).tmp \
   235 		-K$$($1_type) \
   235 	    -K$$($1_type) \
   236 		-K$$($1_category) \
   236 	    -K$$($1_category) \
   237 		-K$$($1_streams) \
   237 	    -K$$($1_streams) \
   238 		-Dtype=$$($1_type) \
   238 	    -Dtype=$$($1_type) \
   239 		-DType=$$($1_Type) \
   239 	    -DType=$$($1_Type) \
   240 		-Dfulltype=$$($1_fulltype) \
   240 	    -Dfulltype=$$($1_fulltype) \
   241 		-DFulltype=$$($1_Fulltype) \
   241 	    -DFulltype=$$($1_Fulltype) \
   242                 -Dstreamtype=$$($1_streamtype) \
   242 	    -Dstreamtype=$$($1_streamtype) \
   243                 -DStreamtype=$$($1_Streamtype) \
   243 	    -DStreamtype=$$($1_Streamtype) \
   244 		-Dx=$$($1_x) \
   244 	    -Dx=$$($1_x) \
   245 		-Dmemtype=$$($1_memtype) \
   245 	    -Dmemtype=$$($1_memtype) \
   246 		-DMemtype=$$($1_Memtype) \
   246 	    -DMemtype=$$($1_Memtype) \
   247 		-DSwaptype=$$($1_Swaptype) \
   247 	    -DSwaptype=$$($1_Swaptype) \
   248 		-DfromBits=$$($1_fromBits) \
   248 	    -DfromBits=$$($1_fromBits) \
   249 		-DtoBits=$$($1_toBits) \
   249 	    -DtoBits=$$($1_toBits) \
   250 		-DLG_BYTES_PER_VALUE=$$($1_LBPV) \
   250 	    -DLG_BYTES_PER_VALUE=$$($1_LBPV) \
   251 		-DBYTES_PER_VALUE="(1 << $$($1_LBPV))" \
   251 	    -DBYTES_PER_VALUE="(1 << $$($1_LBPV))" \
   252 		-DBO=$$($1_BO) \
   252 	    -DBO=$$($1_BO) \
   253 		-Dswap=$$($1_swap) \
   253 	    -Dswap=$$($1_swap) \
   254 		-DRW=$$($1_RW) \
   254 	    -DRW=$$($1_RW) \
   255 		-K$$($1_rwkey) \
   255 	    -K$$($1_rwkey) \
   256 		-Da=$$($1_a) \
   256 	    -Da=$$($1_a) \
   257 		-DA=$$($1_A) \
   257 	    -DA=$$($1_A) \
   258 		-Kbo$$($1_BO)
   258 	    -Kbo$$($1_BO)
   259 		$(MV) $$($1_OUT).tmp $$($1_OUT)
   259 	$(MV) $$($1_OUT).tmp $$($1_OUT)
   260 # Do the extra bin thing
   260         # Do the extra bin thing
   261 ifeq ($$($1_BIN),1)
   261         ifeq ($$($1_BIN), 1)
   262 	$(SED) -e '/#BIN/,$$$$d' < $$($1_OUT) > $$($1_DST).tmp
   262 	  $(SED) -e '/#BIN/,$$$$d' < $$($1_OUT) > $$($1_DST).tmp
   263 	$(RM) $$($1_OUT)
   263 	  $(RM) $$($1_OUT)
   264 	$$($1_char_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   264 	  $$($1_char_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   265 	$$($1_short_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   265 	  $$($1_short_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   266 	$$($1_int_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   266 	  $$($1_int_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   267 	$$($1_long_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   267 	  $$($1_long_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   268 	$$($1_float_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   268 	  $$($1_float_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   269 	$$($1_double_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   269 	  $$($1_double_CMD) < $$($1_SRC_BIN) >> $$($1_DST).tmp
   270 	$(PRINTF) "}\n" >> $$($1_DST).tmp
   270 	  $(PRINTF) "}\n" >> $$($1_DST).tmp
   271 	mv $$($1_DST).tmp $$($1_DST)
   271 	  mv $$($1_DST).tmp $$($1_DST)
   272 endif
   272         endif
   273 
   273 
   274 GENSRC_BUFFER += $$($1_DST)
   274   GENSRC_BUFFER += $$($1_DST)
   275 
   275 
   276 endef
   276 endef
   277 
   277 
   278 ###
   278 ###
   279 
   279 
   280 X_BUF :=X-Buffer
   280 X_BUF := X-Buffer
   281 
   281 
   282 $(eval $(call SetupGenBuffer,ByteBuffer,  $(X_BUF),type:=byte,BIN:=1))
   282 $(eval $(call SetupGenBuffer,ByteBuffer,  $(X_BUF), type:=byte, BIN:=1))
   283 $(eval $(call SetupGenBuffer,CharBuffer,  $(X_BUF),type:=char))
   283 $(eval $(call SetupGenBuffer,CharBuffer,  $(X_BUF), type:=char))
   284 $(eval $(call SetupGenBuffer,ShortBuffer, $(X_BUF),type:=short))
   284 $(eval $(call SetupGenBuffer,ShortBuffer, $(X_BUF), type:=short))
   285 $(eval $(call SetupGenBuffer,IntBuffer,   $(X_BUF),type:=int))
   285 $(eval $(call SetupGenBuffer,IntBuffer,   $(X_BUF), type:=int))
   286 $(eval $(call SetupGenBuffer,LongBuffer,  $(X_BUF),type:=long))
   286 $(eval $(call SetupGenBuffer,LongBuffer,  $(X_BUF), type:=long))
   287 $(eval $(call SetupGenBuffer,FloatBuffer, $(X_BUF),type:=float))
   287 $(eval $(call SetupGenBuffer,FloatBuffer, $(X_BUF), type:=float))
   288 $(eval $(call SetupGenBuffer,DoubleBuffer,$(X_BUF),type:=double))
   288 $(eval $(call SetupGenBuffer,DoubleBuffer,$(X_BUF), type:=double))
   289 
   289 
   290 # Buffers whose contents are heap-allocated
   290 # Buffers whose contents are heap-allocated
   291 # 
   291 #
   292 HEAP_X_BUF := Heap-X-Buffer
   292 HEAP_X_BUF := Heap-X-Buffer
   293 
   293 
   294 $(eval $(call SetupGenBuffer,HeapByteBuffer,   $(HEAP_X_BUF),type:=byte))
   294 $(eval $(call SetupGenBuffer,HeapByteBuffer,   $(HEAP_X_BUF), type:=byte))
   295 $(eval $(call SetupGenBuffer,HeapByteBufferR,  $(HEAP_X_BUF),type:=byte,RW:=R))
   295 $(eval $(call SetupGenBuffer,HeapByteBufferR,  $(HEAP_X_BUF), type:=byte, RW:=R))
   296 $(eval $(call SetupGenBuffer,HeapCharBuffer,   $(HEAP_X_BUF),type:=char))
   296 $(eval $(call SetupGenBuffer,HeapCharBuffer,   $(HEAP_X_BUF), type:=char))
   297 $(eval $(call SetupGenBuffer,HeapCharBufferR,  $(HEAP_X_BUF),type:=char,RW:=R))
   297 $(eval $(call SetupGenBuffer,HeapCharBufferR,  $(HEAP_X_BUF), type:=char, RW:=R))
   298 $(eval $(call SetupGenBuffer,HeapShortBuffer,  $(HEAP_X_BUF),type:=short))
   298 $(eval $(call SetupGenBuffer,HeapShortBuffer,  $(HEAP_X_BUF), type:=short))
   299 $(eval $(call SetupGenBuffer,HeapShortBufferR, $(HEAP_X_BUF),type:=short,RW:=R))
   299 $(eval $(call SetupGenBuffer,HeapShortBufferR, $(HEAP_X_BUF), type:=short, RW:=R))
   300 $(eval $(call SetupGenBuffer,HeapIntBuffer,    $(HEAP_X_BUF),type:=int))
   300 $(eval $(call SetupGenBuffer,HeapIntBuffer,    $(HEAP_X_BUF), type:=int))
   301 $(eval $(call SetupGenBuffer,HeapIntBufferR,   $(HEAP_X_BUF),type:=int,RW:=R))
   301 $(eval $(call SetupGenBuffer,HeapIntBufferR,   $(HEAP_X_BUF), type:=int, RW:=R))
   302 $(eval $(call SetupGenBuffer,HeapLongBuffer,   $(HEAP_X_BUF),type:=long))
   302 $(eval $(call SetupGenBuffer,HeapLongBuffer,   $(HEAP_X_BUF), type:=long))
   303 $(eval $(call SetupGenBuffer,HeapLongBufferR,  $(HEAP_X_BUF),type:=long,RW:=R))
   303 $(eval $(call SetupGenBuffer,HeapLongBufferR,  $(HEAP_X_BUF), type:=long, RW:=R))
   304 $(eval $(call SetupGenBuffer,HeapFloatBuffer,  $(HEAP_X_BUF),type:=float))
   304 $(eval $(call SetupGenBuffer,HeapFloatBuffer,  $(HEAP_X_BUF), type:=float))
   305 $(eval $(call SetupGenBuffer,HeapFloatBufferR, $(HEAP_X_BUF),type:=float,RW:=R))
   305 $(eval $(call SetupGenBuffer,HeapFloatBufferR, $(HEAP_X_BUF), type:=float, RW:=R))
   306 $(eval $(call SetupGenBuffer,HeapDoubleBuffer, $(HEAP_X_BUF),type:=double))
   306 $(eval $(call SetupGenBuffer,HeapDoubleBuffer, $(HEAP_X_BUF), type:=double))
   307 $(eval $(call SetupGenBuffer,HeapDoubleBufferR,$(HEAP_X_BUF),type:=double,RW:=R))
   307 $(eval $(call SetupGenBuffer,HeapDoubleBufferR,$(HEAP_X_BUF), type:=double, RW:=R))
   308 
   308 
   309 # Direct byte buffer
   309 # Direct byte buffer
   310 # 
   310 #
   311 DIRECT_X_BUF := Direct-X-Buffer
   311 DIRECT_X_BUF := Direct-X-Buffer
   312 
   312 
   313 $(eval $(call SetupGenBuffer,DirectByteBuffer, $(DIRECT_X_BUF),type:=byte,BIN:=1))
   313 $(eval $(call SetupGenBuffer,DirectByteBuffer, $(DIRECT_X_BUF), type:=byte, BIN:=1))
   314 $(eval $(call SetupGenBuffer,DirectByteBufferR,$(DIRECT_X_BUF),type:=byte,BIN:=1,RW:=R))
   314 $(eval $(call SetupGenBuffer,DirectByteBufferR,$(DIRECT_X_BUF), type:=byte, BIN:=1, RW:=R))
   315 
   315 
   316 # Unswapped views of direct byte buffers
   316 # Unswapped views of direct byte buffers
   317 #
   317 #
   318 $(eval $(call SetupGenBuffer,DirectCharBufferU,   $(DIRECT_X_BUF),type:=char,BO:=U))
   318 $(eval $(call SetupGenBuffer,DirectCharBufferU,   $(DIRECT_X_BUF), type:=char, BO:=U))
   319 $(eval $(call SetupGenBuffer,DirectCharBufferRU,  $(DIRECT_X_BUF),type:=char,RW:=R,BO:=U))
   319 $(eval $(call SetupGenBuffer,DirectCharBufferRU,  $(DIRECT_X_BUF), type:=char, RW:=R, BO:=U))
   320 $(eval $(call SetupGenBuffer,DirectShortBufferU,  $(DIRECT_X_BUF),type:=short,BO:=U))
   320 $(eval $(call SetupGenBuffer,DirectShortBufferU,  $(DIRECT_X_BUF), type:=short, BO:=U))
   321 $(eval $(call SetupGenBuffer,DirectShortBufferRU, $(DIRECT_X_BUF),type:=short,RW:=R,BO:=U))
   321 $(eval $(call SetupGenBuffer,DirectShortBufferRU, $(DIRECT_X_BUF), type:=short, RW:=R, BO:=U))
   322 $(eval $(call SetupGenBuffer,DirectIntBufferU,    $(DIRECT_X_BUF),type:=int,BO:=U))
   322 $(eval $(call SetupGenBuffer,DirectIntBufferU,    $(DIRECT_X_BUF), type:=int, BO:=U))
   323 $(eval $(call SetupGenBuffer,DirectIntBufferRU,   $(DIRECT_X_BUF),type:=int,RW:=R,BO:=U))
   323 $(eval $(call SetupGenBuffer,DirectIntBufferRU,   $(DIRECT_X_BUF), type:=int, RW:=R, BO:=U))
   324 $(eval $(call SetupGenBuffer,DirectLongBufferU,   $(DIRECT_X_BUF),type:=long,BO:=U))
   324 $(eval $(call SetupGenBuffer,DirectLongBufferU,   $(DIRECT_X_BUF), type:=long, BO:=U))
   325 $(eval $(call SetupGenBuffer,DirectLongBufferRU,  $(DIRECT_X_BUF),type:=long,RW:=R,BO:=U))
   325 $(eval $(call SetupGenBuffer,DirectLongBufferRU,  $(DIRECT_X_BUF), type:=long, RW:=R, BO:=U))
   326 $(eval $(call SetupGenBuffer,DirectFloatBufferU,  $(DIRECT_X_BUF),type:=float,BO:=U))
   326 $(eval $(call SetupGenBuffer,DirectFloatBufferU,  $(DIRECT_X_BUF), type:=float, BO:=U))
   327 $(eval $(call SetupGenBuffer,DirectFloatBufferRU, $(DIRECT_X_BUF),type:=float,RW:=R,BO:=U))
   327 $(eval $(call SetupGenBuffer,DirectFloatBufferRU, $(DIRECT_X_BUF), type:=float, RW:=R, BO:=U))
   328 $(eval $(call SetupGenBuffer,DirectDoubleBufferU, $(DIRECT_X_BUF),type:=double,BO:=U))
   328 $(eval $(call SetupGenBuffer,DirectDoubleBufferU, $(DIRECT_X_BUF), type:=double, BO:=U))
   329 $(eval $(call SetupGenBuffer,DirectDoubleBufferRU,$(DIRECT_X_BUF),type:=double,RW:=R,BO:=U))
   329 $(eval $(call SetupGenBuffer,DirectDoubleBufferRU,$(DIRECT_X_BUF), type:=double, RW:=R, BO:=U))
   330 
   330 
   331 # Swapped views of direct byte buffers
   331 # Swapped views of direct byte buffers
   332 #
   332 #
   333 $(eval $(call SetupGenBuffer,DirectCharBufferS,   $(DIRECT_X_BUF),type:=char,BO:=S))
   333 $(eval $(call SetupGenBuffer,DirectCharBufferS,   $(DIRECT_X_BUF), type:=char, BO:=S))
   334 $(eval $(call SetupGenBuffer,DirectCharBufferRS,  $(DIRECT_X_BUF),type:=char,RW:=R,BO:=S))
   334 $(eval $(call SetupGenBuffer,DirectCharBufferRS,  $(DIRECT_X_BUF), type:=char, RW:=R, BO:=S))
   335 $(eval $(call SetupGenBuffer,DirectShortBufferS,  $(DIRECT_X_BUF),type:=short,BO:=S))
   335 $(eval $(call SetupGenBuffer,DirectShortBufferS,  $(DIRECT_X_BUF), type:=short, BO:=S))
   336 $(eval $(call SetupGenBuffer,DirectShortBufferRS, $(DIRECT_X_BUF),type:=short,RW:=R,BO:=S))
   336 $(eval $(call SetupGenBuffer,DirectShortBufferRS, $(DIRECT_X_BUF), type:=short, RW:=R, BO:=S))
   337 $(eval $(call SetupGenBuffer,DirectIntBufferS,    $(DIRECT_X_BUF),type:=int,BO:=S))
   337 $(eval $(call SetupGenBuffer,DirectIntBufferS,    $(DIRECT_X_BUF), type:=int, BO:=S))
   338 $(eval $(call SetupGenBuffer,DirectIntBufferRS,   $(DIRECT_X_BUF),type:=int,RW:=R,BO:=S))
   338 $(eval $(call SetupGenBuffer,DirectIntBufferRS,   $(DIRECT_X_BUF), type:=int, RW:=R, BO:=S))
   339 $(eval $(call SetupGenBuffer,DirectLongBufferS,   $(DIRECT_X_BUF),type:=long,BO:=S))
   339 $(eval $(call SetupGenBuffer,DirectLongBufferS,   $(DIRECT_X_BUF), type:=long, BO:=S))
   340 $(eval $(call SetupGenBuffer,DirectLongBufferRS,  $(DIRECT_X_BUF),type:=long,RW:=R,BO:=S))
   340 $(eval $(call SetupGenBuffer,DirectLongBufferRS,  $(DIRECT_X_BUF), type:=long, RW:=R, BO:=S))
   341 $(eval $(call SetupGenBuffer,DirectFloatBufferS,  $(DIRECT_X_BUF),type:=float,BO:=S))
   341 $(eval $(call SetupGenBuffer,DirectFloatBufferS,  $(DIRECT_X_BUF), type:=float, BO:=S))
   342 $(eval $(call SetupGenBuffer,DirectFloatBufferRS, $(DIRECT_X_BUF),type:=float,RW:=R,BO:=S))
   342 $(eval $(call SetupGenBuffer,DirectFloatBufferRS, $(DIRECT_X_BUF), type:=float, RW:=R, BO:=S))
   343 $(eval $(call SetupGenBuffer,DirectDoubleBufferS, $(DIRECT_X_BUF),type:=double,BO:=S))
   343 $(eval $(call SetupGenBuffer,DirectDoubleBufferS, $(DIRECT_X_BUF), type:=double, BO:=S))
   344 $(eval $(call SetupGenBuffer,DirectDoubleBufferRS,$(DIRECT_X_BUF),type:=double,RW:=R,BO:=S))
   344 $(eval $(call SetupGenBuffer,DirectDoubleBufferRS,$(DIRECT_X_BUF), type:=double, RW:=R, BO:=S))
   345 
   345 
   346 # Big-endian views of byte buffers
   346 # Big-endian views of byte buffers
   347 #
   347 #
   348 BYTE_X_BUF := ByteBufferAs-X-Buffer
   348 BYTE_X_BUF := ByteBufferAs-X-Buffer
   349 
   349 
   350 $(eval $(call SetupGenBuffer,ByteBufferAsCharBufferB,   $(BYTE_X_BUF),type:=char,BO:=B))
   350 $(eval $(call SetupGenBuffer,ByteBufferAsCharBufferB,   $(BYTE_X_BUF), type:=char, BO:=B))
   351 $(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRB,  $(BYTE_X_BUF),type:=char,RW:=R,BO:=B))
   351 $(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRB,  $(BYTE_X_BUF), type:=char, RW:=R, BO:=B))
   352 $(eval $(call SetupGenBuffer,ByteBufferAsShortBufferB,  $(BYTE_X_BUF),type:=short,BO:=B))
   352 $(eval $(call SetupGenBuffer,ByteBufferAsShortBufferB,  $(BYTE_X_BUF), type:=short, BO:=B))
   353 $(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRB, $(BYTE_X_BUF),type:=short,RW:=R,BO:=B))
   353 $(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRB, $(BYTE_X_BUF), type:=short, RW:=R, BO:=B))
   354 $(eval $(call SetupGenBuffer,ByteBufferAsIntBufferB,    $(BYTE_X_BUF),type:=int,BO:=B))
   354 $(eval $(call SetupGenBuffer,ByteBufferAsIntBufferB,    $(BYTE_X_BUF), type:=int, BO:=B))
   355 $(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRB,   $(BYTE_X_BUF),type:=int,RW:=R,BO:=B))
   355 $(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRB,   $(BYTE_X_BUF), type:=int, RW:=R, BO:=B))
   356 $(eval $(call SetupGenBuffer,ByteBufferAsLongBufferB,   $(BYTE_X_BUF),type:=long,BO:=B))
   356 $(eval $(call SetupGenBuffer,ByteBufferAsLongBufferB,   $(BYTE_X_BUF), type:=long, BO:=B))
   357 $(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRB,  $(BYTE_X_BUF),type:=long,RW:=R,BO:=B))
   357 $(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRB,  $(BYTE_X_BUF), type:=long, RW:=R, BO:=B))
   358 $(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferB,  $(BYTE_X_BUF),type:=float,BO:=B))
   358 $(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferB,  $(BYTE_X_BUF), type:=float, BO:=B))
   359 $(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRB, $(BYTE_X_BUF),type:=float,RW:=R,BO:=B))
   359 $(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRB, $(BYTE_X_BUF), type:=float, RW:=R, BO:=B))
   360 $(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferB, $(BYTE_X_BUF),type:=double,BO:=B))
   360 $(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferB, $(BYTE_X_BUF), type:=double, BO:=B))
   361 $(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRB,$(BYTE_X_BUF),type:=double,RW:=R,BO:=B))
   361 $(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRB,$(BYTE_X_BUF), type:=double, RW:=R, BO:=B))
   362 
   362 
   363 # Little-endian views of byte buffers
   363 # Little-endian views of byte buffers
   364 #
   364 #
   365 $(eval $(call SetupGenBuffer,ByteBufferAsCharBufferL,   $(BYTE_X_BUF),type:=char,BO:=L))
   365 $(eval $(call SetupGenBuffer,ByteBufferAsCharBufferL,   $(BYTE_X_BUF), type:=char, BO:=L))
   366 $(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRL,  $(BYTE_X_BUF),type:=char,RW:=R,BO:=L))
   366 $(eval $(call SetupGenBuffer,ByteBufferAsCharBufferRL,  $(BYTE_X_BUF), type:=char, RW:=R, BO:=L))
   367 $(eval $(call SetupGenBuffer,ByteBufferAsShortBufferL,  $(BYTE_X_BUF),type:=short,BO:=L))
   367 $(eval $(call SetupGenBuffer,ByteBufferAsShortBufferL,  $(BYTE_X_BUF), type:=short, BO:=L))
   368 $(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRL, $(BYTE_X_BUF),type:=short,RW:=R,BO:=L))
   368 $(eval $(call SetupGenBuffer,ByteBufferAsShortBufferRL, $(BYTE_X_BUF), type:=short, RW:=R, BO:=L))
   369 $(eval $(call SetupGenBuffer,ByteBufferAsIntBufferL,    $(BYTE_X_BUF),type:=int,BO:=L))
   369 $(eval $(call SetupGenBuffer,ByteBufferAsIntBufferL,    $(BYTE_X_BUF), type:=int, BO:=L))
   370 $(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRL,   $(BYTE_X_BUF),type:=int,RW:=R,BO:=L))
   370 $(eval $(call SetupGenBuffer,ByteBufferAsIntBufferRL,   $(BYTE_X_BUF), type:=int, RW:=R, BO:=L))
   371 $(eval $(call SetupGenBuffer,ByteBufferAsLongBufferL,   $(BYTE_X_BUF),type:=long,BO:=L))
   371 $(eval $(call SetupGenBuffer,ByteBufferAsLongBufferL,   $(BYTE_X_BUF), type:=long, BO:=L))
   372 $(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRL,  $(BYTE_X_BUF),type:=long,RW:=R,BO:=L))
   372 $(eval $(call SetupGenBuffer,ByteBufferAsLongBufferRL,  $(BYTE_X_BUF), type:=long, RW:=R, BO:=L))
   373 $(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferL,  $(BYTE_X_BUF),type:=float,BO:=L))
   373 $(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferL,  $(BYTE_X_BUF), type:=float, BO:=L))
   374 $(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRL, $(BYTE_X_BUF),type:=float,RW:=R,BO:=L))
   374 $(eval $(call SetupGenBuffer,ByteBufferAsFloatBufferRL, $(BYTE_X_BUF), type:=float, RW:=R, BO:=L))
   375 $(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferL, $(BYTE_X_BUF),type:=double,BO:=L))
   375 $(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferL, $(BYTE_X_BUF), type:=double, BO:=L))
   376 $(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRL,$(BYTE_X_BUF),type:=double,RW:=R,BO:=L))
   376 $(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRL,$(BYTE_X_BUF), type:=double, RW:=R, BO:=L))
   377 
   377 
   378 ###
   378 ###
   379 
   379 
   380 $(GENSRC_BUFFER) : $(BUILD_TOOLS)
   380 $(GENSRC_BUFFER): $(BUILD_TOOLS)