@@ -171,8 +171,10 @@ pub struct TargetDataLayout {
171171 pub i32_align : AbiAndPrefAlign ,
172172 pub i64_align : AbiAndPrefAlign ,
173173 pub i128_align : AbiAndPrefAlign ,
174+ pub f16_align : AbiAndPrefAlign ,
174175 pub f32_align : AbiAndPrefAlign ,
175176 pub f64_align : AbiAndPrefAlign ,
177+ pub f128_align : AbiAndPrefAlign ,
176178 pub pointer_size : Size ,
177179 pub pointer_align : AbiAndPrefAlign ,
178180 pub aggregate_align : AbiAndPrefAlign ,
@@ -200,8 +202,10 @@ impl Default for TargetDataLayout {
200202 i32_align : AbiAndPrefAlign :: new ( align ( 32 ) ) ,
201203 i64_align : AbiAndPrefAlign { abi : align ( 32 ) , pref : align ( 64 ) } ,
202204 i128_align : AbiAndPrefAlign { abi : align ( 32 ) , pref : align ( 64 ) } ,
205+ f16_align : AbiAndPrefAlign :: new ( align ( 16 ) ) ,
203206 f32_align : AbiAndPrefAlign :: new ( align ( 32 ) ) ,
204207 f64_align : AbiAndPrefAlign :: new ( align ( 64 ) ) ,
208+ f128_align : AbiAndPrefAlign :: new ( align ( 128 ) ) ,
205209 pointer_size : Size :: from_bits ( 64 ) ,
206210 pointer_align : AbiAndPrefAlign :: new ( align ( 64 ) ) ,
207211 aggregate_align : AbiAndPrefAlign { abi : align ( 0 ) , pref : align ( 64 ) } ,
@@ -281,8 +285,10 @@ impl TargetDataLayout {
281285 dl. instruction_address_space = parse_address_space ( & p[ 1 ..] , "P" ) ?
282286 }
283287 [ "a" , ref a @ ..] => dl. aggregate_align = parse_align ( a, "a" ) ?,
288+ [ "f16" , ref a @ ..] => dl. f16_align = parse_align ( a, "f16" ) ?,
284289 [ "f32" , ref a @ ..] => dl. f32_align = parse_align ( a, "f32" ) ?,
285290 [ "f64" , ref a @ ..] => dl. f64_align = parse_align ( a, "f64" ) ?,
291+ [ "f128" , ref a @ ..] => dl. f128_align = parse_align ( a, "f128" ) ?,
286292 // FIXME(erikdesjardins): we should be parsing nonzero address spaces
287293 // this will require replacing TargetDataLayout::{pointer_size,pointer_align}
288294 // with e.g. `fn pointer_size_in(AddressSpace)`
@@ -919,8 +925,10 @@ pub enum Primitive {
919925 /// a negative integer passed by zero-extension will appear positive in
920926 /// the callee, and most operations on it will produce the wrong values.
921927 Int ( Integer , bool ) ,
928+ F16 ,
922929 F32 ,
923930 F64 ,
931+ F128 ,
924932 Pointer ( AddressSpace ) ,
925933}
926934
@@ -931,8 +939,10 @@ impl Primitive {
931939
932940 match self {
933941 Int ( i, _) => i. size ( ) ,
942+ F16 => Size :: from_bits ( 16 ) ,
934943 F32 => Size :: from_bits ( 32 ) ,
935944 F64 => Size :: from_bits ( 64 ) ,
945+ F128 => Size :: from_bits ( 128 ) ,
936946 // FIXME(erikdesjardins): ignoring address space is technically wrong, pointers in
937947 // different address spaces can have different sizes
938948 // (but TargetDataLayout doesn't currently parse that part of the DL string)
@@ -946,8 +956,10 @@ impl Primitive {
946956
947957 match self {
948958 Int ( i, _) => i. align ( dl) ,
959+ F16 => dl. f16_align ,
949960 F32 => dl. f32_align ,
950961 F64 => dl. f64_align ,
962+ F128 => dl. f128_align ,
951963 // FIXME(erikdesjardins): ignoring address space is technically wrong, pointers in
952964 // different address spaces can have different alignments
953965 // (but TargetDataLayout doesn't currently parse that part of the DL string)
0 commit comments