Class SPVParsedOperand

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SPVParsedOperand extends Struct<SPVParsedOperand> implements NativeResource

 struct spv_parsed_operand_t {
     uint16_t offset;
     uint16_t num_words;
     spv_operand_type_t type;
     spv_number_kind_t number_kind;
     uint32_t number_bit_width;
     spv_fp_encoding_t fp_encoding;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • OFFSET

      public static final int OFFSET
      The struct member offsets.
    • NUM_WORDS

      public static final int NUM_WORDS
      The struct member offsets.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • NUMBER_KIND

      public static final int NUMBER_KIND
      The struct member offsets.
    • NUMBER_BIT_WIDTH

      public static final int NUMBER_BIT_WIDTH
      The struct member offsets.
    • FP_ENCODING

      public static final int FP_ENCODING
      The struct member offsets.
  • Constructor Details

    • SPVParsedOperand

      public SPVParsedOperand(ByteBuffer container)
      Creates a SPVParsedOperand instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<SPVParsedOperand>
    • offset

      public short offset()
      Returns:
      the value of the offset field.
    • num_words

      public short num_words()
      Returns:
      the value of the num_words field.
    • type

      public int type()
      Returns:
      the value of the type field.
    • number_kind

      public int number_kind()
      Returns:
      the value of the number_kind field.
    • number_bit_width

      public int number_bit_width()
      Returns:
      the value of the number_bit_width field.
    • fp_encoding

      public int fp_encoding()
      Returns:
      the value of the fp_encoding field.
    • offset

      public SPVParsedOperand offset(short value)
      Sets the specified value to the offset field.
    • num_words

      public SPVParsedOperand num_words(short value)
      Sets the specified value to the num_words field.
    • type

      public SPVParsedOperand type(int value)
      Sets the specified value to the type field.
    • number_kind

      public SPVParsedOperand number_kind(int value)
      Sets the specified value to the number_kind field.
    • number_bit_width

      public SPVParsedOperand number_bit_width(int value)
      Sets the specified value to the number_bit_width field.
    • fp_encoding

      public SPVParsedOperand fp_encoding(int value)
      Sets the specified value to the fp_encoding field.
    • set

      public SPVParsedOperand set(short offset, short num_words, int type, int number_kind, int number_bit_width, int fp_encoding)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static SPVParsedOperand malloc()
      Returns a new SPVParsedOperand instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static SPVParsedOperand calloc()
      Returns a new SPVParsedOperand instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static SPVParsedOperand create()
      Returns a new SPVParsedOperand instance allocated with BufferUtils.
    • create

      public static SPVParsedOperand create(long address)
      Returns a new SPVParsedOperand instance for the specified memory address.
    • createSafe

      public static @Nullable SPVParsedOperand createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static SPVParsedOperand.Buffer malloc(int capacity)
      Returns a new SPVParsedOperand.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static SPVParsedOperand.Buffer calloc(int capacity)
      Returns a new SPVParsedOperand.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SPVParsedOperand.Buffer create(int capacity)
      Returns a new SPVParsedOperand.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SPVParsedOperand.Buffer create(long address, int capacity)
      Create a SPVParsedOperand.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable SPVParsedOperand.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static SPVParsedOperand malloc(MemoryStack stack)
      Returns a new SPVParsedOperand instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static SPVParsedOperand calloc(MemoryStack stack)
      Returns a new SPVParsedOperand instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static SPVParsedOperand.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new SPVParsedOperand.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static SPVParsedOperand.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new SPVParsedOperand.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • noffset

      public static short noffset(long struct)
      Unsafe version of offset().
    • nnum_words

      public static short nnum_words(long struct)
      Unsafe version of num_words().
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • nnumber_kind

      public static int nnumber_kind(long struct)
      Unsafe version of number_kind().
    • nnumber_bit_width

      public static int nnumber_bit_width(long struct)
      Unsafe version of number_bit_width().
    • nfp_encoding

      public static int nfp_encoding(long struct)
      Unsafe version of fp_encoding().
    • noffset

      public static void noffset(long struct, short value)
      Unsafe version of offset.
    • nnum_words

      public static void nnum_words(long struct, short value)
      Unsafe version of num_words.
    • ntype

      public static void ntype(long struct, int value)
      Unsafe version of type.
    • nnumber_kind

      public static void nnumber_kind(long struct, int value)
      Unsafe version of number_kind.
    • nnumber_bit_width

      public static void nnumber_bit_width(long struct, int value)
      Unsafe version of number_bit_width.
    • nfp_encoding

      public static void nfp_encoding(long struct, int value)
      Unsafe version of fp_encoding.