Source file src/simd/archsimd/types_wasm.go

     1  // Code generated by 'wasmgen'; DO NOT EDIT.
     2  
     3  //go:build goexperiment.simd && wasm
     4  
     5  package archsimd
     6  
     7  // v128 is a tag type that tells the compiler that this is really 128-bit SIMD
     8  type v128 struct {
     9  	_128 [0]func() // uncomparable
    10  }
    11  
    12  // Int8x16 is a 128-bit SIMD vector of 16 int8s.
    13  type Int8x16 struct {
    14  	int8x16 v128
    15  	vals    [16]int8
    16  }
    17  
    18  // Len returns the number of elements in an Int8x16.
    19  func (x Int8x16) Len() int { return 16 }
    20  
    21  // LoadInt8x16Array loads an Int8x16 from a [16]int8.
    22  //
    23  //go:noescape
    24  func LoadInt8x16Array(y *[16]int8) Int8x16
    25  
    26  // LoadInt8x16 loads an Int8x16 from a slice of at least 16 int8s.
    27  func LoadInt8x16(s []int8) Int8x16 {
    28  	return LoadInt8x16Array((*[16]int8)(s))
    29  }
    30  
    31  // StoreArray stores an Int8x16 to a [16]int8.
    32  //
    33  //go:noescape
    34  func (x Int8x16) StoreArray(y *[16]int8)
    35  
    36  // Store stores x into a slice of at least 16 int8s.
    37  func (x Int8x16) Store(s []int8) {
    38  	x.StoreArray((*[16]int8)(s))
    39  }
    40  
    41  // BroadcastInt8x16 broadcasts an int8 to all elements of an Int8x16 vector.
    42  func BroadcastInt8x16(x int8) Int8x16
    43  
    44  // Int16x8 is a 128-bit SIMD vector of 8 int16s.
    45  type Int16x8 struct {
    46  	int16x8 v128
    47  	vals    [8]int16
    48  }
    49  
    50  // Len returns the number of elements in an Int16x8.
    51  func (x Int16x8) Len() int { return 8 }
    52  
    53  // LoadInt16x8Array loads an Int16x8 from a [8]int16.
    54  //
    55  //go:noescape
    56  func LoadInt16x8Array(y *[8]int16) Int16x8
    57  
    58  // LoadInt16x8 loads an Int16x8 from a slice of at least 8 int16s.
    59  func LoadInt16x8(s []int16) Int16x8 {
    60  	return LoadInt16x8Array((*[8]int16)(s))
    61  }
    62  
    63  // StoreArray stores an Int16x8 to a [8]int16.
    64  //
    65  //go:noescape
    66  func (x Int16x8) StoreArray(y *[8]int16)
    67  
    68  // Store stores x into a slice of at least 8 int16s.
    69  func (x Int16x8) Store(s []int16) {
    70  	x.StoreArray((*[8]int16)(s))
    71  }
    72  
    73  // BroadcastInt16x8 broadcasts an int16 to all elements of an Int16x8 vector.
    74  func BroadcastInt16x8(x int16) Int16x8
    75  
    76  // Int32x4 is a 128-bit SIMD vector of 4 int32s.
    77  type Int32x4 struct {
    78  	int32x4 v128
    79  	vals    [4]int32
    80  }
    81  
    82  // Len returns the number of elements in an Int32x4.
    83  func (x Int32x4) Len() int { return 4 }
    84  
    85  // LoadInt32x4Array loads an Int32x4 from a [4]int32.
    86  //
    87  //go:noescape
    88  func LoadInt32x4Array(y *[4]int32) Int32x4
    89  
    90  // LoadInt32x4 loads an Int32x4 from a slice of at least 4 int32s.
    91  func LoadInt32x4(s []int32) Int32x4 {
    92  	return LoadInt32x4Array((*[4]int32)(s))
    93  }
    94  
    95  // StoreArray stores an Int32x4 to a [4]int32.
    96  //
    97  //go:noescape
    98  func (x Int32x4) StoreArray(y *[4]int32)
    99  
   100  // Store stores x into a slice of at least 4 int32s.
   101  func (x Int32x4) Store(s []int32) {
   102  	x.StoreArray((*[4]int32)(s))
   103  }
   104  
   105  // BroadcastInt32x4 broadcasts an int32 to all elements of an Int32x4 vector.
   106  func BroadcastInt32x4(x int32) Int32x4
   107  
   108  // Int64x2 is a 128-bit SIMD vector of 2 int64s.
   109  type Int64x2 struct {
   110  	int64x2 v128
   111  	vals    [2]int64
   112  }
   113  
   114  // Len returns the number of elements in an Int64x2.
   115  func (x Int64x2) Len() int { return 2 }
   116  
   117  // LoadInt64x2Array loads an Int64x2 from a [2]int64.
   118  //
   119  //go:noescape
   120  func LoadInt64x2Array(y *[2]int64) Int64x2
   121  
   122  // LoadInt64x2 loads an Int64x2 from a slice of at least 2 int64s.
   123  func LoadInt64x2(s []int64) Int64x2 {
   124  	return LoadInt64x2Array((*[2]int64)(s))
   125  }
   126  
   127  // StoreArray stores an Int64x2 to a [2]int64.
   128  //
   129  //go:noescape
   130  func (x Int64x2) StoreArray(y *[2]int64)
   131  
   132  // Store stores x into a slice of at least 2 int64s.
   133  func (x Int64x2) Store(s []int64) {
   134  	x.StoreArray((*[2]int64)(s))
   135  }
   136  
   137  // BroadcastInt64x2 broadcasts an int64 to all elements of an Int64x2 vector.
   138  func BroadcastInt64x2(x int64) Int64x2
   139  
   140  // Uint8x16 is a 128-bit SIMD vector of 16 uint8s.
   141  type Uint8x16 struct {
   142  	uint8x16 v128
   143  	vals     [16]uint8
   144  }
   145  
   146  // Len returns the number of elements in a Uint8x16.
   147  func (x Uint8x16) Len() int { return 16 }
   148  
   149  // LoadUint8x16Array loads a Uint8x16 from a [16]uint8.
   150  //
   151  //go:noescape
   152  func LoadUint8x16Array(y *[16]uint8) Uint8x16
   153  
   154  // LoadUint8x16 loads a Uint8x16 from a slice of at least 16 uint8s.
   155  func LoadUint8x16(s []uint8) Uint8x16 {
   156  	return LoadUint8x16Array((*[16]uint8)(s))
   157  }
   158  
   159  // StoreArray stores a Uint8x16 to a [16]uint8.
   160  //
   161  //go:noescape
   162  func (x Uint8x16) StoreArray(y *[16]uint8)
   163  
   164  // Store stores x into a slice of at least 16 uint8s.
   165  func (x Uint8x16) Store(s []uint8) {
   166  	x.StoreArray((*[16]uint8)(s))
   167  }
   168  
   169  // BroadcastUint8x16 broadcasts a uint8 to all elements of a Uint8x16 vector.
   170  func BroadcastUint8x16(x uint8) Uint8x16
   171  
   172  // Uint16x8 is a 128-bit SIMD vector of 8 uint16s.
   173  type Uint16x8 struct {
   174  	uint16x8 v128
   175  	vals     [8]uint16
   176  }
   177  
   178  // Len returns the number of elements in a Uint16x8.
   179  func (x Uint16x8) Len() int { return 8 }
   180  
   181  // LoadUint16x8Array loads a Uint16x8 from a [8]uint16.
   182  //
   183  //go:noescape
   184  func LoadUint16x8Array(y *[8]uint16) Uint16x8
   185  
   186  // LoadUint16x8 loads a Uint16x8 from a slice of at least 8 uint16s.
   187  func LoadUint16x8(s []uint16) Uint16x8 {
   188  	return LoadUint16x8Array((*[8]uint16)(s))
   189  }
   190  
   191  // StoreArray stores a Uint16x8 to a [8]uint16.
   192  //
   193  //go:noescape
   194  func (x Uint16x8) StoreArray(y *[8]uint16)
   195  
   196  // Store stores x into a slice of at least 8 uint16s.
   197  func (x Uint16x8) Store(s []uint16) {
   198  	x.StoreArray((*[8]uint16)(s))
   199  }
   200  
   201  // BroadcastUint16x8 broadcasts a uint16 to all elements of a Uint16x8 vector.
   202  func BroadcastUint16x8(x uint16) Uint16x8
   203  
   204  // Uint32x4 is a 128-bit SIMD vector of 4 uint32s.
   205  type Uint32x4 struct {
   206  	uint32x4 v128
   207  	vals     [4]uint32
   208  }
   209  
   210  // Len returns the number of elements in a Uint32x4.
   211  func (x Uint32x4) Len() int { return 4 }
   212  
   213  // LoadUint32x4Array loads a Uint32x4 from a [4]uint32.
   214  //
   215  //go:noescape
   216  func LoadUint32x4Array(y *[4]uint32) Uint32x4
   217  
   218  // LoadUint32x4 loads a Uint32x4 from a slice of at least 4 uint32s.
   219  func LoadUint32x4(s []uint32) Uint32x4 {
   220  	return LoadUint32x4Array((*[4]uint32)(s))
   221  }
   222  
   223  // StoreArray stores a Uint32x4 to a [4]uint32.
   224  //
   225  //go:noescape
   226  func (x Uint32x4) StoreArray(y *[4]uint32)
   227  
   228  // Store stores x into a slice of at least 4 uint32s.
   229  func (x Uint32x4) Store(s []uint32) {
   230  	x.StoreArray((*[4]uint32)(s))
   231  }
   232  
   233  // BroadcastUint32x4 broadcasts a uint32 to all elements of a Uint32x4 vector.
   234  func BroadcastUint32x4(x uint32) Uint32x4
   235  
   236  // Uint64x2 is a 128-bit SIMD vector of 2 uint64s.
   237  type Uint64x2 struct {
   238  	uint64x2 v128
   239  	vals     [2]uint64
   240  }
   241  
   242  // Len returns the number of elements in a Uint64x2.
   243  func (x Uint64x2) Len() int { return 2 }
   244  
   245  // LoadUint64x2Array loads a Uint64x2 from a [2]uint64.
   246  //
   247  //go:noescape
   248  func LoadUint64x2Array(y *[2]uint64) Uint64x2
   249  
   250  // LoadUint64x2 loads a Uint64x2 from a slice of at least 2 uint64s.
   251  func LoadUint64x2(s []uint64) Uint64x2 {
   252  	return LoadUint64x2Array((*[2]uint64)(s))
   253  }
   254  
   255  // StoreArray stores a Uint64x2 to a [2]uint64.
   256  //
   257  //go:noescape
   258  func (x Uint64x2) StoreArray(y *[2]uint64)
   259  
   260  // Store stores x into a slice of at least 2 uint64s.
   261  func (x Uint64x2) Store(s []uint64) {
   262  	x.StoreArray((*[2]uint64)(s))
   263  }
   264  
   265  // BroadcastUint64x2 broadcasts a uint64 to all elements of a Uint64x2 vector.
   266  func BroadcastUint64x2(x uint64) Uint64x2
   267  
   268  // Float32x4 is a 128-bit SIMD vector of 4 float32s.
   269  type Float32x4 struct {
   270  	float32x4 v128
   271  	vals      [4]float32
   272  }
   273  
   274  // Len returns the number of elements in a Float32x4.
   275  func (x Float32x4) Len() int { return 4 }
   276  
   277  // LoadFloat32x4Array loads a Float32x4 from a [4]float32.
   278  //
   279  //go:noescape
   280  func LoadFloat32x4Array(y *[4]float32) Float32x4
   281  
   282  // LoadFloat32x4 loads a Float32x4 from a slice of at least 4 float32s.
   283  func LoadFloat32x4(s []float32) Float32x4 {
   284  	return LoadFloat32x4Array((*[4]float32)(s))
   285  }
   286  
   287  // StoreArray stores a Float32x4 to a [4]float32.
   288  //
   289  //go:noescape
   290  func (x Float32x4) StoreArray(y *[4]float32)
   291  
   292  // Store stores x into a slice of at least 4 float32s.
   293  func (x Float32x4) Store(s []float32) {
   294  	x.StoreArray((*[4]float32)(s))
   295  }
   296  
   297  // BroadcastFloat32x4 broadcasts a float32 to all elements of a Float32x4 vector.
   298  func BroadcastFloat32x4(x float32) Float32x4
   299  
   300  // Float64x2 is a 128-bit SIMD vector of 2 float64s.
   301  type Float64x2 struct {
   302  	float64x2 v128
   303  	vals      [2]float64
   304  }
   305  
   306  // Len returns the number of elements in a Float64x2.
   307  func (x Float64x2) Len() int { return 2 }
   308  
   309  // LoadFloat64x2Array loads a Float64x2 from a [2]float64.
   310  //
   311  //go:noescape
   312  func LoadFloat64x2Array(y *[2]float64) Float64x2
   313  
   314  // LoadFloat64x2 loads a Float64x2 from a slice of at least 2 float64s.
   315  func LoadFloat64x2(s []float64) Float64x2 {
   316  	return LoadFloat64x2Array((*[2]float64)(s))
   317  }
   318  
   319  // StoreArray stores a Float64x2 to a [2]float64.
   320  //
   321  //go:noescape
   322  func (x Float64x2) StoreArray(y *[2]float64)
   323  
   324  // Store stores x into a slice of at least 2 float64s.
   325  func (x Float64x2) Store(s []float64) {
   326  	x.StoreArray((*[2]float64)(s))
   327  }
   328  
   329  // BroadcastFloat64x2 broadcasts a float64 to all elements of a Float64x2 vector.
   330  func BroadcastFloat64x2(x float64) Float64x2
   331  
   332  // Mask8x16 is a 128-bit SIMD mask of 16 int8s.
   333  type Mask8x16 struct {
   334  	int8x16 v128
   335  	vals    [16]int8
   336  }
   337  
   338  // Mask16x8 is a 128-bit SIMD mask of 8 int16s.
   339  type Mask16x8 struct {
   340  	int16x8 v128
   341  	vals    [8]int16
   342  }
   343  
   344  // Mask32x4 is a 128-bit SIMD mask of 4 int32s.
   345  type Mask32x4 struct {
   346  	int32x4 v128
   347  	vals    [4]int32
   348  }
   349  
   350  // Mask64x2 is a 128-bit SIMD mask of 2 int64s.
   351  type Mask64x2 struct {
   352  	int64x2 v128
   353  	vals    [2]int64
   354  }
   355  

View as plain text