Skip to content

Commit c19504e

Browse files
znoffel1wchilders-nvidia
authored andcommitted
Add non standard EDG floating point types [GH #357]
1 parent f21b55a commit c19504e

11 files changed

Lines changed: 1046 additions & 89 deletions

‎dev_tools/pylibs/edgifc/spec_files/0.44.json‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,18 @@
351351
"0x4": "GenConstant"
352352
}
353353
},
354+
"EdgFloatType": {
355+
"size": 4,
356+
"values": {
357+
"0x0": "Float16",
358+
"0x1": "Fp16",
359+
"0x2": "Float32x",
360+
"0x3": "Float64x",
361+
"0x4": "Float80",
362+
"0x5": "Float128",
363+
"0x6": "StdBfloat16"
364+
}
365+
},
354366
"ExpansionMode": {
355367
"size": 1,
356368
"values": {
@@ -1153,7 +1165,8 @@
11531165
"bitwidth": 5,
11541166
"non_null": true,
11551167
"values": {
1156-
"0x0": "EdgTypeSubstituted"
1168+
"0x0": "EdgTypeSubstituted",
1169+
"0x1": "EdgTypeFloat"
11571170
}
11581171
},
11591172
"Expr": {
@@ -2362,6 +2375,12 @@
23622375
"initializer": "EdgTokenCacheOffset"
23632376
}
23642377
},
2378+
"EdgTypeFloat": {
2379+
"padding": 0,
2380+
"fields": {
2381+
"kind": "EdgFloatTypeSort"
2382+
}
2383+
},
23652384
"EdgTypeSubstituted": {
23662385
"padding": 0,
23672386
"fields": {
@@ -4636,6 +4655,7 @@
46364655
".edg.token.complex.textual": "EdgTokenTextual",
46374656
".edg.trait.class-template-definition": "EdgTraitClassTemplateDefinition",
46384657
".edg.trait.function-definition": "EdgTraitFunctionDefinition",
4658+
".edg.type.float": "EdgTypeFloat",
46394659
".edg.type.substitued": "EdgTypeSubstituted",
46404660
".msvc.trait.decl-attrs": "TraitMsvcDeclAttrs",
46414661
".msvc.trait.named-function-parameters": "TraitMsvcFuncParams",

‎src/ifc_map.h‎

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,21 @@ struct an_ifc_encoded_edg_extension_type_offset : Implicit_numeric_entry<
950950
}; /* an_ifc_encoded_edg_extension_type_offset */
951951

952952

953+
enum an_ifc_encoded_edg_float_type_sort_0_44 : uint32_t;
954+
using an_ifc_encoded_edg_float_type_sort_storage = uint32_t;
955+
956+
957+
/*
958+
The universal representation for an IFC EncodedEdgFloatTypeSort.
959+
*/
960+
struct an_ifc_encoded_edg_float_type_sort : Implicit_numeric_entry<
961+
an_ifc_encoded_edg_float_type_sort_storage> {
962+
using storage_type = an_ifc_encoded_edg_float_type_sort_storage;
963+
using base_type = Implicit_numeric_entry<storage_type>;
964+
using base_type::Implicit_numeric_entry;
965+
}; /* an_ifc_encoded_edg_float_type_sort */
966+
967+
953968
enum an_ifc_encoded_edg_heap_complex_token_offset_0_43 : uint32_t;
954969
using an_ifc_encoded_edg_heap_complex_token_offset_storage = uint32_t;
955970

@@ -3242,6 +3257,28 @@ enum an_ifc_edg_expr_sort : uint32_t {
32423257
}; /* an_ifc_edg_expr_sort */
32433258

32443259

3260+
enum an_ifc_edg_float_type_sort_0_44 : uint32_t {
3261+
ifc_0_44_efts_float16 = 0,
3262+
ifc_0_44_efts_fp16 = 1,
3263+
ifc_0_44_efts_float32x = 2,
3264+
ifc_0_44_efts_float64x = 3,
3265+
ifc_0_44_efts_float80 = 4,
3266+
ifc_0_44_efts_float128 = 5,
3267+
ifc_0_44_efts_std_bfloat16 = 6
3268+
}; /* an_ifc_edg_float_type_sort_0_44 */
3269+
3270+
3271+
enum an_ifc_edg_float_type_sort : uint32_t {
3272+
ifc_efts_float128,
3273+
ifc_efts_float16,
3274+
ifc_efts_float32x,
3275+
ifc_efts_float64x,
3276+
ifc_efts_float80,
3277+
ifc_efts_fp16,
3278+
ifc_efts_std_bfloat16
3279+
}; /* an_ifc_edg_float_type_sort */
3280+
3281+
32453282
enum an_ifc_edg_template_argument_sort_0_43 : uint32_t {
32463283
ifc_0_43_etas_edg_template_argument_type = 0,
32473284
ifc_0_43_etas_edg_template_argument_non_type = 1,
@@ -3261,7 +3298,14 @@ enum an_ifc_edg_type_sort_0_43 : uint32_t {
32613298
}; /* an_ifc_edg_type_sort_0_43 */
32623299

32633300

3301+
enum an_ifc_edg_type_sort_0_44 : uint32_t {
3302+
ifc_0_44_ets_edg_type_substituted = 0,
3303+
ifc_0_44_ets_edg_type_float = 1
3304+
}; /* an_ifc_edg_type_sort_0_44 */
3305+
3306+
32643307
enum an_ifc_edg_type_sort : uint32_t {
3308+
ifc_ets_edg_type_float,
32653309
ifc_ets_edg_type_substituted
32663310
}; /* an_ifc_edg_type_sort */
32673311

@@ -6011,6 +6055,7 @@ two instances are equivalent, return FALSE; otherwise return TRUE.
60116055

60126056

60136057
enum an_ifc_edg_type_index_0_43 : uint32_t {};
6058+
enum an_ifc_edg_type_index_0_44 : uint32_t {};
60146059

60156060

60166061
/*
@@ -10957,6 +11002,14 @@ struct an_ifc_edg_extension_expr :
1095711002
|-------|--------------|---------|------|
1095811003
| value | EdgTypeIndex | 0.43 | 4 |
1095911004
|-------|--------------|---------|------|
11005+
11006+
|---------------------------------------|
11007+
| EdgExtensionType - 0.44 (4 bytes) |
11008+
|-------|--------------|---------|------|
11009+
| Name | Type | Version | Size |
11010+
|-------|--------------|---------|------|
11011+
| value | EdgTypeIndex | 0.44 | 4 |
11012+
|-------|--------------|---------|------|
1096011013
*/
1096111014
enum an_ifc_edg_extension_type_part : uint8_t {};
1096211015
using an_ifc_edg_extension_type_storage = an_ifc_edg_extension_type_part[4];
@@ -11437,6 +11490,36 @@ struct an_ifc_edg_trait_function_definition :
1143711490
}; /* an_ifc_edg_trait_function_definition */
1143811491

1143911492

11493+
/*
11494+
|------------------------------------------|
11495+
| EdgTypeFloat - 0.44 (4 bytes) |
11496+
|------|------------------|---------|------|
11497+
| Name | Type | Version | Size |
11498+
|------|------------------|---------|------|
11499+
| kind | EdgFloatTypeSort | 0.44 | 4 |
11500+
|------|------------------|---------|------|
11501+
*/
11502+
enum an_ifc_edg_type_float_part : uint8_t {};
11503+
using an_ifc_edg_type_float_storage = an_ifc_edg_type_float_part[4];
11504+
#if USE_MMAP_FOR_MODULES
11505+
using an_ifc_edg_type_float_bytes = const an_ifc_edg_type_float_storage*;
11506+
#else /* !USE_MMAP_FOR_MODULES */
11507+
using an_ifc_edg_type_float_bytes = an_ifc_edg_type_float_storage;
11508+
#endif /* USE_MMAP_FOR_MODULES */
11509+
/*
11510+
The universal representation of an IFC EdgTypeFloat node.
11511+
11512+
The representation is declared as a derived struct of Byte_buffer_entry rather
11513+
than simply an alias of the instantiation to improve the debugger experience.
11514+
*/
11515+
struct an_ifc_edg_type_float :
11516+
Byte_buffer_entry<an_ifc_edg_type_float_storage> {
11517+
using storage_type = an_ifc_edg_type_float_storage;
11518+
using base_type = Byte_buffer_entry<storage_type>;
11519+
using base_type::Byte_buffer_entry;
11520+
}; /* an_ifc_edg_type_float */
11521+
11522+
1144011523
/*
1144111524
|----------------------------------------------------------------|
1144211525
| EdgTypeSubstituted - 0.43 (12 bytes) |
@@ -23163,6 +23246,7 @@ enum an_ifc_partition_kind : uint32_t {
2316323246
ifc_pk_edg_token_complex_textual,
2316423247
ifc_pk_edg_trait_class_template_definition,
2316523248
ifc_pk_edg_trait_function_definition,
23249+
ifc_pk_edg_type_float,
2316623250
ifc_pk_edg_type_substitued,
2316723251
ifc_pk_msvc_trait_decl_attrs,
2316823252
ifc_pk_msvc_trait_named_function_parameters,
@@ -23485,7 +23569,7 @@ enum an_ifc_partition_kind : uint32_t {
2348523569
}; /* an_ifc_partition_kind */
2348623570

2348723571

23488-
#define IFC_PARTITION_COUNT 337
23572+
#define IFC_PARTITION_COUNT 338
2348923573

2349023574
/*
2349123575
A method for mapping partition names to an_ifc_partition_kind values. Used
@@ -23522,6 +23606,7 @@ EXTERN an_ifc_partition_map ifc_partition_map[IFC_PARTITION_COUNT]
2352223606
{ ".edg.trait.class-template-definition",
2352323607
ifc_pk_edg_trait_class_template_definition },
2352423608
{ ".edg.trait.function-definition", ifc_pk_edg_trait_function_definition },
23609+
{ ".edg.type.float", ifc_pk_edg_type_float },
2352523610
{ ".edg.type.substitued", ifc_pk_edg_type_substitued },
2352623611
{ ".msvc.trait.decl-attrs", ifc_pk_msvc_trait_decl_attrs },
2352723612
{ ".msvc.trait.named-function-parameters",

0 commit comments

Comments
 (0)