1 /*
   2  * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef CPU_SPARC_C2_MACROASSEMBLER_SPARC_HPP
  26 #define CPU_SPARC_C2_MACROASSEMBLER_SPARC_HPP
  27 
  28 // C2_MacroAssembler contains high-level macros for C2
  29 
  30  public:
  31   // Compress char[] to byte[] by compressing 16 bytes at once. Return 0 on failure.
  32   void string_compress_16(Register src, Register dst, Register cnt, Register result,
  33                           Register tmp1, Register tmp2, Register tmp3, Register tmp4,
  34                           FloatRegister ftmp1, FloatRegister ftmp2, FloatRegister ftmp3, Label& Ldone);
  35 
  36   // Compress char[] to byte[]. Return 0 on failure.
  37   void string_compress(Register src, Register dst, Register cnt, Register tmp, Register result, Label& Ldone);
  38 
  39   // Inflate byte[] to char[] by inflating 16 bytes at once.
  40   void string_inflate_16(Register src, Register dst, Register cnt, Register tmp,
  41                          FloatRegister ftmp1, FloatRegister ftmp2, FloatRegister ftmp3, FloatRegister ftmp4, Label& Ldone);
  42 
  43   // Inflate byte[] to char[].
  44   void string_inflate(Register src, Register dst, Register cnt, Register tmp, Label& Ldone);
  45 
  46   void string_compare(Register str1, Register str2,
  47                       Register cnt1, Register cnt2,
  48                       Register tmp1, Register tmp2,
  49                       Register result, int ae);
  50 
  51   void array_equals(bool is_array_equ, Register ary1, Register ary2,
  52                     Register limit, Register tmp, Register result, bool is_byte);
  53   // test for negative bytes in input string of a given size, result 0 if none
  54   void has_negatives(Register inp, Register size, Register result,
  55                      Register t2, Register t3, Register t4,
  56                      Register t5);
  57 
  58 #endif // CPU_SPARC_C2_MACROASSEMBLER_SPARC_HPP