| // Code generated by 'wasmgen'; DO NOT EDIT. |
| |
| package wasm |
| |
| import ( |
| "cmd/compile/internal/ssa" |
| "cmd/compile/internal/ssa/ssaop" |
| "cmd/compile/internal/ssagen" |
| "cmd/internal/obj" |
| "cmd/internal/obj/wasm" |
| ) |
| |
| func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value, extend bool) bool { |
| switch v.Op { |
| case ssaop.OpWasmF32x4ExtractLane, ssaop.OpWasmI64x2ExtractLane, ssaop.OpWasmF64x2ExtractLane: |
| getValue128(s, v.Args[0]) |
| p := s.Prog(v.Op.Asm()) |
| p.To = obj.Addr{Type: obj.TYPE_CONST, Offset: v.AuxInt} |
| case ssaop.OpWasmI8x16ExtractLaneU, ssaop.OpWasmI16x8ExtractLaneU: |
| getValue128(s, v.Args[0]) |
| p := s.Prog(v.Op.Asm()) |
| p.To = obj.Addr{Type: obj.TYPE_CONST, Offset: v.AuxInt} |
| if extend { |
| s.Prog(wasm.AI64ExtendI32U) |
| } |
| case ssaop.OpWasmI8x16ExtractLaneS, ssaop.OpWasmI16x8ExtractLaneS, ssaop.OpWasmI32x4ExtractLane: |
| getValue128(s, v.Args[0]) |
| p := s.Prog(v.Op.Asm()) |
| p.To = obj.Addr{Type: obj.TYPE_CONST, Offset: v.AuxInt} |
| if extend { |
| s.Prog(wasm.AI64ExtendI32S) |
| } |
| case ssaop.OpWasmI8x16ReplaceLane, ssaop.OpWasmI16x8ReplaceLane, ssaop.OpWasmI32x4ReplaceLane: |
| getValue128(s, v.Args[0]) |
| getValue32(s, v.Args[1]) |
| p := s.Prog(v.Op.Asm()) |
| p.To = obj.Addr{Type: obj.TYPE_CONST, Offset: v.AuxInt} |
| case ssaop.OpWasmF32x4ReplaceLane, ssaop.OpWasmI64x2ReplaceLane, ssaop.OpWasmF64x2ReplaceLane: |
| getValue128(s, v.Args[0]) |
| getValue64(s, v.Args[1]) |
| p := s.Prog(v.Op.Asm()) |
| p.To = obj.Addr{Type: obj.TYPE_CONST, Offset: v.AuxInt} |
| case ssaop.OpWasmI8x16Splat, ssaop.OpWasmI16x8Splat, ssaop.OpWasmI32x4Splat: |
| getValue32(s, v.Args[0]) |
| s.Prog(v.Op.Asm()) |
| case ssaop.OpWasmI64x2Splat: |
| getValue64(s, v.Args[0]) |
| s.Prog(v.Op.Asm()) |
| case ssaop.OpWasmF32x4Splat: |
| getValueFxx(s, v.Args[0]) |
| s.Prog(v.Op.Asm()) |
| case ssaop.OpWasmF64x2Splat: |
| getValueFxx(s, v.Args[0]) |
| s.Prog(v.Op.Asm()) |
| case ssaop.OpWasmI8x16AllTrue, ssaop.OpWasmV128AnyTrue, ssaop.OpWasmI16x8AllTrue, |
| ssaop.OpWasmI32x4AllTrue, ssaop.OpWasmI64x2AllTrue, ssaop.OpWasmI8x16Abs, |
| ssaop.OpWasmI16x8Abs, ssaop.OpWasmI32x4Abs, ssaop.OpWasmF32x4Abs, |
| ssaop.OpWasmI64x2Abs, ssaop.OpWasmF64x2Abs, ssaop.OpWasmF32x4Ceil, |
| ssaop.OpWasmF64x2Ceil, ssaop.OpWasmF64x2ConvertLowI32x4S, ssaop.OpWasmF64x2ConvertLowI32x4U, |
| ssaop.OpWasmF32x4ConvertI32x4S, ssaop.OpWasmF32x4ConvertI32x4U, ssaop.OpWasmI32x4TruncSatF32x4S, |
| ssaop.OpWasmI32x4TruncSatF32x4U, ssaop.OpWasmI64x2ExtendHighI32x4S, ssaop.OpWasmI64x2ExtendHighI32x4U, |
| ssaop.OpWasmI32x4ExtendHighI16x8S, ssaop.OpWasmI32x4ExtendHighI16x8U, ssaop.OpWasmI16x8ExtendHighI8x16S, |
| ssaop.OpWasmI16x8ExtendHighI8x16U, ssaop.OpWasmI64x2ExtendLowI32x4S, ssaop.OpWasmI64x2ExtendLowI32x4U, |
| ssaop.OpWasmI32x4ExtendLowI16x8S, ssaop.OpWasmI32x4ExtendLowI16x8U, ssaop.OpWasmI16x8ExtendLowI8x16S, |
| ssaop.OpWasmI16x8ExtendLowI8x16U, ssaop.OpWasmF32x4Floor, ssaop.OpWasmF64x2Floor, |
| ssaop.OpWasmI8x16Neg, ssaop.OpWasmI16x8Neg, ssaop.OpWasmI32x4Neg, |
| ssaop.OpWasmF32x4Neg, ssaop.OpWasmI64x2Neg, ssaop.OpWasmF64x2Neg, |
| ssaop.OpWasmV128Not, ssaop.OpWasmI8x16Popcnt, ssaop.OpWasmF32x4Nearest, |
| ssaop.OpWasmF64x2Nearest, ssaop.OpWasmF32x4Sqrt, ssaop.OpWasmF64x2Sqrt, |
| ssaop.OpWasmF32x4Trunc, ssaop.OpWasmF64x2Trunc: |
| getValue128(s, v.Args[0]) |
| s.Prog(v.Op.Asm()) |
| case ssaop.OpWasmI16x8Q15MulrSatS, ssaop.OpWasmI16x8RelaxedQ15MulrS, ssaop.OpWasmF32x4Pmax, |
| ssaop.OpWasmF32x4Pmin, ssaop.OpWasmF32x4RelaxedMax, ssaop.OpWasmF32x4RelaxedMin, |
| ssaop.OpWasmF64x2Pmax, ssaop.OpWasmF64x2Pmin, ssaop.OpWasmF64x2RelaxedMax, |
| ssaop.OpWasmF64x2RelaxedMin, ssaop.OpWasmI8x16Add, ssaop.OpWasmI16x8Add, |
| ssaop.OpWasmI32x4Add, ssaop.OpWasmF32x4Add, ssaop.OpWasmI64x2Add, |
| ssaop.OpWasmF64x2Add, ssaop.OpWasmI8x16AddSatS, ssaop.OpWasmI8x16AddSatU, |
| ssaop.OpWasmI16x8AddSatS, ssaop.OpWasmI16x8AddSatU, ssaop.OpWasmV128And, |
| ssaop.OpWasmV128Andnot, ssaop.OpWasmI8x16AvgrU, ssaop.OpWasmI16x8AvgrU, |
| ssaop.OpWasmF32x4Div, ssaop.OpWasmF64x2Div, ssaop.OpWasmI8x16Eq, |
| ssaop.OpWasmI16x8Eq, ssaop.OpWasmI32x4Eq, ssaop.OpWasmF32x4Eq, |
| ssaop.OpWasmI64x2Eq, ssaop.OpWasmF64x2Eq, ssaop.OpWasmI8x16GtS, |
| ssaop.OpWasmI8x16GtU, ssaop.OpWasmI16x8GtS, ssaop.OpWasmI16x8GtU, |
| ssaop.OpWasmI32x4GtS, ssaop.OpWasmI32x4GtU, ssaop.OpWasmF32x4Gt, |
| ssaop.OpWasmI64x2GtS, ssaop.OpWasmF64x2Gt, ssaop.OpWasmI8x16GeS, |
| ssaop.OpWasmI8x16GeU, ssaop.OpWasmI16x8GeS, ssaop.OpWasmI16x8GeU, |
| ssaop.OpWasmI32x4GeS, ssaop.OpWasmI32x4GeU, ssaop.OpWasmF32x4Ge, |
| ssaop.OpWasmI64x2GeS, ssaop.OpWasmF64x2Ge, ssaop.OpWasmI8x16LtS, |
| ssaop.OpWasmI8x16LtU, ssaop.OpWasmI16x8LtS, ssaop.OpWasmI16x8LtU, |
| ssaop.OpWasmI32x4LtS, ssaop.OpWasmI32x4LtU, ssaop.OpWasmF32x4Lt, |
| ssaop.OpWasmI64x2LtS, ssaop.OpWasmF64x2Lt, ssaop.OpWasmI8x16LeS, |
| ssaop.OpWasmI8x16LeU, ssaop.OpWasmI16x8LeS, ssaop.OpWasmI16x8LeU, |
| ssaop.OpWasmI32x4LeS, ssaop.OpWasmI32x4LeU, ssaop.OpWasmF32x4Le, |
| ssaop.OpWasmI64x2LeS, ssaop.OpWasmF64x2Le, ssaop.OpWasmI8x16Swizzle, |
| ssaop.OpWasmI8x16MaxS, ssaop.OpWasmI8x16MaxU, ssaop.OpWasmI16x8MaxS, |
| ssaop.OpWasmI16x8MaxU, ssaop.OpWasmI32x4MaxS, ssaop.OpWasmI32x4MaxU, |
| ssaop.OpWasmF32x4Max, ssaop.OpWasmF64x2Max, ssaop.OpWasmI8x16MinS, |
| ssaop.OpWasmI8x16MinU, ssaop.OpWasmI16x8MinS, ssaop.OpWasmI16x8MinU, |
| ssaop.OpWasmI32x4MinS, ssaop.OpWasmI32x4MinU, ssaop.OpWasmF32x4Min, |
| ssaop.OpWasmF64x2Min, ssaop.OpWasmI16x8Mul, ssaop.OpWasmI32x4Mul, |
| ssaop.OpWasmF32x4Mul, ssaop.OpWasmI64x2Mul, ssaop.OpWasmF64x2Mul, |
| ssaop.OpWasmI16x8ExtmulHighI8x16S, ssaop.OpWasmI16x8ExtmulHighI8x16U, ssaop.OpWasmI32x4ExtmulHighI16x8S, |
| ssaop.OpWasmI32x4ExtmulHighI16x8U, ssaop.OpWasmI64x2ExtmulHighI32x4S, ssaop.OpWasmI64x2ExtmulHighI32x4U, |
| ssaop.OpWasmI16x8ExtmulLowI8x16S, ssaop.OpWasmI16x8ExtmulLowI8x16U, ssaop.OpWasmI32x4ExtmulLowI16x8S, |
| ssaop.OpWasmI32x4ExtmulLowI16x8U, ssaop.OpWasmI64x2ExtmulLowI32x4S, ssaop.OpWasmI64x2ExtmulLowI32x4U, |
| ssaop.OpWasmI8x16Ne, ssaop.OpWasmI16x8Ne, ssaop.OpWasmI32x4Ne, |
| ssaop.OpWasmF32x4Ne, ssaop.OpWasmI64x2Ne, ssaop.OpWasmF64x2Ne, |
| ssaop.OpWasmV128Or, ssaop.OpWasmI8x16Sub, ssaop.OpWasmI16x8Sub, |
| ssaop.OpWasmI32x4Sub, ssaop.OpWasmF32x4Sub, ssaop.OpWasmI64x2Sub, |
| ssaop.OpWasmF64x2Sub, ssaop.OpWasmI8x16SubSatS, ssaop.OpWasmI8x16SubSatU, |
| ssaop.OpWasmI16x8SubSatS, ssaop.OpWasmI16x8SubSatU, ssaop.OpWasmV128Xor: |
| getValue128(s, v.Args[0]) |
| getValue128(s, v.Args[1]) |
| s.Prog(v.Op.Asm()) |
| case ssaop.OpWasmI8x16Shl, ssaop.OpWasmI16x8Shl, ssaop.OpWasmI32x4Shl, |
| ssaop.OpWasmI64x2Shl, ssaop.OpWasmI8x16ShrS, ssaop.OpWasmI8x16ShrU, |
| ssaop.OpWasmI16x8ShrS, ssaop.OpWasmI16x8ShrU, ssaop.OpWasmI32x4ShrS, |
| ssaop.OpWasmI32x4ShrU, ssaop.OpWasmI64x2ShrS, ssaop.OpWasmI64x2ShrU: |
| getValue128(s, v.Args[0]) |
| getValue32(s, v.Args[1]) |
| s.Prog(v.Op.Asm()) |
| case ssaop.OpWasmV128Bitselect: |
| getValue128(s, v.Args[0]) |
| getValue128(s, v.Args[1]) |
| getValue128(s, v.Args[2]) |
| s.Prog(v.Op.Asm()) |
| |
| default: |
| return false |
| } |
| return true |
| } |