< prev index next >

src/hotspot/share/prims/vectorSupport.hpp

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_PRIMS_VECTORSUPPORT_HPP
  26 #define SHARE_PRIMS_VECTORSUPPORT_HPP
  27 
  28 #include "jni.h"
  29 #include "code/debugInfo.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "oops/typeArrayOop.inline.hpp"
  32 #include "runtime/frame.inline.hpp"
  33 #include "runtime/registerMap.hpp"
  34 #include "utilities/exceptions.hpp"
  35 
  36 extern "C" {
  37   void JNICALL JVM_RegisterVectorSupportMethods(JNIEnv* env, jclass vsclass);
  38 }
  39 
  40 class VectorSupport : AllStatic {








  41  public:
  42 
  43    // Should be aligned with constants in jdk.internal.vm.vector.VectorSupport
  44   enum VectorOperation {
  45     // Unary
  46     VECTOR_OP_ABS     = 0,
  47     VECTOR_OP_NEG     = 1,
  48     VECTOR_OP_SQRT    = 2,
  49     VECTOR_OP_NOT     = 3,
  50 
  51     // Binary
  52     VECTOR_OP_ADD     = 4,
  53     VECTOR_OP_SUB     = 5,
  54     VECTOR_OP_MUL     = 6,
  55     VECTOR_OP_DIV     = 7,
  56     VECTOR_OP_MIN     = 8,
  57     VECTOR_OP_MAX     = 9,
  58     VECTOR_OP_AND     = 10,
  59     VECTOR_OP_OR      = 11,
  60     VECTOR_OP_XOR     = 12,
  61 
  62     // Ternary
  63     VECTOR_OP_FMA     = 13,
  64 
  65     // Broadcast int
  66     VECTOR_OP_LSHIFT  = 14,
  67     VECTOR_OP_RSHIFT  = 15,
  68     VECTOR_OP_URSHIFT = 16,
  69 
  70     // Convert
  71     VECTOR_OP_CAST        = 17,
  72     VECTOR_OP_REINTERPRET = 18
  73   };
  74 
  75   static int vop2ideal(jint vop, BasicType bt);
  76 


  77   static bool is_vector(Klass* klass);
  78   static bool is_vector_mask(Klass* klass);
  79   static bool is_vector_shuffle(Klass* klass);
  80 };
  81 #endif // SHARE_PRIMS_VECTORSUPPORT_HPP


  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_PRIMS_VECTORSUPPORT_HPP
  26 #define SHARE_PRIMS_VECTORSUPPORT_HPP
  27 
  28 #include "jni.h"
  29 #include "code/debugInfo.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "oops/typeArrayOop.inline.hpp"
  32 #include "runtime/frame.inline.hpp"
  33 #include "runtime/registerMap.hpp"
  34 #include "utilities/exceptions.hpp"
  35 
  36 extern "C" {
  37   void JNICALL JVM_RegisterVectorSupportMethods(JNIEnv* env, jclass vsclass);
  38 }
  39 
  40 class VectorSupport : AllStatic {
  41  private:
  42   static void init_mask_array(typeArrayOop arr, BasicType elem_bt, int num_elem, address value_addr);
  43   static void init_vector_array(typeArrayOop arr, BasicType elem_bt, int num_elem, address value_addr);
  44   static oop  allocate_vector_payload_helper(InstanceKlass* ik, BasicType elem_bt, int num_elem, address value_addr, TRAPS);
  45 
  46   static BasicType klass2bt(InstanceKlass* ik);
  47   static jint klass2length(InstanceKlass* ik);
  48 
  49  public:
  50 
  51    // Should be aligned with constants in jdk.internal.vm.vector.VectorSupport
  52   enum VectorOperation {
  53     // Unary
  54     VECTOR_OP_ABS     = 0,
  55     VECTOR_OP_NEG     = 1,
  56     VECTOR_OP_SQRT    = 2,
  57     VECTOR_OP_NOT     = 3,
  58 
  59     // Binary
  60     VECTOR_OP_ADD     = 4,
  61     VECTOR_OP_SUB     = 5,
  62     VECTOR_OP_MUL     = 6,
  63     VECTOR_OP_DIV     = 7,
  64     VECTOR_OP_MIN     = 8,
  65     VECTOR_OP_MAX     = 9,
  66     VECTOR_OP_AND     = 10,
  67     VECTOR_OP_OR      = 11,
  68     VECTOR_OP_XOR     = 12,
  69 
  70     // Ternary
  71     VECTOR_OP_FMA     = 13,
  72 
  73     // Broadcast int
  74     VECTOR_OP_LSHIFT  = 14,
  75     VECTOR_OP_RSHIFT  = 15,
  76     VECTOR_OP_URSHIFT = 16,
  77 
  78     // Convert
  79     VECTOR_OP_CAST        = 17,
  80     VECTOR_OP_REINTERPRET = 18
  81   };
  82 
  83   static int vop2ideal(jint vop, BasicType bt);
  84 
  85   static oop  allocate_vector(InstanceKlass* holder, frame* fr, RegisterMap* reg_map, ObjectValue* sv, TRAPS);
  86 
  87   static bool is_vector(Klass* klass);
  88   static bool is_vector_mask(Klass* klass);
  89   static bool is_vector_shuffle(Klass* klass);
  90 };
  91 #endif // SHARE_PRIMS_VECTORSUPPORT_HPP
< prev index next >