@@ -162,7 +162,7 @@ pub fn ignoreNonZeroSizedBitfieldTypeAlignment(target: std.Target) bool {
162
162
switch (target .cpu .arch ) {
163
163
.avr = > return true ,
164
164
.arm = > {
165
- if (std . Target . arm . featureSetHas ( target .cpu .features , .has_v7 )) {
165
+ if (target .cpu .has ( .arm , .has_v7 )) {
166
166
switch (target .os .tag ) {
167
167
.ios = > return true ,
168
168
else = > return false ,
@@ -185,7 +185,7 @@ pub fn minZeroWidthBitfieldAlignment(target: std.Target) ?u29 {
185
185
switch (target .cpu .arch ) {
186
186
.avr = > return 8 ,
187
187
.arm = > {
188
- if (std . Target . arm . featureSetHas ( target .cpu .features , .has_v7 )) {
188
+ if (target .cpu .has ( .arm , .has_v7 )) {
189
189
switch (target .os .tag ) {
190
190
.ios = > return 32 ,
191
191
else = > return null ,
@@ -203,7 +203,7 @@ pub fn unnamedFieldAffectsAlignment(target: std.Target) bool {
203
203
return true ;
204
204
},
205
205
.armeb = > {
206
- if (std . Target . arm . featureSetHas ( target .cpu .features , .has_v7 )) {
206
+ if (target .cpu .has ( .arm , .has_v7 )) {
207
207
if (std .Target .Abi .default (target .cpu .arch , target .os .tag ) == .eabi ) return true ;
208
208
}
209
209
},
@@ -230,7 +230,7 @@ pub fn defaultAlignment(target: std.Target) u29 {
230
230
switch (target .cpu .arch ) {
231
231
.avr = > return 1 ,
232
232
.arm = > if (target .abi .isAndroid () or target .os .tag == .ios ) return 16 else return 8 ,
233
- .sparc = > if (std . Target . sparc . featureSetHas ( target .cpu .features , .v9 )) return 16 else return 8 ,
233
+ .sparc = > if (target .cpu .has ( .sparc , .v9 )) return 16 else return 8 ,
234
234
.mips , .mipsel = > switch (target .abi ) {
235
235
.none , .gnuabi64 = > return 16 ,
236
236
else = > return 8 ,
@@ -268,7 +268,7 @@ pub fn systemCompiler(target: std.Target) LangOpts.Compiler {
268
268
pub fn hasFloat128 (target : std.Target ) bool {
269
269
if (target .cpu .arch .isWasm ()) return true ;
270
270
if (target .os .tag .isDarwin ()) return false ;
271
- if (target .cpu .arch .isPowerPC ()) return std . Target . powerpc . featureSetHas ( target .cpu .features , .float128 );
271
+ if (target .cpu .arch .isPowerPC ()) return target .cpu .has ( .powerpc , .float128 );
272
272
return switch (target .os .tag ) {
273
273
.dragonfly ,
274
274
.haiku ,
@@ -334,7 +334,7 @@ pub const FPSemantics = enum {
334
334
.spirv32 ,
335
335
.spirv64 ,
336
336
= > return .IEEEHalf ,
337
- .x86 , .x86_64 = > if (std . Target . x86 . featureSetHas ( target .cpu .features , .sse2 )) return .IEEEHalf ,
337
+ .x86 , .x86_64 = > if (target .cpu .has ( .x86 , .sse2 )) return .IEEEHalf ,
338
338
else = > {},
339
339
}
340
340
return null ;
@@ -399,7 +399,7 @@ pub fn defaultFpEvalMethod(target: std.Target) LangOpts.FPEvalMethod {
399
399
return .double ;
400
400
}
401
401
}
402
- if (std . Target . x86 . featureSetHas ( target .cpu .features , .sse )) {
402
+ if (target .cpu .has ( .x86 , .sse )) {
403
403
return .source ;
404
404
}
405
405
return .extended ;
@@ -765,7 +765,7 @@ test "target size/align tests" {
765
765
.specifier = .char ,
766
766
};
767
767
768
- try std .testing .expectEqual (true , std . Target . arm . featureSetHas ( comp .target .cpu .features , .has_v7 ));
768
+ try std .testing .expectEqual (true , comp .target .cpu .has ( .arm , .has_v7 ));
769
769
try std .testing .expectEqual (@as (u64 , 1 ), ct .sizeof (& comp ).? );
770
770
try std .testing .expectEqual (@as (u64 , 1 ), ct .alignof (& comp ));
771
771
try std .testing .expectEqual (true , ignoreNonZeroSizedBitfieldTypeAlignment (comp .target ));
0 commit comments