< prev index next >

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

Print this page
*** 1,8 ***
  #!/bin/bash
  #
! # Copyright (c) 2018, 2020, 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
--- 1,8 ---
  #!/bin/bash
  #
! # 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

*** 72,10 ***
--- 72,11 ---
  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"

*** 143,11 ***
      s/\[\[TEST\]\]/${test}/g
    "
  
    # Guard the test if necessary
    if [ "$guard" != "" ]; then
!     echo -e "#if[${guard}]\n" >> $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
--- 144,11 ---
      s/\[\[TEST\]\]/${test}/g
    "
  
    # Guard the test if necessary
    if [ "$guard" != "" ]; then
!     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

*** 164,11 ***
        sed -e "$sed_prog_2" < ${filename}.scurrent >> $output
        rm -f ${filename}.scurrent
      fi
    fi
    if [ "$guard" != "" ]; then
!     echo -e "#end[${guard}]\n" >> $output
    fi
  
    rm -f ${filename}.current
  }
  
--- 165,11 ---
        sed -e "$sed_prog_2" < ${filename}.scurrent >> $output
        rm -f ${filename}.scurrent
      fi
    fi
    if [ "$guard" != "" ]; then
!     echo -e "#end[${guard}]" >> $output
    fi
  
    rm -f ${filename}.current
  }
  

*** 408,10 ***
--- 409,12 ---
  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"

*** 506,10 ***
--- 509,13 ---
  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" ""

*** 560,10 ***
--- 566,19 ---
  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 >