// Code generated by 'go run -C $GOROOT/src/simd/archsimd/_gen/midway'; DO NOT EDIT.

//go:build goexperiment.simd && amd64

package simd

import (
	"simd/archsimd"
	"simd/internal/bridge"
)

func (x Int8s) ToArch() any

type archSimdInt8s interface {
	archsimd.Int8x16 | archsimd.Int8x32 | archsimd.Int8x64
}

func Int8sFromArch[T archSimdInt8s](x T) Int8s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Int8s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Int8x16:
		var t bridge.Int8x16 = bridge.Int8x16(a)
		return (any(t)).(Int8s)
	case archsimd.Int8x32:
		var t bridge.Int8x32 = bridge.Int8x32(a)
		return (any(t)).(Int8s)
	case archsimd.Int8x64:
		var t bridge.Int8x64 = bridge.Int8x64(a)
		return (any(t)).(Int8s)
	}
	panic("wrong type")
}

func (x Int16s) ToArch() any

type archSimdInt16s interface {
	archsimd.Int16x8 | archsimd.Int16x16 | archsimd.Int16x32
}

func Int16sFromArch[T archSimdInt16s](x T) Int16s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Int16s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Int16x8:
		var t bridge.Int16x8 = bridge.Int16x8(a)
		return (any(t)).(Int16s)
	case archsimd.Int16x16:
		var t bridge.Int16x16 = bridge.Int16x16(a)
		return (any(t)).(Int16s)
	case archsimd.Int16x32:
		var t bridge.Int16x32 = bridge.Int16x32(a)
		return (any(t)).(Int16s)
	}
	panic("wrong type")
}

func (x Int32s) ToArch() any

type archSimdInt32s interface {
	archsimd.Int32x4 | archsimd.Int32x8 | archsimd.Int32x16
}

func Int32sFromArch[T archSimdInt32s](x T) Int32s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Int32s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Int32x4:
		var t bridge.Int32x4 = bridge.Int32x4(a)
		return (any(t)).(Int32s)
	case archsimd.Int32x8:
		var t bridge.Int32x8 = bridge.Int32x8(a)
		return (any(t)).(Int32s)
	case archsimd.Int32x16:
		var t bridge.Int32x16 = bridge.Int32x16(a)
		return (any(t)).(Int32s)
	}
	panic("wrong type")
}

func (x Int64s) ToArch() any

type archSimdInt64s interface {
	archsimd.Int64x2 | archsimd.Int64x4 | archsimd.Int64x8
}

func Int64sFromArch[T archSimdInt64s](x T) Int64s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Int64s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Int64x2:
		var t bridge.Int64x2 = bridge.Int64x2(a)
		return (any(t)).(Int64s)
	case archsimd.Int64x4:
		var t bridge.Int64x4 = bridge.Int64x4(a)
		return (any(t)).(Int64s)
	case archsimd.Int64x8:
		var t bridge.Int64x8 = bridge.Int64x8(a)
		return (any(t)).(Int64s)
	}
	panic("wrong type")
}

func (x Uint8s) ToArch() any

type archSimdUint8s interface {
	archsimd.Uint8x16 | archsimd.Uint8x32 | archsimd.Uint8x64
}

func Uint8sFromArch[T archSimdUint8s](x T) Uint8s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Uint8s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Uint8x16:
		var t bridge.Uint8x16 = bridge.Uint8x16(a)
		return (any(t)).(Uint8s)
	case archsimd.Uint8x32:
		var t bridge.Uint8x32 = bridge.Uint8x32(a)
		return (any(t)).(Uint8s)
	case archsimd.Uint8x64:
		var t bridge.Uint8x64 = bridge.Uint8x64(a)
		return (any(t)).(Uint8s)
	}
	panic("wrong type")
}

func (x Uint16s) ToArch() any

type archSimdUint16s interface {
	archsimd.Uint16x8 | archsimd.Uint16x16 | archsimd.Uint16x32
}

func Uint16sFromArch[T archSimdUint16s](x T) Uint16s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Uint16s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Uint16x8:
		var t bridge.Uint16x8 = bridge.Uint16x8(a)
		return (any(t)).(Uint16s)
	case archsimd.Uint16x16:
		var t bridge.Uint16x16 = bridge.Uint16x16(a)
		return (any(t)).(Uint16s)
	case archsimd.Uint16x32:
		var t bridge.Uint16x32 = bridge.Uint16x32(a)
		return (any(t)).(Uint16s)
	}
	panic("wrong type")
}

func (x Uint32s) ToArch() any

type archSimdUint32s interface {
	archsimd.Uint32x4 | archsimd.Uint32x8 | archsimd.Uint32x16
}

func Uint32sFromArch[T archSimdUint32s](x T) Uint32s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Uint32s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Uint32x4:
		var t bridge.Uint32x4 = bridge.Uint32x4(a)
		return (any(t)).(Uint32s)
	case archsimd.Uint32x8:
		var t bridge.Uint32x8 = bridge.Uint32x8(a)
		return (any(t)).(Uint32s)
	case archsimd.Uint32x16:
		var t bridge.Uint32x16 = bridge.Uint32x16(a)
		return (any(t)).(Uint32s)
	}
	panic("wrong type")
}

func (x Uint64s) ToArch() any

