@@ -77,6 +77,7 @@ impl Isa {
77
77
pub fn get ( target : & str ) -> Option < Isa > {
78
78
let arch = Arch :: get ( target) ?;
79
79
Some ( match arch {
80
+ Arch :: Armv4T | Arch :: Armv5TE => Isa :: A32 ,
80
81
Arch :: Armv6M => Isa :: T32 ,
81
82
Arch :: Armv7M => Isa :: T32 ,
82
83
Arch :: Armv7EM => Isa :: T32 ,
@@ -118,6 +119,10 @@ impl core::fmt::Display for Isa {
118
119
/// As defined by a particular revision of the Arm Architecture Reference Manual (ARM).
119
120
#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
120
121
pub enum Arch {
122
+ /// Armv4T (legacy, also known as ARMv4T)
123
+ Armv4T ,
124
+ /// Armv5TE (also known as ARMv5TE)
125
+ Armv5TE ,
121
126
/// Armv6-M (also known as ARMv6-M)
122
127
Armv6M ,
123
128
/// Armv7-M (also known as ARMv7-M)
@@ -141,7 +146,11 @@ pub enum Arch {
141
146
impl Arch {
142
147
/// Decode a target string
143
148
pub fn get ( target : & str ) -> Option < Arch > {
144
- if target. starts_with ( "thumbv6m-" ) {
149
+ if target. starts_with ( "armv4t-" ) {
150
+ Some ( Arch :: Armv4T )
151
+ } else if target. starts_with ( "armv5te-" ) {
152
+ Some ( Arch :: Armv5TE )
153
+ } else if target. starts_with ( "thumbv6m-" ) {
145
154
Some ( Arch :: Armv6M )
146
155
} else if target. starts_with ( "thumbv7m-" ) {
147
156
Some ( Arch :: Armv7M )
@@ -170,6 +179,7 @@ impl Arch {
170
179
Arch :: Armv6M | Arch :: Armv7M | Arch :: Armv7EM | Arch :: Armv8MBase | Arch :: Armv8MMain => {
171
180
Profile :: M
172
181
}
182
+ Arch :: Armv4T | Arch :: Armv5TE => Profile :: Legacy ,
173
183
Arch :: Armv7R | Arch :: Armv8R => Profile :: R ,
174
184
Arch :: Armv7A | Arch :: Armv8A => Profile :: A ,
175
185
}
@@ -178,6 +188,8 @@ impl Arch {
178
188
/// Get a comma-separated list of values, suitable for cfg-check
179
189
pub fn values ( ) -> String {
180
190
let string_versions: Vec < String > = [
191
+ Arch :: Armv4T ,
192
+ Arch :: Armv5TE ,
181
193
Arch :: Armv6M ,
182
194
Arch :: Armv7M ,
183
195
Arch :: Armv7EM ,
@@ -201,6 +213,8 @@ impl core::fmt::Display for Arch {
201
213
f,
202
214
"{}" ,
203
215
match self {
216
+ Arch :: Armv4T => "v4t" ,
217
+ Arch :: Armv5TE => "v5te" ,
204
218
Arch :: Armv6M => "v6-m" ,
205
219
Arch :: Armv7M => "v7-m" ,
206
220
Arch :: Armv7EM => "v7e-m" ,
@@ -224,6 +238,8 @@ pub enum Profile {
224
238
R ,
225
239
/// Applications
226
240
A ,
241
+ /// Legacy
242
+ Legacy ,
227
243
}
228
244
229
245
impl Profile {
@@ -235,7 +251,7 @@ impl Profile {
235
251
236
252
/// Get a comma-separated list of values, suitable for cfg-check
237
253
pub fn values ( ) -> String {
238
- let string_versions: Vec < String > = [ Profile :: A , Profile :: R , Profile :: M ]
254
+ let string_versions: Vec < String > = [ Profile :: A , Profile :: R , Profile :: M , Profile :: Legacy ]
239
255
. iter ( )
240
256
. map ( |i| format ! ( r#""{i}""# ) )
241
257
. collect ( ) ;
@@ -252,6 +268,7 @@ impl core::fmt::Display for Profile {
252
268
Profile :: M => "m" ,
253
269
Profile :: R => "r" ,
254
270
Profile :: A => "a" ,
271
+ Profile :: Legacy => "legacy" ,
255
272
}
256
273
)
257
274
}
0 commit comments