< prev index next > test/jdk/jdk/incubator/vector/gen-template.sh
Print this page
#!/bin/bash
#
- # Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ # Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
shift_masked_template="Shift-Masked-op"
shift_const_template="Shift-Const-op"
shift_masked_const_template="Shift-Masked-Const-op"
get_template="Get-op"
rearrange_template="Rearrange"
+ compressexpand_template="CompressExpand"
broadcast_template="Broadcast"
zero_template="Zero"
slice_template="Slice-op"
slice1_template="Slice-bop"
slice1_masked_template="Slice-Masked-bop"
s/\[\[TEST\]\]/${test}/g
"
# Guard the test if necessary
if [ "$guard" != "" ]; then
- echo -e "#if[${guard}]\n" >> $output
+ echo -e "#if[${guard}]" >> $output
fi
if [ "$test" != "" ]; then
sed -e "$sed_prog" < ${filename}.current >> $output
fi
# If we also have a dedicated function for the operation then use 2nd sed expression
sed -e "$sed_prog_2" < ${filename}.scurrent >> $output
rm -f ${filename}.scurrent
fi
fi
if [ "$guard" != "" ]; then
- echo -e "#end[${guard}]\n" >> $output
+ echo -e "#end[${guard}]" >> $output
fi
rm -f ${filename}.current
}
gen_binary_alu_op "AND+and" "a \& b" "BITWISE"
gen_binary_alu_op "AND_NOT" "a \& ~b" "BITWISE"
gen_binary_alu_op "OR+or" "a | b" "BITWISE"
# Missing: "OR_UNCHECKED"
gen_binary_alu_op "XOR" "a ^ b" "BITWISE"
+ gen_binary_alu_op "COMPRESS_BITS" "\$Boxtype\$.compress(a, b)" "intOrLong"
+ gen_binary_alu_op "EXPAND_BITS" "\$Boxtype\$.expand(a, b)" "intOrLong"
# Generate the broadcast versions
gen_binary_alu_bcst_op "add+withMask" "a + b"
gen_binary_alu_bcst_op "sub+withMask" "a - b"
gen_binary_alu_bcst_op "mul+withMask" "a \* b"
gen_binary_alu_bcst_op "div+withMask" "a \/ b" "FP"
gen_op_tmpl $blend "blend" ""
# Rearrange
gen_op_tmpl $rearrange_template "rearrange" ""
+ # Compress/Expand
+ gen_op_tmpl $compressexpand_template "compress_expand" ""
+
# Get
gen_get_op "lane" ""
# Broadcast
gen_op_tmpl $broadcast_template "broadcast" ""
gen_unary_alu_op "NEG+neg" "-((\$type\$)a)"
gen_unary_alu_op "ABS+abs" "Math.abs((\$type\$)a)"
gen_unary_alu_op "NOT+not" "~((\$type\$)a)" "BITWISE"
gen_unary_alu_op "ZOMO" "(a==0?0:-1)" "BITWISE"
gen_unary_alu_op "SQRT+sqrt" "Math.sqrt((double)a)" "FP"
+ gen_unary_alu_op "BIT_COUNT" "\$Boxtype\$.bitCount(a)" "intOrLong"
+ gen_unary_alu_op "BIT_COUNT" "Integer.bitCount((int)a \& 0xFF)" "byte"
+ gen_unary_alu_op "BIT_COUNT" "Integer.bitCount((int)a \& 0xFFFF)" "short"
+ gen_unary_alu_op "TRAILING_ZEROS_COUNT" "TRAILING_ZEROS_COUNT_scalar(a)" "BITWISE"
+ gen_unary_alu_op "LEADING_ZEROS_COUNT" "LEADING_ZEROS_COUNT_scalar(a)" "BITWISE"
+ gen_unary_alu_op "REVERSE" "REVERSE_scalar(a)" "BITWISE"
+ gen_unary_alu_op "REVERSE_BYTES" "\$Boxtype\$.reverseBytes(a)" "intOrLong"
+ gen_unary_alu_op "REVERSE_BYTES" "\$Boxtype\$.reverseBytes(a)" "short"
+ gen_unary_alu_op "REVERSE_BYTES" "a" "byte"
# Miscellaneous Smoke Tests
gen_op_tmpl $miscellaneous_template "MISC" "" ""
gen_unit_footer $unit_output
< prev index next >