type archSimdUint64s interface {
	archsimd.Uint64x2 | archsimd.Uint64x4 | archsimd.Uint64x8
}

func Uint64sFromArch[T archSimdUint64s](x T) Uint64s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Uint64s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Uint64x2:
		var t bridge.Uint64x2 = bridge.Uint64x2(a)
		return (any(t)).(Uint64s)
	case archsimd.Uint64x4:
		var t bridge.Uint64x4 = bridge.Uint64x4(a)
		return (any(t)).(Uint64s)
	case archsimd.Uint64x8:
		var t bridge.Uint64x8 = bridge.Uint64x8(a)
		return (any(t)).(Uint64s)
	}
	panic("wrong type")
}

func (x Float32s) ToArch() any

type archSimdFloat32s interface {
	archsimd.Float32x4 | archsimd.Float32x8 | archsimd.Float32x16
}

func Float32sFromArch[T archSimdFloat32s](x T) Float32s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Float32s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Float32x4:
		var t bridge.Float32x4 = bridge.Float32x4(a)
		return (any(t)).(Float32s)
	case archsimd.Float32x8:
		var t bridge.Float32x8 = bridge.Float32x8(a)
		return (any(t)).(Float32s)
	case archsimd.Float32x16:
		var t bridge.Float32x16 = bridge.Float32x16(a)
		return (any(t)).(Float32s)
	}
	panic("wrong type")
}

func (x Float64s) ToArch() any

type archSimdFloat64s interface {
	archsimd.Float64x2 | archsimd.Float64x4 | archsimd.Float64x8
}

func Float64sFromArch[T archSimdFloat64s](x T) Float64s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Float64s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Float64x2:
		var t bridge.Float64x2 = bridge.Float64x2(a)
		return (any(t)).(Float64s)
	case archsimd.Float64x4:
		var t bridge.Float64x4 = bridge.Float64x4(a)
		return (any(t)).(Float64s)
	case archsimd.Float64x8:
		var t bridge.Float64x8 = bridge.Float64x8(a)
		return (any(t)).(Float64s)
	}
	panic("wrong type")
}

func (x Mask8s) ToArch() any

type archSimdMask8s interface {
	archsimd.Mask8x16 | archsimd.Mask8x32 | archsimd.Mask8x64
}

func Mask8sFromArch[T archSimdMask8s](x T) Mask8s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Mask8s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Mask8x16:
		var t bridge.Mask8x16 = bridge.Mask8x16(a)
		return (any(t)).(Mask8s)
	case archsimd.Mask8x32:
		var t bridge.Mask8x32 = bridge.Mask8x32(a)
		return (any(t)).(Mask8s)
	case archsimd.Mask8x64:
		var t bridge.Mask8x64 = bridge.Mask8x64(a)
		return (any(t)).(Mask8s)
	}
	panic("wrong type")
}

func (x Mask16s) ToArch() any

type archSimdMask16s interface {
	archsimd.Mask16x8 | archsimd.Mask16x16 | archsimd.Mask16x32
}

func Mask16sFromArch[T archSimdMask16s](x T) Mask16s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Mask16s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Mask16x8:
		var t bridge.Mask16x8 = bridge.Mask16x8(a)
		return (any(t)).(Mask16s)
	case archsimd.Mask16x16:
		var t bridge.Mask16x16 = bridge.Mask16x16(a)
		return (any(t)).(Mask16s)
	case archsimd.Mask16x32:
		var t bridge.Mask16x32 = bridge.Mask16x32(a)
		return (any(t)).(Mask16s)
	}
	panic("wrong type")
}

func (x Mask32s) ToArch() any

type archSimdMask32s interface {
	archsimd.Mask32x4 | archsimd.Mask32x8 | archsimd.Mask32x16
}

func Mask32sFromArch[T archSimdMask32s](x T) Mask32s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Mask32s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Mask32x4:
		var t bridge.Mask32x4 = bridge.Mask32x4(a)
		return (any(t)).(Mask32s)
	case archsimd.Mask32x8:
		var t bridge.Mask32x8 = bridge.Mask32x8(a)
		return (any(t)).(Mask32s)
	case archsimd.Mask32x16:
		var t bridge.Mask32x16 = bridge.Mask32x16(a)
		return (any(t)).(Mask32s)
	}
	panic("wrong type")
}

func (x Mask64s) ToArch() any

type archSimdMask64s interface {
	archsimd.Mask64x2 | archsimd.Mask64x4 | archsimd.Mask64x8
}

func Mask64sFromArch[T archSimdMask64s](x T) Mask64s {
	switch a := any(x).(type) {
	// The return expression is written this way because the code will be rewritten
	// with Mask64s replaced by one of the arch types, and without the any-assert
	// hack the rewritten code would not pass type checking.
	// The backend of the compiler will eat this and turn it into no code at all,
	// assuming it inlines.
	case archsimd.Mask64x2:
		var t bridge.Mask64x2 = bridge.Mask64x2(a)
		return (any(t)).(Mask64s)
	case archsimd.Mask64x4:
		var t bridge.Mask64x4 = bridge.Mask64x4(a)
		return (any(t)).(Mask64s)
	case archsimd.Mask64x8:
		var t bridge.Mask64x8 = bridge.Mask64x8(a)
		return (any(t)).(Mask64s)
	}
	panic("wrong type")
}
