1
2
3
4
5 package main
6
7 import (
8 "bytes"
9 "simd/archsimd/_gen/sgutil"
10 )
11
12
13
14
15 func writeSIMDGenericOps(ops []Operation, genericOpsFilePath string) *bytes.Buffer {
16
17 currentArch := CurrentArch().Arch
18 var newOps []sgutil.GenericOpsData
19 for _, op := range ops {
20 if op.NoGenericOps != nil && *op.NoGenericOps == "true" {
21 continue
22 }
23 if op.SkipMaskedMethod() {
24 continue
25 }
26 _, _, _, immType, gOp, _ := op.shape()
27
28 newOps = append(newOps, sgutil.GenericOpsData{
29 OpName: gOp.GenericName(),
30 OpInLen: len(gOp.In),
31 Comm: op.Commutative,
32 HasAux: immType == VarImm || immType == VarImmLim || immType == ConstVarImm,
33 Archs: []string{currentArch},
34 })
35 }
36
37 buf := sgutil.MergeSIMDGenericOps(newOps, genericOpsFilePath, currentArch)
38
39 return buf
40 }
41
View as plain text