< prev index next >

test/jdk/jdk/incubator/vector/gen-template.sh

Print this page

  1 #!/bin/bash
  2 #
  3 # Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
  4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5 #
  6 # This code is free software; you can redistribute it and/or modify it
  7 # under the terms of the GNU General Public License version 2 only, as
  8 # published by the Free Software Foundation.  Oracle designates this
  9 # particular file as subject to the "Classpath" exception as provided
 10 # by Oracle in the LICENSE file that accompanied this code.
 11 #
 12 # This code is distributed in the hope that it will be useful, but WITHOUT
 13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 14 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 15 # version 2 for more details (a copy is included in the LICENSE file that
 16 # accompanied this code).
 17 #
 18 # You should have received a copy of the GNU General Public License version
 19 # 2 along with this work; if not, write to the Free Software Foundation,
 20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 21 #
 22 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 23 # or visit www.oracle.com if you need additional information or have any

 57 reduction_scalar="Reduction-Scalar-op"
 58 reduction_scalar_func="Reduction-Scalar-op-func"
 59 reduction_scalar_masked="Reduction-Scalar-Masked-op"
 60 reduction_scalar_masked_func="Reduction-Scalar-Masked-op-func"
 61 reduction_op="Reduction-op"
 62 reduction_op_func="Reduction-op-func"
 63 reduction_op_masked="Reduction-Masked-op"
 64 reduction_op_masked_func="Reduction-Masked-op-func"
 65 unary_math_template="Unary-op-math"
 66 binary_math_template="Binary-op-math"
 67 binary_math_broadcast_template="Binary-Broadcast-op-math"
 68 bool_reduction_scalar="BoolReduction-Scalar-op"
 69 bool_reduction_template="BoolReduction-op"
 70 with_op_template="With-Op"
 71 shift_template="Shift-op"
 72 shift_masked_template="Shift-Masked-op"
 73 shift_const_template="Shift-Const-op"
 74 shift_masked_const_template="Shift-Masked-Const-op"
 75 get_template="Get-op"
 76 rearrange_template="Rearrange"

 77 broadcast_template="Broadcast"
 78 zero_template="Zero"
 79 slice_template="Slice-op"
 80 slice1_template="Slice-bop"
 81 slice1_masked_template="Slice-Masked-bop"
 82 unslice_template="Unslice-op"
 83 unslice1_template="Unslice-bop"
 84 unslice1_masked_template="Unslice-Masked-bop"
 85 miscellaneous_template="Miscellaneous"
 86 
 87 function replace_variables {
 88   local filename=$1
 89   local output=$2
 90   local kernel=$3
 91   local test=$4
 92   local op=$5
 93   local init=$6
 94   local guard=$7
 95   local masked=$8
 96   local op_name=$9

128   sed_prog="
129     s/\<OPTIONAL\>\(.*\)\<\\OPTIONAL\>/\1/g
130     s/\[\[TEST_TYPE\]\]/${masked}/g
131     s/\[\[TEST_OP\]\]/${op}/g
132     s/\[\[TEST_INIT\]\]/${init}/g
133     s/\[\[OP_NAME\]\]/${op_name}/g
134   "
135   sed_prog_2="$sed_prog
136     s/\[\[TEST\]\]/${test_func}/g
137     s/[.][^(]*(VectorOperators.$test_func, /.$test_func(/g
138     s/[.][^(]*(VectorOperators.$test_func,/.$test_func(/g
139     s/[.][^(]*(VectorOperators.$test_func/.$test_func(/g
140   "
141   sed_prog="
142     $sed_prog
143     s/\[\[TEST\]\]/${test}/g
144   "
145 
146   # Guard the test if necessary
147   if [ "$guard" != "" ]; then
148     echo -e "#if[${guard}]\n" >> $output
149   fi
150   if [ "$test" != "" ]; then
151     sed -e "$sed_prog" < ${filename}.current >> $output
152   fi
153   # If we also have a dedicated function for the operation then use 2nd sed expression
154   if [[ "$filename" == *"Unit"* ]] && [ "$test_func" != "" ]; then
155     if [ "$masked" == "" ] || [ "$withMask" != "" ]; then
156       if [ ! -z "$kernel_smoke" ]; then
157         local kernel_smoke_escaped=$(echo -e "$kernel_smoke" | tr '\n' '`')
158         sed "s/\[\[KERNEL\]\]/${kernel_smoke_escaped}/g" $filename > ${filename}.scurrent1
159         cat ${filename}.scurrent1 | tr '`' "\n" > ${filename}.scurrent
160         rm -f "${filename}.scurrent1"
161       else
162         cp $filename.current ${filename}.scurrent
163       fi
164       sed -e "$sed_prog_2" < ${filename}.scurrent >> $output
165       rm -f ${filename}.scurrent
166     fi
167   fi
168   if [ "$guard" != "" ]; then
169     echo -e "#end[${guard}]\n" >> $output
170   fi
171 
172   rm -f ${filename}.current
173 }
174 
175 function gen_op_tmpl {
176   local template=$1
177   local test=$2
178   local op=$3
179   local guard=""
180   local init=""
181   if [ $# -gt 3 ]; then
182     guard=$4
183   fi
184   if [ $# == 5 ]; then
185     init=$5
186   fi
187 
188   local masked=""
189   if [[ $template == *"Masked"* ]]; then

393 
394 if [ $generate_perf_tests == true ]; then
395   gen_perf_header $perf_output
396   gen_perf_scalar_header $perf_scalar_output
397 fi
398 
399 # ALU binary ops.
400 # Here "ADD+add+withMask" says VectorOperator name is "ADD", and we have a dedicate method too named 'add', and add() is also available with mask variant.
401 gen_binary_alu_op "ADD+add+withMask" "a + b"
402 gen_binary_alu_op "SUB+sub+withMask" "a - b"
403 gen_binary_alu_op "MUL+mul+withMask" "a \* b"
404 gen_binary_alu_op "DIV+div+withMask" "a \/ b" "FP"
405 gen_op_tmpl "Binary-op_bitwise-div" "DIV+div+withMask" "a \/ b" "BITWISE"
406 gen_op_tmpl "Binary-Masked-op_bitwise-div" "DIV+div+withMask" "a \/ b" "BITWISE"
407 gen_binary_alu_op "FIRST_NONZERO" "{#if[FP]?Double.doubleToLongBits}(a)!=0?a:b"
408 gen_binary_alu_op "AND+and"   "a \& b"  "BITWISE"
409 gen_binary_alu_op "AND_NOT" "a \& ~b" "BITWISE"
410 gen_binary_alu_op "OR+or"    "a | b"   "BITWISE"
411 # Missing:        "OR_UNCHECKED"
412 gen_binary_alu_op "XOR"   "a ^ b"   "BITWISE"


413 # Generate the broadcast versions
414 gen_binary_alu_bcst_op "add+withMask" "a + b"
415 gen_binary_alu_bcst_op "sub+withMask" "a - b"
416 gen_binary_alu_bcst_op "mul+withMask" "a \* b"
417 gen_binary_alu_bcst_op "div+withMask" "a \/ b" "FP"
418 gen_op_tmpl "Binary-Broadcast-op_bitwise-div" "div+withMask" "a \/ b" "BITWISE"
419 gen_op_tmpl "Binary-Broadcast-Masked-op_bitwise-div" "div+withMask" "a \/ b" "BITWISE"
420 gen_binary_alu_bcst_op "OR+or"    "a | b"   "BITWISE"
421 gen_binary_alu_bcst_op "AND+and"    "a \& b"   "BITWISE"
422 gen_binary_alu_bcst_long_op "OR"     "a | b"   "BITWISE"
423 gen_binary_alu_bcst_long_op "ADD"    "a + b"
424 
425 # Shifts
426 gen_binary_alu_op "LSHL" "(a << b)" "intOrLong"
427 gen_binary_alu_op "LSHL" "(a << (b \& 0x7))" "byte"
428 gen_binary_alu_op "LSHL" "(a << (b \& 0xF))" "short"
429 gen_binary_alu_op "ASHR" "(a >> b)" "intOrLong"
430 gen_binary_alu_op "ASHR" "(a >> (b \& 0x7))" "byte"
431 gen_binary_alu_op "ASHR" "(a >> (b \& 0xF))" "short"
432 gen_binary_alu_op "LSHR" "(a >>> b)" "intOrLong"

491 gen_compare_op "EQ+eq" "eq"
492 gen_compare_op "NE" "neq"
493 gen_compare_op "LE" "le"
494 gen_compare_op "GE" "ge"
495 
496 gen_compare_op "UNSIGNED_LT" "ult" "BITWISE"
497 gen_compare_op "UNSIGNED_GT" "ugt" "BITWISE"
498 gen_compare_op "UNSIGNED_LE" "ule" "BITWISE"
499 gen_compare_op "UNSIGNED_GE" "uge" "BITWISE"
500 
501 
502 gen_compare_bcst_op "LT" "<"
503 gen_compare_bcst_op "EQ" "=="
504 
505 # Blend.
506 gen_op_tmpl $blend "blend" ""
507 
508 # Rearrange
509 gen_op_tmpl $rearrange_template "rearrange" ""
510 



511 # Get
512 gen_get_op "lane" ""
513 
514 # Broadcast
515 gen_op_tmpl $broadcast_template "broadcast" ""
516 
517 # Zero
518 gen_op_tmpl $zero_template "zero" ""
519 
520 # Slice
521 gen_op_tmpl $slice_template "sliceUnary" ""
522 gen_op_tmpl $slice1_template "sliceBinary" ""
523 gen_op_tmpl $slice1_masked_template "slice" ""
524 
525 # Unslice
526 gen_op_tmpl $unslice_template "unsliceUnary" ""
527 gen_op_tmpl $unslice1_template "unsliceBinary" ""
528 gen_op_tmpl $unslice1_masked_template "unslice" ""
529 
530 # Math

545 gen_op_tmpl $unary_math_template "CBRT" "Math.cbrt((double)a)" "FP"
546 gen_op_tmpl $binary_math_template "HYPOT" "Math.hypot((double)a, (double)b)" "FP"
547 gen_op_tmpl $binary_math_template "POW+pow" "Math.pow((double)a, (double)b)" "FP"
548 gen_op_tmpl $binary_math_template "ATAN2" "Math.atan2((double)a, (double)b)" "FP"
549 gen_op_tmpl $binary_math_broadcast_template "POW+pow" "Math.pow((double)a, (double)b)" "FP"
550 
551 # Ternary operations.
552 gen_ternary_alu_op "FMA+fma" "Math.fma(a, b, c)" "FP"
553 gen_ternary_alu_op "BITWISE_BLEND+bitwiseBlend" "(a\&~(c))|(b\&c)" "BITWISE"
554 gen_ternary_alu_bcst_op "FMA" "Math.fma(a, b, c)" "FP"
555 gen_ternary_alu_bcst_op "BITWISE_BLEND+bitwiseBlend" "(a\&~(c))|(b\&c)" "BITWISE"
556 gen_ternary_alu_double_bcst_op "FMA+fma" "Math.fma(a, b, c)" "FP"
557 gen_ternary_alu_double_bcst_op "BITWISE_BLEND+bitwiseBlend" "(a\&~(c))|(b\&c)" "BITWISE"
558 
559 # Unary operations.
560 gen_unary_alu_op "NEG+neg" "-((\$type\$)a)"
561 gen_unary_alu_op "ABS+abs" "Math.abs((\$type\$)a)"
562 gen_unary_alu_op "NOT+not" "~((\$type\$)a)" "BITWISE"
563 gen_unary_alu_op "ZOMO" "(a==0?0:-1)" "BITWISE"
564 gen_unary_alu_op "SQRT+sqrt" "Math.sqrt((double)a)" "FP"









565 
566 # Miscellaneous Smoke Tests
567 gen_op_tmpl $miscellaneous_template "MISC" "" ""
568 
569 gen_unit_footer $unit_output
570 
571 if [ $generate_perf_tests == true ]; then
572   gen_perf_footer $perf_output
573   gen_perf_scalar_footer $perf_scalar_output
574 fi
575 
576 rm -f templates/*.current*

  1 #!/bin/bash
  2 #
  3 # Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
  4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5 #
  6 # This code is free software; you can redistribute it and/or modify it
  7 # under the terms of the GNU General Public License version 2 only, as
  8 # published by the Free Software Foundation.  Oracle designates this
  9 # particular file as subject to the "Classpath" exception as provided
 10 # by Oracle in the LICENSE file that accompanied this code.
 11 #
 12 # This code is distributed in the hope that it will be useful, but WITHOUT
 13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 14 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 15 # version 2 for more details (a copy is included in the LICENSE file that
 16 # accompanied this code).
 17 #
 18 # You should have received a copy of the GNU General Public License version
 19 # 2 along with this work; if not, write to the Free Software Foundation,
 20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 21 #
 22 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 23 # or visit www.oracle.com if you need additional information or have any

 57 reduction_scalar="Reduction-Scalar-op"
 58 reduction_scalar_func="Reduction-Scalar-op-func"
 59 reduction_scalar_masked="Reduction-Scalar-Masked-op"
 60 reduction_scalar_masked_func="Reduction-Scalar-Masked-op-func"
 61 reduction_op="Reduction-op"
 62 reduction_op_func="Reduction-op-func"
 63 reduction_op_masked="Reduction-Masked-op"
 64 reduction_op_masked_func="Reduction-Masked-op-func"
 65 unary_math_template="Unary-op-math"
 66 binary_math_template="Binary-op-math"
 67 binary_math_broadcast_template="Binary-Broadcast-op-math"
 68 bool_reduction_scalar="BoolReduction-Scalar-op"
 69 bool_reduction_template="BoolReduction-op"
 70 with_op_template="With-Op"
 71 shift_template="Shift-op"
 72 shift_masked_template="Shift-Masked-op"
 73 shift_const_template="Shift-Const-op"
 74 shift_masked_const_template="Shift-Masked-Const-op"
 75 get_template="Get-op"
 76 rearrange_template="Rearrange"
 77 compressexpand_template="CompressExpand"
 78 broadcast_template="Broadcast"
 79 zero_template="Zero"
 80 slice_template="Slice-op"
 81 slice1_template="Slice-bop"
 82 slice1_masked_template="Slice-Masked-bop"
 83 unslice_template="Unslice-op"
 84 unslice1_template="Unslice-bop"
 85 unslice1_masked_template="Unslice-Masked-bop"
 86 miscellaneous_template="Miscellaneous"
 87 
 88 function replace_variables {
 89   local filename=$1
 90   local output=$2
 91   local kernel=$3
 92   local test=$4
 93   local op=$5
 94   local init=$6
 95   local guard=$7
 96   local masked=$8
 97   local op_name=$9

129   sed_prog="
130     s/\<OPTIONAL\>\(.*\)\<\\OPTIONAL\>/\1/g
131     s/\[\[TEST_TYPE\]\]/${masked}/g
132     s/\[\[TEST_OP\]\]/${op}/g
133     s/\[\[TEST_INIT\]\]/${init}/g
134     s/\[\[OP_NAME\]\]/${op_name}/g
135   "
136   sed_prog_2="$sed_prog
137     s/\[\[TEST\]\]/${test_func}/g
138     s/[.][^(]*(VectorOperators.$test_func, /.$test_func(/g
139     s/[.][^(]*(VectorOperators.$test_func,/.$test_func(/g
140     s/[.][^(]*(VectorOperators.$test_func/.$test_func(/g
141   "
142   sed_prog="
143     $sed_prog
144     s/\[\[TEST\]\]/${test}/g
145   "
146 
147   # Guard the test if necessary
148   if [ "$guard" != "" ]; then
149     echo -e "#if[${guard}]" >> $output
150   fi
151   if [ "$test" != "" ]; then
152     sed -e "$sed_prog" < ${filename}.current >> $output
153   fi
154   # If we also have a dedicated function for the operation then use 2nd sed expression
155   if [[ "$filename" == *"Unit"* ]] && [ "$test_func" != "" ]; then
156     if [ "$masked" == "" ] || [ "$withMask" != "" ]; then
157       if [ ! -z "$kernel_smoke" ]; then
158         local kernel_smoke_escaped=$(echo -e "$kernel_smoke" | tr '\n' '`')
159         sed "s/\[\[KERNEL\]\]/${kernel_smoke_escaped}/g" $filename > ${filename}.scurrent1
160         cat ${filename}.scurrent1 | tr '`' "\n" > ${filename}.scurrent
161         rm -f "${filename}.scurrent1"
162       else
163         cp $filename.current ${filename}.scurrent
164       fi
165       sed -e "$sed_prog_2" < ${filename}.scurrent >> $output
166       rm -f ${filename}.scurrent
167     fi
168   fi
169   if [ "$guard" != "" ]; then
170     echo -e "#end[${guard}]" >> $output
171   fi
172 
173   rm -f ${filename}.current
174 }
175 
176 function gen_op_tmpl {
177   local template=$1
178   local test=$2
179   local op=$3
180   local guard=""
181   local init=""
182   if [ $# -gt 3 ]; then
183     guard=$4
184   fi
185   if [ $# == 5 ]; then
186     init=$5
187   fi
188 
189   local masked=""
190   if [[ $template == *"Masked"* ]]; then

394 
395 if [ $generate_perf_tests == true ]; then
396   gen_perf_header $perf_output
397   gen_perf_scalar_header $perf_scalar_output
398 fi
399 
400 # ALU binary ops.
401 # Here "ADD+add+withMask" says VectorOperator name is "ADD", and we have a dedicate method too named 'add', and add() is also available with mask variant.
402 gen_binary_alu_op "ADD+add+withMask" "a + b"
403 gen_binary_alu_op "SUB+sub+withMask" "a - b"
404 gen_binary_alu_op "MUL+mul+withMask" "a \* b"
405 gen_binary_alu_op "DIV+div+withMask" "a \/ b" "FP"
406 gen_op_tmpl "Binary-op_bitwise-div" "DIV+div+withMask" "a \/ b" "BITWISE"
407 gen_op_tmpl "Binary-Masked-op_bitwise-div" "DIV+div+withMask" "a \/ b" "BITWISE"
408 gen_binary_alu_op "FIRST_NONZERO" "{#if[FP]?Double.doubleToLongBits}(a)!=0?a:b"
409 gen_binary_alu_op "AND+and"   "a \& b"  "BITWISE"
410 gen_binary_alu_op "AND_NOT" "a \& ~b" "BITWISE"
411 gen_binary_alu_op "OR+or"    "a | b"   "BITWISE"
412 # Missing:        "OR_UNCHECKED"
413 gen_binary_alu_op "XOR"   "a ^ b"   "BITWISE"
414 gen_binary_alu_op "COMPRESS_BITS" "\$Boxtype\$.compress(a, b)" "intOrLong"
415 gen_binary_alu_op "EXPAND_BITS" "\$Boxtype\$.expand(a, b)" "intOrLong"
416 # Generate the broadcast versions
417 gen_binary_alu_bcst_op "add+withMask" "a + b"
418 gen_binary_alu_bcst_op "sub+withMask" "a - b"
419 gen_binary_alu_bcst_op "mul+withMask" "a \* b"
420 gen_binary_alu_bcst_op "div+withMask" "a \/ b" "FP"
421 gen_op_tmpl "Binary-Broadcast-op_bitwise-div" "div+withMask" "a \/ b" "BITWISE"
422 gen_op_tmpl "Binary-Broadcast-Masked-op_bitwise-div" "div+withMask" "a \/ b" "BITWISE"
423 gen_binary_alu_bcst_op "OR+or"    "a | b"   "BITWISE"
424 gen_binary_alu_bcst_op "AND+and"    "a \& b"   "BITWISE"
425 gen_binary_alu_bcst_long_op "OR"     "a | b"   "BITWISE"
426 gen_binary_alu_bcst_long_op "ADD"    "a + b"
427 
428 # Shifts
429 gen_binary_alu_op "LSHL" "(a << b)" "intOrLong"
430 gen_binary_alu_op "LSHL" "(a << (b \& 0x7))" "byte"
431 gen_binary_alu_op "LSHL" "(a << (b \& 0xF))" "short"
432 gen_binary_alu_op "ASHR" "(a >> b)" "intOrLong"
433 gen_binary_alu_op "ASHR" "(a >> (b \& 0x7))" "byte"
434 gen_binary_alu_op "ASHR" "(a >> (b \& 0xF))" "short"
435 gen_binary_alu_op "LSHR" "(a >>> b)" "intOrLong"

494 gen_compare_op "EQ+eq" "eq"
495 gen_compare_op "NE" "neq"
496 gen_compare_op "LE" "le"
497 gen_compare_op "GE" "ge"
498 
499 gen_compare_op "UNSIGNED_LT" "ult" "BITWISE"
500 gen_compare_op "UNSIGNED_GT" "ugt" "BITWISE"
501 gen_compare_op "UNSIGNED_LE" "ule" "BITWISE"
502 gen_compare_op "UNSIGNED_GE" "uge" "BITWISE"
503 
504 
505 gen_compare_bcst_op "LT" "<"
506 gen_compare_bcst_op "EQ" "=="
507 
508 # Blend.
509 gen_op_tmpl $blend "blend" ""
510 
511 # Rearrange
512 gen_op_tmpl $rearrange_template "rearrange" ""
513 
514 # Compress/Expand
515 gen_op_tmpl $compressexpand_template "compress_expand" ""
516 
517 # Get
518 gen_get_op "lane" ""
519 
520 # Broadcast
521 gen_op_tmpl $broadcast_template "broadcast" ""
522 
523 # Zero
524 gen_op_tmpl $zero_template "zero" ""
525 
526 # Slice
527 gen_op_tmpl $slice_template "sliceUnary" ""
528 gen_op_tmpl $slice1_template "sliceBinary" ""
529 gen_op_tmpl $slice1_masked_template "slice" ""
530 
531 # Unslice
532 gen_op_tmpl $unslice_template "unsliceUnary" ""
533 gen_op_tmpl $unslice1_template "unsliceBinary" ""
534 gen_op_tmpl $unslice1_masked_template "unslice" ""
535 
536 # Math

551 gen_op_tmpl $unary_math_template "CBRT" "Math.cbrt((double)a)" "FP"
552 gen_op_tmpl $binary_math_template "HYPOT" "Math.hypot((double)a, (double)b)" "FP"
553 gen_op_tmpl $binary_math_template "POW+pow" "Math.pow((double)a, (double)b)" "FP"
554 gen_op_tmpl $binary_math_template "ATAN2" "Math.atan2((double)a, (double)b)" "FP"
555 gen_op_tmpl $binary_math_broadcast_template "POW+pow" "Math.pow((double)a, (double)b)" "FP"
556 
557 # Ternary operations.
558 gen_ternary_alu_op "FMA+fma" "Math.fma(a, b, c)" "FP"
559 gen_ternary_alu_op "BITWISE_BLEND+bitwiseBlend" "(a\&~(c))|(b\&c)" "BITWISE"
560 gen_ternary_alu_bcst_op "FMA" "Math.fma(a, b, c)" "FP"
561 gen_ternary_alu_bcst_op "BITWISE_BLEND+bitwiseBlend" "(a\&~(c))|(b\&c)" "BITWISE"
562 gen_ternary_alu_double_bcst_op "FMA+fma" "Math.fma(a, b, c)" "FP"
563 gen_ternary_alu_double_bcst_op "BITWISE_BLEND+bitwiseBlend" "(a\&~(c))|(b\&c)" "BITWISE"
564 
565 # Unary operations.
566 gen_unary_alu_op "NEG+neg" "-((\$type\$)a)"
567 gen_unary_alu_op "ABS+abs" "Math.abs((\$type\$)a)"
568 gen_unary_alu_op "NOT+not" "~((\$type\$)a)" "BITWISE"
569 gen_unary_alu_op "ZOMO" "(a==0?0:-1)" "BITWISE"
570 gen_unary_alu_op "SQRT+sqrt" "Math.sqrt((double)a)" "FP"
571 gen_unary_alu_op "BIT_COUNT" "\$Boxtype\$.bitCount(a)" "intOrLong"
572 gen_unary_alu_op "BIT_COUNT" "Integer.bitCount((int)a \& 0xFF)" "byte"
573 gen_unary_alu_op "BIT_COUNT" "Integer.bitCount((int)a \& 0xFFFF)" "short"
574 gen_unary_alu_op "TRAILING_ZEROS_COUNT" "TRAILING_ZEROS_COUNT_scalar(a)" "BITWISE"
575 gen_unary_alu_op "LEADING_ZEROS_COUNT" "LEADING_ZEROS_COUNT_scalar(a)" "BITWISE"
576 gen_unary_alu_op "REVERSE" "REVERSE_scalar(a)" "BITWISE"
577 gen_unary_alu_op "REVERSE_BYTES" "\$Boxtype\$.reverseBytes(a)" "intOrLong"
578 gen_unary_alu_op "REVERSE_BYTES" "\$Boxtype\$.reverseBytes(a)" "short"
579 gen_unary_alu_op "REVERSE_BYTES" "a" "byte"
580 
581 # Miscellaneous Smoke Tests
582 gen_op_tmpl $miscellaneous_template "MISC" "" ""
583 
584 gen_unit_footer $unit_output
585 
586 if [ $generate_perf_tests == true ]; then
587   gen_perf_footer $perf_output
588   gen_perf_scalar_footer $perf_scalar_output
589 fi
590 
591 rm -f templates/*.current*
< prev index next >