zig/lib/std/target/feature/AvrFeature.zig
2020-01-19 20:53:15 -05:00

231 lines
7.5 KiB
Zig

const FeatureInfo = @import("std").target.feature.FeatureInfo;
pub const AvrFeature = enum {
Avr0,
Avr1,
Avr2,
Avr3,
Avr4,
Avr5,
Avr6,
Avr25,
Avr31,
Avr35,
Avr51,
Avrtiny,
Xmega,
Xmegau,
Addsubiw,
Break,
Des,
Eijmpcall,
Elpm,
Elpmx,
Ijmpcall,
Jmpcall,
Lpm,
Lpmx,
Movw,
Mul,
Rmw,
Spm,
Spmx,
Sram,
Special,
Smallstack,
Tinyencoding,
pub fn getInfo(self: @This()) FeatureInfo {
return feature_infos[@enumToInt(self)];
}
pub const feature_infos = [@memberCount(@This())]FeatureInfo(@This()) {
FeatureInfo(@This()).create(.Avr0, "avr0", "The device is a part of the avr0 family", "avr0"),
FeatureInfo(@This()).createWithSubfeatures(.Avr1, "avr1", "The device is a part of the avr1 family", "avr1", &[_]@This() {
.Lpm,
.Avr0,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avr2, "avr2", "The device is a part of the avr2 family", "avr2", &[_]@This() {
.Ijmpcall,
.Sram,
.Avr0,
.Addsubiw,
.Lpm,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avr3, "avr3", "The device is a part of the avr3 family", "avr3", &[_]@This() {
.Ijmpcall,
.Sram,
.Avr0,
.Jmpcall,
.Addsubiw,
.Lpm,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avr4, "avr4", "The device is a part of the avr4 family", "avr4", &[_]@This() {
.Ijmpcall,
.Movw,
.Mul,
.Sram,
.Break,
.Spm,
.Lpmx,
.Avr0,
.Addsubiw,
.Lpm,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avr5, "avr5", "The device is a part of the avr5 family", "avr5", &[_]@This() {
.Ijmpcall,
.Movw,
.Mul,
.Sram,
.Break,
.Spm,
.Lpmx,
.Avr0,
.Jmpcall,
.Addsubiw,
.Lpm,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avr6, "avr6", "The device is a part of the avr6 family", "avr6", &[_]@This() {
.Ijmpcall,
.Elpmx,
.Movw,
.Mul,
.Sram,
.Break,
.Spm,
.Elpm,
.Lpmx,
.Avr0,
.Jmpcall,
.Addsubiw,
.Lpm,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avr25, "avr25", "The device is a part of the avr25 family", "avr25", &[_]@This() {
.Ijmpcall,
.Movw,
.Sram,
.Break,
.Spm,
.Lpmx,
.Avr0,
.Addsubiw,
.Lpm,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avr31, "avr31", "The device is a part of the avr31 family", "avr31", &[_]@This() {
.Ijmpcall,
.Sram,
.Elpm,
.Avr0,
.Jmpcall,
.Addsubiw,
.Lpm,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avr35, "avr35", "The device is a part of the avr35 family", "avr35", &[_]@This() {
.Ijmpcall,
.Movw,
.Sram,
.Break,
.Spm,
.Lpmx,
.Avr0,
.Jmpcall,
.Addsubiw,
.Lpm,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avr51, "avr51", "The device is a part of the avr51 family", "avr51", &[_]@This() {
.Ijmpcall,
.Elpmx,
.Movw,
.Mul,
.Sram,
.Break,
.Spm,
.Elpm,
.Lpmx,
.Avr0,
.Jmpcall,
.Addsubiw,
.Lpm,
}),
FeatureInfo(@This()).createWithSubfeatures(.Avrtiny, "avrtiny", "The device is a part of the avrtiny family", "avrtiny", &[_]@This() {
.Break,
.Tinyencoding,
.Avr0,
.Sram,
}),
FeatureInfo(@This()).createWithSubfeatures(.Xmega, "xmega", "The device is a part of the xmega family", "xmega", &[_]@This() {
.Ijmpcall,
.Elpmx,
.Movw,
.Eijmpcall,
.Mul,
.Sram,
.Break,
.Spm,
.Elpm,
.Lpmx,
.Spmx,
.Avr0,
.Jmpcall,
.Addsubiw,
.Lpm,
.Des,
}),
FeatureInfo(@This()).createWithSubfeatures(.Xmegau, "xmegau", "The device is a part of the xmegau family", "xmegau", &[_]@This() {
.Ijmpcall,
.Elpmx,
.Movw,
.Eijmpcall,
.Mul,
.Rmw,
.Sram,
.Break,
.Spm,
.Elpm,
.Lpmx,
.Spmx,
.Avr0,
.Jmpcall,
.Addsubiw,
.Lpm,
.Des,
}),
FeatureInfo(@This()).create(.Addsubiw, "addsubiw", "Enable 16-bit register-immediate addition and subtraction instructions", "addsubiw"),
FeatureInfo(@This()).create(.Break, "break", "The device supports the `BREAK` debugging instruction", "break"),
FeatureInfo(@This()).create(.Des, "des", "The device supports the `DES k` encryption instruction", "des"),
FeatureInfo(@This()).create(.Eijmpcall, "eijmpcall", "The device supports the `EIJMP`/`EICALL` instructions", "eijmpcall"),
FeatureInfo(@This()).create(.Elpm, "elpm", "The device supports the ELPM instruction", "elpm"),
FeatureInfo(@This()).create(.Elpmx, "elpmx", "The device supports the `ELPM Rd, Z[+]` instructions", "elpmx"),
FeatureInfo(@This()).create(.Ijmpcall, "ijmpcall", "The device supports `IJMP`/`ICALL`instructions", "ijmpcall"),
FeatureInfo(@This()).create(.Jmpcall, "jmpcall", "The device supports the `JMP` and `CALL` instructions", "jmpcall"),
FeatureInfo(@This()).create(.Lpm, "lpm", "The device supports the `LPM` instruction", "lpm"),
FeatureInfo(@This()).create(.Lpmx, "lpmx", "The device supports the `LPM Rd, Z[+]` instruction", "lpmx"),
FeatureInfo(@This()).create(.Movw, "movw", "The device supports the 16-bit MOVW instruction", "movw"),
FeatureInfo(@This()).create(.Mul, "mul", "The device supports the multiplication instructions", "mul"),
FeatureInfo(@This()).create(.Rmw, "rmw", "The device supports the read-write-modify instructions: XCH, LAS, LAC, LAT", "rmw"),
FeatureInfo(@This()).create(.Spm, "spm", "The device supports the `SPM` instruction", "spm"),
FeatureInfo(@This()).create(.Spmx, "spmx", "The device supports the `SPM Z+` instruction", "spmx"),
FeatureInfo(@This()).create(.Sram, "sram", "The device has random access memory", "sram"),
FeatureInfo(@This()).createWithSubfeatures(.Special, "special", "Enable use of the entire instruction set - used for debugging", "special", &[_]@This() {
.Ijmpcall,
.Elpmx,
.Movw,
.Eijmpcall,
.Mul,
.Rmw,
.Sram,
.Break,
.Elpm,
.Spm,
.Lpmx,
.Spmx,
.Jmpcall,
.Addsubiw,
.Lpm,
.Des,
}),
FeatureInfo(@This()).create(.Smallstack, "smallstack", "The device has an 8-bit stack pointer", "smallstack"),
FeatureInfo(@This()).create(.Tinyencoding, "tinyencoding", "The device has Tiny core specific instruction encodings", "tinyencoding"),
};
};