@@ -171,8 +171,10 @@ pub struct TargetDataLayout {
171
171
pub i32_align : AbiAndPrefAlign ,
172
172
pub i64_align : AbiAndPrefAlign ,
173
173
pub i128_align : AbiAndPrefAlign ,
174
+ pub f16_align : AbiAndPrefAlign ,
174
175
pub f32_align : AbiAndPrefAlign ,
175
176
pub f64_align : AbiAndPrefAlign ,
177
+ pub f128_align : AbiAndPrefAlign ,
176
178
pub pointer_size : Size ,
177
179
pub pointer_align : AbiAndPrefAlign ,
178
180
pub aggregate_align : AbiAndPrefAlign ,
@@ -200,8 +202,10 @@ impl Default for TargetDataLayout {
200
202
i32_align : AbiAndPrefAlign :: new ( align ( 32 ) ) ,
201
203
i64_align : AbiAndPrefAlign { abi : align ( 32 ) , pref : align ( 64 ) } ,
202
204
i128_align : AbiAndPrefAlign { abi : align ( 32 ) , pref : align ( 64 ) } ,
205
+ f16_align : AbiAndPrefAlign :: new ( align ( 16 ) ) ,
203
206
f32_align : AbiAndPrefAlign :: new ( align ( 32 ) ) ,
204
207
f64_align : AbiAndPrefAlign :: new ( align ( 64 ) ) ,
208
+ f128_align : AbiAndPrefAlign :: new ( align ( 128 ) ) ,
205
209
pointer_size : Size :: from_bits ( 64 ) ,
206
210
pointer_align : AbiAndPrefAlign :: new ( align ( 64 ) ) ,
207
211
aggregate_align : AbiAndPrefAlign { abi : align ( 0 ) , pref : align ( 64 ) } ,
@@ -281,8 +285,10 @@ impl TargetDataLayout {
281
285
dl. instruction_address_space = parse_address_space ( & p[ 1 ..] , "P" ) ?
282
286
}
283
287
[ "a" , ref a @ ..] => dl. aggregate_align = parse_align ( a, "a" ) ?,
288
+ [ "f16" , ref a @ ..] => dl. f16_align = parse_align ( a, "f16" ) ?,
284
289
[ "f32" , ref a @ ..] => dl. f32_align = parse_align ( a, "f32" ) ?,
285
290
[ "f64" , ref a @ ..] => dl. f64_align = parse_align ( a, "f64" ) ?,
291
+ [ "f128" , ref a @ ..] => dl. f128_align = parse_align ( a, "f128" ) ?,
286
292
// FIXME(erikdesjardins): we should be parsing nonzero address spaces
287
293
// this will require replacing TargetDataLayout::{pointer_size,pointer_align}
288
294
// with e.g. `fn pointer_size_in(AddressSpace)`
@@ -919,8 +925,10 @@ pub enum Primitive {
919
925
/// a negative integer passed by zero-extension will appear positive in
920
926
/// the callee, and most operations on it will produce the wrong values.
921
927
Int ( Integer , bool ) ,
928
+ F16 ,
922
929
F32 ,
923
930
F64 ,
931
+ F128 ,
924
932
Pointer ( AddressSpace ) ,
925
933
}
926
934
@@ -931,8 +939,10 @@ impl Primitive {
931
939
932
940
match self {
933
941
Int ( i, _) => i. size ( ) ,
942
+ F16 => Size :: from_bits ( 16 ) ,
934
943
F32 => Size :: from_bits ( 32 ) ,
935
944
F64 => Size :: from_bits ( 64 ) ,
945
+ F128 => Size :: from_bits ( 128 ) ,
936
946
// FIXME(erikdesjardins): ignoring address space is technically wrong, pointers in
937
947
// different address spaces can have different sizes
938
948
// (but TargetDataLayout doesn't currently parse that part of the DL string)
@@ -946,8 +956,10 @@ impl Primitive {
946
956
947
957
match self {
948
958
Int ( i, _) => i. align ( dl) ,
959
+ F16 => dl. f16_align ,
949
960
F32 => dl. f32_align ,
950
961
F64 => dl. f64_align ,
962
+ F128 => dl. f128_align ,
951
963
// FIXME(erikdesjardins): ignoring address space is technically wrong, pointers in
952
964
// different address spaces can have different alignments
953
965
// (but TargetDataLayout doesn't currently parse that part of the DL string)
0 commit comments