summaryrefslogtreecommitdiff
path: root/vendor/github.com/cilium/ebpf/asm/alu_string.go
blob: 72d3fe6292ea6ca8b4b8b28eade0a95e7a6af2a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Code generated by "stringer -output alu_string.go -type=Source,Endianness,ALUOp"; DO NOT EDIT.

package asm

import "strconv"

func _() {
	// An "invalid array index" compiler error signifies that the constant values have changed.
	// Re-run the stringer command to generate them again.
	var x [1]struct{}
	_ = x[InvalidSource-255]
	_ = x[ImmSource-0]
	_ = x[RegSource-8]
}

const (
	_Source_name_0 = "ImmSource"
	_Source_name_1 = "RegSource"
	_Source_name_2 = "InvalidSource"
)

func (i Source) String() string {
	switch {
	case i == 0:
		return _Source_name_0
	case i == 8:
		return _Source_name_1
	case i == 255:
		return _Source_name_2
	default:
		return "Source(" + strconv.FormatInt(int64(i), 10) + ")"
	}
}
func _() {
	// An "invalid array index" compiler error signifies that the constant values have changed.
	// Re-run the stringer command to generate them again.
	var x [1]struct{}
	_ = x[InvalidEndian-255]
	_ = x[LE-0]
	_ = x[BE-8]
}

const (
	_Endianness_name_0 = "LE"
	_Endianness_name_1 = "BE"
	_Endianness_name_2 = "InvalidEndian"
)

func (i Endianness) String() string {
	switch {
	case i == 0:
		return _Endianness_name_0
	case i == 8:
		return _Endianness_name_1
	case i == 255:
		return _Endianness_name_2
	default:
		return "Endianness(" + strconv.FormatInt(int64(i), 10) + ")"
	}
}
func _() {
	// An "invalid array index" compiler error signifies that the constant values have changed.
	// Re-run the stringer command to generate them again.
	var x [1]struct{}
	_ = x[InvalidALUOp-255]
	_ = x[Add-0]
	_ = x[Sub-16]
	_ = x[Mul-32]
	_ = x[Div-48]
	_ = x[Or-64]
	_ = x[And-80]
	_ = x[LSh-96]
	_ = x[RSh-112]
	_ = x[Neg-128]
	_ = x[Mod-144]
	_ = x[Xor-160]
	_ = x[Mov-176]
	_ = x[ArSh-192]
	_ = x[Swap-208]
}

const _ALUOp_name = "AddSubMulDivOrAndLShRShNegModXorMovArShSwapInvalidALUOp"

var _ALUOp_map = map[ALUOp]string{
	0:   _ALUOp_name[0:3],
	16:  _ALUOp_name[3:6],
	32:  _ALUOp_name[6:9],
	48:  _ALUOp_name[9:12],
	64:  _ALUOp_name[12:14],
	80:  _ALUOp_name[14:17],
	96:  _ALUOp_name[17:20],
	112: _ALUOp_name[20:23],
	128: _ALUOp_name[23:26],
	144: _ALUOp_name[26:29],
	160: _ALUOp_name[29:32],
	176: _ALUOp_name[32:35],
	192: _ALUOp_name[35:39],
	208: _ALUOp_name[39:43],
	255: _ALUOp_name[43:55],
}

func (i ALUOp) String() string {
	if str, ok := _ALUOp_map[i]; ok {
		return str
	}
	return "ALUOp(" + strconv.FormatInt(int64(i), 10) + ")"
}