Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Constant

all_features

Public Constant
std.Target.avr.all_features
pub const all_features = blk:

File

Target/avr.zig:54
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
pub const all_features = blk: {
    const len = @typeInfo(Feature).@"enum".field_names.len;
    std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
    var result: [len]CpuFeature = undefined;
    result[@backingInt(Feature.addsubiw)] = .{
        .llvm_name = "addsubiw",
        .description = "Enable 16-bit register-immediate addition and subtraction instructions",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.avr0)] = .{
        .llvm_name = "avr0",
        .description = "The device is a part of the avr0 family",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.avr1)] = .{
        .llvm_name = "avr1",
        .description = "The device is a part of the avr1 family",
        .dependencies = featureSet(&[_]Feature{
            .avr0,
            .lpm,
            .memmappedregs,
        }),
    };
    result[@backingInt(Feature.avr2)] = .{
        .llvm_name = "avr2",
        .description = "The device is a part of the avr2 family",
        .dependencies = featureSet(&[_]Feature{
            .addsubiw,
            .avr1,
            .ijmpcall,
            .sram,
        }),
    };
    result[@backingInt(Feature.avr25)] = .{
        .llvm_name = "avr25",
        .description = "The device is a part of the avr25 family",
        .dependencies = featureSet(&[_]Feature{
            .avr2,
            .@"break",
            .lpmx,
            .movw,
            .spm,
        }),
    };
    result[@backingInt(Feature.avr3)] = .{
        .llvm_name = "avr3",
        .description = "The device is a part of the avr3 family",
        .dependencies = featureSet(&[_]Feature{
            .avr2,
            .jmpcall,
        }),
    };
    result[@backingInt(Feature.avr31)] = .{
        .llvm_name = "avr31",
        .description = "The device is a part of the avr31 family",
        .dependencies = featureSet(&[_]Feature{
            .avr3,
            .elpm,
        }),
    };
    result[@backingInt(Feature.avr35)] = .{
        .llvm_name = "avr35",
        .description = "The device is a part of the avr35 family",
        .dependencies = featureSet(&[_]Feature{
            .avr3,
            .@"break",
            .lpmx,
            .movw,
            .spm,
        }),
    };
    result[@backingInt(Feature.avr4)] = .{
        .llvm_name = "avr4",
        .description = "The device is a part of the avr4 family",
        .dependencies = featureSet(&[_]Feature{
            .avr2,
            .@"break",
            .lpmx,
            .movw,
            .mul,
            .spm,
        }),
    };
    result[@backingInt(Feature.avr5)] = .{
        .llvm_name = "avr5",
        .description = "The device is a part of the avr5 family",
        .dependencies = featureSet(&[_]Feature{
            .avr3,
            .@"break",
            .lpmx,
            .movw,
            .mul,
            .spm,
        }),
    };
    result[@backingInt(Feature.avr51)] = .{
        .llvm_name = "avr51",
        .description = "The device is a part of the avr51 family",
        .dependencies = featureSet(&[_]Feature{
            .avr5,
            .elpm,
            .elpmx,
        }),
    };
    result[@backingInt(Feature.avr6)] = .{
        .llvm_name = "avr6",
        .description = "The device is a part of the avr6 family",
        .dependencies = featureSet(&[_]Feature{
            .avr51,
            .eijmpcall,
        }),
    };
    result[@backingInt(Feature.avrtiny)] = .{
        .llvm_name = "avrtiny",
        .description = "The device is a part of the avrtiny family",
        .dependencies = featureSet(&[_]Feature{
            .avr0,
            .@"break",
            .smallstack,
            .sram,
            .tinyencoding,
        }),
    };
    result[@backingInt(Feature.@"break")] = .{
        .llvm_name = "break",
        .description = "The device supports the `BREAK` debugging instruction",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.des)] = .{
        .llvm_name = "des",
        .description = "The device supports the `DES k` encryption instruction",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.eijmpcall)] = .{
        .llvm_name = "eijmpcall",
        .description = "The device supports the `EIJMP`/`EICALL` instructions",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.elpm)] = .{
        .llvm_name = "elpm",
        .description = "The device supports the ELPM instruction",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.elpmx)] = .{
        .llvm_name = "elpmx",
        .description = "The device supports the `ELPM Rd, Z[+]` instructions",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.ijmpcall)] = .{
        .llvm_name = "ijmpcall",
        .description = "The device supports `IJMP`/`ICALL`instructions",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.jmpcall)] = .{
        .llvm_name = "jmpcall",
        .description = "The device supports the `JMP` and `CALL` instructions",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.lowbytefirst)] = .{
        .llvm_name = "lowbytefirst",
        .description = "Do the low byte first when writing a 16-bit port or storing a 16-bit word",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.lpm)] = .{
        .llvm_name = "lpm",
        .description = "The device supports the `LPM` instruction",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.lpmx)] = .{
        .llvm_name = "lpmx",
        .description = "The device supports the `LPM Rd, Z[+]` instruction",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.memmappedregs)] = .{
        .llvm_name = "memmappedregs",
        .description = "The device has CPU registers mapped in data address space",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.movw)] = .{
        .llvm_name = "movw",
        .description = "The device supports the 16-bit MOVW instruction",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.mul)] = .{
        .llvm_name = "mul",
        .description = "The device supports the multiplication instructions",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.rmw)] = .{
        .llvm_name = "rmw",
        .description = "The device supports the read-write-modify instructions: XCH, LAS, LAC, LAT",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.smallstack)] = .{
        .llvm_name = "smallstack",
        .description = "The device has an 8-bit stack pointer",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.special)] = .{
        .llvm_name = "special",
        .description = "Enable use of the entire instruction set - used for debugging",
        .dependencies = featureSet(&[_]Feature{
            .addsubiw,
            .@"break",
            .des,
            .eijmpcall,
            .elpm,
            .elpmx,
            .ijmpcall,
            .jmpcall,
            .lpm,
            .lpmx,
            .memmappedregs,
            .movw,
            .mul,
            .rmw,
            .spm,
            .spmx,
            .sram,
        }),
    };
    result[@backingInt(Feature.spm)] = .{
        .llvm_name = "spm",
        .description = "The device supports the `SPM` instruction",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.spmx)] = .{
        .llvm_name = "spmx",
        .description = "The device supports the `SPM Z+` instruction",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.sram)] = .{
        .llvm_name = "sram",
        .description = "The device has random access memory",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.tinyencoding)] = .{
        .llvm_name = "tinyencoding",
        .description = "The device has Tiny core specific instruction encodings",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.wrappingrjmp)] = .{
        .llvm_name = "wrappingrjmp",
        .description = "The device potentially requires emitting rjmp that wraps across the flash boundary",
        .dependencies = featureSet(&[_]Feature{}),
    };
    result[@backingInt(Feature.xmega)] = .{
        .llvm_name = "xmega",
        .description = "The device is a part of the xmega family",
        .dependencies = featureSet(&[_]Feature{
            .addsubiw,
            .avr0,
            .@"break",
            .des,
            .eijmpcall,
            .elpm,
            .elpmx,
            .ijmpcall,
            .jmpcall,
            .lowbytefirst,
            .lpm,
            .lpmx,
            .movw,
            .mul,
            .spm,
            .spmx,
            .sram,
        }),
    };
    result[@backingInt(Feature.xmega2)] = .{
        .llvm_name = "xmega2",
        .description = "The device is a part of the xmega2 family",
        .dependencies = featureSet(&[_]Feature{
            .addsubiw,
            .avr0,
            .@"break",
            .ijmpcall,
            .jmpcall,
            .lowbytefirst,
            .lpm,
            .lpmx,
            .movw,
            .mul,
            .spm,
            .spmx,
            .sram,
        }),
    };
    result[@backingInt(Feature.xmega3)] = .{
        .llvm_name = "xmega3",
        .description = "The device is a part of the xmega3 family",
        .dependencies = featureSet(&[_]Feature{
            .addsubiw,
            .avr0,
            .@"break",
            .ijmpcall,
            .jmpcall,
            .lowbytefirst,
            .lpm,
            .lpmx,
            .movw,
            .mul,
            .sram,
        }),
    };
    result[@backingInt(Feature.xmega4)] = .{
        .llvm_name = "xmega4",
        .description = "The device is a part of the xmega4 family",
        .dependencies = featureSet(&[_]Feature{
            .addsubiw,
            .avr0,
            .@"break",
            .elpm,
            .elpmx,
            .ijmpcall,
            .jmpcall,
            .lowbytefirst,
            .lpm,
            .lpmx,
            .movw,
            .mul,
            .spm,
            .spmx,
            .sram,
        }),
    };
    result[@backingInt(Feature.xmegau)] = .{
        .llvm_name = "xmegau",
        .description = "The device is a part of the xmegau family",
        .dependencies = featureSet(&[_]Feature{
            .rmw,
            .xmega,
        }),
    };
    const ti = @typeInfo(Feature);
    for (&result, 0..) |*elem, i| {
        elem.index = i;
        elem.name = ti.@"enum".field_names[i];
    }
    break :blk result;
}