...

Text file src/simd/archsimd/_gen/midway/comments.yaml

Documentation: simd/archsimd/_gen/midway

     1# Common methods shared across various SIMD types
     2.common_methods: &common_methods
     3  Abs: "Abs returns the element-wise absolute value of x."
     4  Add: "Add returns the element-wise sum of x and y."
     5  AddSaturated: "AddSaturated returns the element-wise saturated sum of x and y."
     6  And: "And returns the bitwise AND of x and y."
     7  AndNot: "AndNot returns the bitwise AND NOT of x and y."
     8  Average: "Average returns the element-wise average of x and y."
     9  Div: "Div returns the element-wise quotient of x and y."
    10  Equal: "Equal returns a mask indicating where x and y are equal."
    11  Greater: "Greater returns a mask indicating where x is greater than y."
    12  GreaterEqual: "GreaterEqual returns a mask indicating where x is greater than or equal to y."
    13  Len: "Len returns the number of elements in the vector."
    14  Less: "Less returns a mask indicating where x is less than y."
    15  LessEqual: "LessEqual returns a mask indicating where x is less than or equal to y."
    16  Masked: "Masked returns a new vector with elements from x where mask is true, and zero elsewhere."
    17  Max: "Max returns the element-wise maximum of x and y."
    18  IfElse: "IfElse returns a new vector with elements from x where mask is true, and y where mask is false."
    19  Min: "Min returns the element-wise minimum of x and y."
    20  Mul: "Mul returns the element-wise product of x and y."
    21  MulAdd: "MulAdd returns x * y + z element-wise."
    22  Neg: "Neg returns the element-wise negation of x."
    23  Not: "Not returns the bitwise NOT of x."
    24  NotEqual: "NotEqual returns a mask indicating where x and y are not equal."
    25  Or: "Or returns the bitwise OR of x and y."
    26  RotateAllLeft: "RotatesAllLeft rotates all elements left by y bits."
    27  RotateAllRight: "RotatesAllRight rotates all elements right by y bits."
    28  ShiftAllLeft: "ShiftAllLeft shifts all elements left by y bits."
    29  ShiftAllRight: "ShiftAllRight shifts all elements right by y bits."
    30  Sqrt: "Sqrt returns the element-wise square root of x."
    31  Store: "Store stores the vector elements into the slice s."
    32  StorePart: "StorePart stores a partial vector into the slice s and returns the number actually stored."
    33  String: "String returns a string representation of the vector."
    34  Sub: "Sub returns the element-wise difference of x and y."
    35  SubSaturated: "SubSaturated returns the element-wise saturated difference of x and y."
    36  ToMask: "ToMask returns a mask representation of the vector."
    37  Xor: "Xor returns the bitwise XOR of x and y."
    38
    39  # Conversions
    40  ConvertToFloat32: "ConvertToFloat32 converts the vector elements to float32."
    41  ConvertToInt32: "ConvertToInt32 converts the vector elements to int32."
    42  ConvertToUint8: "ConvertToUint8 converts the vector elements to uint8."
    43  ConvertToUint16: "ConvertToUint16 converts the vector elements to uint16."
    44  ConvertToUint32: "ConvertToUint32 converts the vector elements to uint32."
    45  ConvertToUint64: "ConvertToUint64 converts the vector elements to uint64."
    46  ConvertToInt8: "ConvertToInt8 converts the vector elements to int8."
    47  ConvertToInt16: "ConvertToInt16 converts the vector elements to int16."
    48  ConvertToInt64: "ConvertToInt64 converts the vector elements to int64."
    49  ToBits: "ToBits reinterprets the vector bits as an unsigned integer vector."
    50  BitsToInt8: "BitsToInt8 reinterprets the vector bits as an Int8s vector."
    51  BitsToInt16: "BitsToInt16 reinterprets the vector bits as an Int16s vector."
    52  BitsToInt32: "BitsToInt32 reinterprets the vector bits as an Int32s vector."
    53  BitsToInt64: "BitsToInt64 reinterprets the vector bits as an Int64s vector."
    54  BitsToFloat32: "BitsToFloat32 reinterprets the vector bits as a Float32s vector."
    55  BitsToFloat64: "BitsToFloat64 reinterprets the vector bits as a Float64s vector."
    56  ReshapeToUint8s: "ReshapeToUint8s reinterprets the vector bits as a Uint8s vector."
    57  ReshapeToUint16s: "ReshapeToUint16s reinterprets the vector bits as a Uint16s vector."
    58  ReshapeToUint32s: "ReshapeToUint32s reinterprets the vector bits as a Uint32s vector."
    59  ReshapeToUint64s: "ReshapeToUint64s reinterprets the vector bits as a Uint64s vector."
    60
    61  # Mask specific conversions
    62  ToInt8s: "ToInt8s converts the mask to an Int8s vector."
    63  ToInt16s: "ToInt16s converts the mask to an Int16s vector."
    64  ToInt32s: "ToInt32s converts the mask to an Int32s vector."
    65  ToInt64s: "ToInt64s converts the mask to an Int64s vector."
    66
    67  CarrylessMultiplyEven: |-
    68    CarrylessMultiplyOdd computes the carryless
    69    // multiplications of selected even indexed elements of x and y.
    70    // Each product is 128 bits wide and fills the corresponding
    71    // even-odd pairs in the result.
    72    //
    73    // A carryless multiplication uses bitwise XOR instead of
    74    // add-with-carry, for example (in base two):
    75    //
    76    //  11 * 11 = 11 * (10 ^ 1) = (11 * 10) ^ (11 * 1) = 110 ^ 11 = 101
    77    //
    78    // This also models multiplication of polynomials with coefficients
    79    // from GF(2) -- 11 * 11 models (x+1)*(x+1) = x**2 + (1^1)x + 1 =
    80    // x**2 + 0x + 1 = x**2 + 1 modeled by 101.  (Note that "+" adds
    81    // polynomial terms, but coefficients "add" with XOR.)"
    82
    83  CarrylessMultiplyOdd: |-
    84    CarrylessMultiplyOdd computes the carryless
    85    // multiplications of selected odd indexed elements of x and y.
    86    // Each product is 128 bits wide and fills the corresponding
    87    // even-odd pairs in the result.
    88    //
    89    // A carryless multiplication uses bitwise XOR instead of
    90    // add-with-carry, for example (in base two):
    91    //
    92    //  11 * 11 = 11 * (10 ^ 1) = (11 * 10) ^ (11 * 1) = 110 ^ 11 = 101
    93    //
    94    // This also models multiplication of polynomials with coefficients
    95    // from GF(2) -- 11 * 11 models (x+1)*(x+1) = x**2 + (1^1)x + 1 =
    96    // x**2 + 0x + 1 = x**2 + 1 modeled by 101.  (Note that "+" adds
    97    // polynomial terms, but coefficients "add" with XOR.)"
    98
    99types:
   100  _simd: "internal SIMD marker."
   101  Int8s: "Int8s represents a vector of 8-bit signed integers."
   102  Int16s: "Int16s represents a vector of 16-bit signed integers."
   103  Int32s: "Int32s represents a vector of 32-bit signed integers."
   104  Int64s: "Int64s represents a vector of 64-bit signed integers."
   105  Uint8s: "Uint8s represents a vector of 8-bit unsigned integers."
   106  Uint16s: "Uint16s represents a vector of 16-bit unsigned integers."
   107  Uint32s: "Uint32s represents a vector of 32-bit unsigned integers."
   108  Uint64s: "Uint64s represents a vector of 64-bit unsigned integers."
   109  Float32s: "Float32s represents a vector of 32-bit floating-point numbers."
   110  Float64s: "Float64s represents a vector of 64-bit floating-point numbers."
   111  Mask8s: "Mask8s represents a boolean mask for Int8s/Uint8s vectors."
   112  Mask16s: "Mask16s represents a boolean mask for Int16s/Uint16s vectors."
   113  Mask32s: "Mask32s represents a boolean mask for Int32s/Uint32s vectors."
   114  Mask64s: "Mask64s represents a boolean mask for Int64s/Uint64s vectors."
   115
   116functions:
   117  VectorSize: "VectorSize returns the size of the largest SIMD vector supported by the current CPU."
   118  # Templates for Load functions
   119  default_LoadSlice: "Load%s loads a slice of %s into an %ss vector."
   120  default_LoadPart: "Load%sPart loads a partial slice of %s into an %ss vector, returning the vector and the number of elements loaded."
   121  default_Broadcast: "Broadcast%s fills the elements of a slice with its argument value."
   122
   123methods:
   124  Int8s:
   125    <<: *common_methods
   126  Int16s:
   127    <<: *common_methods
   128  Int32s:
   129    <<: *common_methods
   130  Int64s:
   131    <<: *common_methods
   132  Uint8s:
   133    <<: *common_methods
   134  Uint16s:
   135    <<: *common_methods
   136  Uint32s:
   137    <<: *common_methods
   138  Uint64s:
   139    <<: *common_methods
   140  Float32s:
   141    <<: *common_methods
   142  Float64s:
   143    <<: *common_methods
   144  Mask8s:
   145    <<: *common_methods
   146  Mask16s:
   147    <<: *common_methods
   148  Mask32s:
   149    <<: *common_methods
   150  Mask64s:
   151    <<: *common_methods

View as plain text