Source file src/simd/archsimd/other_gen_wasm.go

     1  // Code generated by 'tmplgen'; DO NOT EDIT.
     2  
     3  //go:build goexperiment.simd
     4  
     5  package archsimd
     6  
     7  // HiToLo returns a vector whose low half is the high half of x and whose high
     8  // half is zero.
     9  //
    10  //	z = {x[n/2], x[n/2+1], ..., x[n-1], 0, ..., 0}, where n = 16
    11  func (x Int8x16) HiToLo() (z Int8x16) {
    12  	var v Int8x16
    13  	return v.ToBits().ReshapeToUint64s().BitsToFloat64().SetElem(0, x.ToBits().ReshapeToUint64s().BitsToFloat64().GetElem(1)).ToBits().ReshapeToUint8s().BitsToInt8()
    14  }
    15  
    16  // HiToLo returns a vector whose low half is the high half of x and whose high
    17  // half is zero.
    18  //
    19  //	z = {x[n/2], x[n/2+1], ..., x[n-1], 0, ..., 0}, where n = 8
    20  func (x Int16x8) HiToLo() (z Int16x8) {
    21  	var v Int16x8
    22  	return v.ToBits().ReshapeToUint64s().BitsToFloat64().SetElem(0, x.ToBits().ReshapeToUint64s().BitsToFloat64().GetElem(1)).ToBits().ReshapeToUint16s().BitsToInt16()
    23  }
    24  
    25  // HiToLo returns a vector whose low half is the high half of x and whose high
    26  // half is zero.
    27  //
    28  //	z = {x[2], x[3], 0, 0}
    29  func (x Int32x4) HiToLo() (z Int32x4) {
    30  	var v Int32x4
    31  	return v.ToBits().ReshapeToUint64s().BitsToFloat64().SetElem(0, x.ToBits().ReshapeToUint64s().BitsToFloat64().GetElem(1)).ToBits().ReshapeToUint32s().BitsToInt32()
    32  }
    33  
    34  // HiToLo returns a vector whose low half is the high half of x and whose high
    35  // half is zero.
    36  //
    37  //	z = {x[1], 0}
    38  func (x Int64x2) HiToLo() (z Int64x2) {
    39  	var v Int64x2
    40  	return v.ToBits().BitsToFloat64().SetElem(0, x.ToBits().BitsToFloat64().GetElem(1)).ToBits().BitsToInt64()
    41  }
    42  
    43  // HiToLo returns a vector whose low half is the high half of x and whose high
    44  // half is zero.
    45  //
    46  //	z = {x[n/2], x[n/2+1], ..., x[n-1], 0, ..., 0}, where n = 16
    47  func (x Uint8x16) HiToLo() (z Uint8x16) {
    48  	var v Uint8x16
    49  	return v.ReshapeToUint64s().BitsToFloat64().SetElem(0, x.ReshapeToUint64s().BitsToFloat64().GetElem(1)).ToBits().ReshapeToUint8s()
    50  }
    51  
    52  // HiToLo returns a vector whose low half is the high half of x and whose high
    53  // half is zero.
    54  //
    55  //	z = {x[n/2], x[n/2+1], ..., x[n-1], 0, ..., 0}, where n = 8
    56  func (x Uint16x8) HiToLo() (z Uint16x8) {
    57  	var v Uint16x8
    58  	return v.ReshapeToUint64s().BitsToFloat64().SetElem(0, x.ReshapeToUint64s().BitsToFloat64().GetElem(1)).ToBits().ReshapeToUint16s()
    59  }
    60  
    61  // HiToLo returns a vector whose low half is the high half of x and whose high
    62  // half is zero.
    63  //
    64  //	z = {x[2], x[3], 0, 0}
    65  func (x Uint32x4) HiToLo() (z Uint32x4) {
    66  	var v Uint32x4
    67  	return v.ReshapeToUint64s().BitsToFloat64().SetElem(0, x.ReshapeToUint64s().BitsToFloat64().GetElem(1)).ToBits().ReshapeToUint32s()
    68  }
    69  
    70  // HiToLo returns a vector whose low half is the high half of x and whose high
    71  // half is zero.
    72  //
    73  //	z = {x[1], 0}
    74  func (x Uint64x2) HiToLo() (z Uint64x2) {
    75  	var v Uint64x2
    76  	return v.BitsToFloat64().SetElem(0, x.BitsToFloat64().GetElem(1)).ToBits()
    77  }
    78  
    79  // HiToLo returns a vector whose low half is the high half of x and whose high
    80  // half is zero.
    81  //
    82  //	z = {x[2], x[3], 0, 0}
    83  func (x Float32x4) HiToLo() (z Float32x4) {
    84  	var v Float32x4
    85  	return v.ToBits().ReshapeToUint64s().BitsToFloat64().SetElem(0, x.ToBits().ReshapeToUint64s().BitsToFloat64().GetElem(1)).ToBits().ReshapeToUint32s().BitsToFloat32()
    86  }
    87  
    88  // HiToLo returns a vector whose low half is the high half of x and whose high
    89  // half is zero.
    90  //
    91  //	z = {x[1], 0}
    92  func (x Float64x2) HiToLo() (z Float64x2) {
    93  	var v Float64x2
    94  	return v.SetElem(0, x.GetElem(1))
    95  }
    96  

View as plain text