@@ -77,6 +77,7 @@ impl Isa {
7777 pub fn get ( target : & str ) -> Option < Isa > {
7878 let arch = Arch :: get ( target) ?;
7979 Some ( match arch {
80+ Arch :: Armv4T | Arch :: Armv5TE => Isa :: A32 ,
8081 Arch :: Armv6M => Isa :: T32 ,
8182 Arch :: Armv7M => Isa :: T32 ,
8283 Arch :: Armv7EM => Isa :: T32 ,
@@ -118,6 +119,10 @@ impl core::fmt::Display for Isa {
118119/// As defined by a particular revision of the Arm Architecture Reference Manual (ARM).
119120#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
120121pub enum Arch {
122+ /// Armv4T (legacy, also known as ARMv4T)
123+ Armv4T ,
124+ /// Armv5TE (also known as ARMv5TE)
125+ Armv5TE ,
121126 /// Armv6-M (also known as ARMv6-M)
122127 Armv6M ,
123128 /// Armv7-M (also known as ARMv7-M)
@@ -141,7 +146,11 @@ pub enum Arch {
141146impl Arch {
142147 /// Decode a target string
143148 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-" ) {
145154 Some ( Arch :: Armv6M )
146155 } else if target. starts_with ( "thumbv7m-" ) {
147156 Some ( Arch :: Armv7M )
@@ -170,6 +179,7 @@ impl Arch {
170179 Arch :: Armv6M | Arch :: Armv7M | Arch :: Armv7EM | Arch :: Armv8MBase | Arch :: Armv8MMain => {
171180 Profile :: M
172181 }
182+ Arch :: Armv4T | Arch :: Armv5TE => Profile :: Legacy ,
173183 Arch :: Armv7R | Arch :: Armv8R => Profile :: R ,
174184 Arch :: Armv7A | Arch :: Armv8A => Profile :: A ,
175185 }
@@ -178,6 +188,8 @@ impl Arch {
178188 /// Get a comma-separated list of values, suitable for cfg-check
179189 pub fn values ( ) -> String {
180190 let string_versions: Vec < String > = [
191+ Arch :: Armv4T ,
192+ Arch :: Armv5TE ,
181193 Arch :: Armv6M ,
182194 Arch :: Armv7M ,
183195 Arch :: Armv7EM ,
@@ -201,6 +213,8 @@ impl core::fmt::Display for Arch {
201213 f,
202214 "{}" ,
203215 match self {
216+ Arch :: Armv4T => "v4t" ,
217+ Arch :: Armv5TE => "v5te" ,
204218 Arch :: Armv6M => "v6-m" ,
205219 Arch :: Armv7M => "v7-m" ,
206220 Arch :: Armv7EM => "v7e-m" ,
@@ -224,6 +238,8 @@ pub enum Profile {
224238 R ,
225239 /// Applications
226240 A ,
241+ /// Legacy
242+ Legacy ,
227243}
228244
229245impl Profile {
@@ -235,7 +251,7 @@ impl Profile {
235251
236252 /// Get a comma-separated list of values, suitable for cfg-check
237253 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 ]
239255 . iter ( )
240256 . map ( |i| format ! ( r#""{i}""# ) )
241257 . collect ( ) ;
@@ -252,6 +268,7 @@ impl core::fmt::Display for Profile {
252268 Profile :: M => "m" ,
253269 Profile :: R => "r" ,
254270 Profile :: A => "a" ,
271+ Profile :: Legacy => "legacy" ,
255272 }
256273 )
257274 }
0 commit comments