diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-01-12 21:04:34 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-01-13 18:57:24 +0100 |
commit | f960173971d17c338b034d84cb80a4bf437a292c (patch) | |
tree | 6f13110e5d64c16c7ec03f5cc3af0684dc943548 /src/vhdl | |
parent | 481c0b8d4a1045cbe192698055ff9d200d048079 (diff) | |
download | ghdl-f960173971d17c338b034d84cb80a4bf437a292c.tar.gz ghdl-f960173971d17c338b034d84cb80a4bf437a292c.tar.bz2 ghdl-f960173971d17c338b034d84cb80a4bf437a292c.zip |
Add 'Image and 'Value for i64.
Fix #254
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/translate/trans-chap14.adb | 27 | ||||
-rw-r--r-- | src/vhdl/translate/trans_decls.ads | 2 | ||||
-rw-r--r-- | src/vhdl/translate/translation.adb | 5 |
3 files changed, 20 insertions, 14 deletions
diff --git a/src/vhdl/translate/trans-chap14.adb b/src/vhdl/translate/trans-chap14.adb index cd1254d6f..3d0cf7d50 100644 --- a/src/vhdl/translate/trans-chap14.adb +++ b/src/vhdl/translate/trans-chap14.adb @@ -798,7 +798,7 @@ package body Trans.Chap14 is begin Res := Create_Temp (Std_String_Node); Create_Temp_Stack2_Mark; - case Pinfo.Type_Mode is + case Type_Mode_Scalar (Pinfo.Type_Mode) is when Type_Mode_B1 => Subprg := Ghdl_Image_B1; Conv := Ghdl_Bool_Type; @@ -811,6 +811,9 @@ package body Trans.Chap14 is when Type_Mode_I32 => Subprg := Ghdl_Image_I32; Conv := Ghdl_I32_Type; + when Type_Mode_I64 => + Subprg := Ghdl_Image_I64; + Conv := Ghdl_I64_Type; when Type_Mode_P32 => Subprg := Ghdl_Image_P32; Conv := Ghdl_I32_Type; @@ -820,8 +823,6 @@ package body Trans.Chap14 is when Type_Mode_F64 => Subprg := Ghdl_Image_F64; Conv := Ghdl_Real_Type; - when others => - raise Internal_Error; end case; Start_Association (Assoc, Subprg); New_Association (Assoc, @@ -831,7 +832,7 @@ package body Trans.Chap14 is New_Convert_Ov (Chap7.Translate_Expression (Get_Parameter (Attr), Prefix_Type), Conv)); - case Pinfo.Type_Mode is + case Type_Mode_Scalar (Pinfo.Type_Mode) is when Type_Mode_B1 | Type_Mode_E8 | Type_Mode_E32 @@ -840,10 +841,9 @@ package body Trans.Chap14 is New_Association (Assoc, New_Lit (Rtis.New_Rti_Address (Pinfo.Type_Rti))); when Type_Mode_I32 - | Type_Mode_F64 => + | Type_Mode_I64 + | Type_Mode_F64 => null; - when others => - raise Internal_Error; end case; New_Procedure_Call (Assoc); return New_Address (New_Obj (Res), Std_String_Ptr_Node); @@ -857,7 +857,7 @@ package body Trans.Chap14 is Subprg : O_Dnode; Assoc : O_Assoc_List; begin - case Pinfo.Type_Mode is + case Type_Mode_Scalar (Pinfo.Type_Mode) is when Type_Mode_B1 => Subprg := Ghdl_Value_B1; when Type_Mode_E8 => @@ -866,21 +866,21 @@ package body Trans.Chap14 is Subprg := Ghdl_Value_E32; when Type_Mode_I32 => Subprg := Ghdl_Value_I32; + when Type_Mode_I64 => + Subprg := Ghdl_Value_I64; when Type_Mode_P32 => Subprg := Ghdl_Value_P32; when Type_Mode_P64 => Subprg := Ghdl_Value_P64; when Type_Mode_F64 => Subprg := Ghdl_Value_F64; - when others => - raise Internal_Error; end case; Start_Association (Assoc, Subprg); New_Association (Assoc, Chap7.Translate_Expression (Get_Parameter (Attr), String_Type_Definition)); - case Pinfo.Type_Mode is + case Type_Mode_Scalar (Pinfo.Type_Mode) is when Type_Mode_B1 | Type_Mode_E8 | Type_Mode_E32 @@ -889,10 +889,9 @@ package body Trans.Chap14 is New_Association (Assoc, New_Lit (Rtis.New_Rti_Address (Pinfo.Type_Rti))); when Type_Mode_I32 - | Type_Mode_F64 => + | Type_Mode_I64 + | Type_Mode_F64 => null; - when others => - raise Internal_Error; end case; return New_Convert_Ov (New_Function_Call (Assoc), Pinfo.Ortho_Type (Mode_Value)); diff --git a/src/vhdl/translate/trans_decls.ads b/src/vhdl/translate/trans_decls.ads index 270442e75..e8039fc29 100644 --- a/src/vhdl/translate/trans_decls.ads +++ b/src/vhdl/translate/trans_decls.ads @@ -203,6 +203,7 @@ package Trans_Decls is Ghdl_Image_E8 : O_Dnode; Ghdl_Image_E32 : O_Dnode; Ghdl_Image_I32 : O_Dnode; + Ghdl_Image_I64 : O_Dnode; Ghdl_Image_P32 : O_Dnode; Ghdl_Image_P64 : O_Dnode; Ghdl_Image_F64 : O_Dnode; @@ -212,6 +213,7 @@ package Trans_Decls is Ghdl_Value_E8 : O_Dnode; Ghdl_Value_E32 : O_Dnode; Ghdl_Value_I32 : O_Dnode; + Ghdl_Value_I64 : O_Dnode; Ghdl_Value_P32 : O_Dnode; Ghdl_Value_P64 : O_Dnode; Ghdl_Value_F64 : O_Dnode; diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb index 4f87db2f8..8d8c69789 100644 --- a/src/vhdl/translate/translation.adb +++ b/src/vhdl/translate/translation.adb @@ -1129,6 +1129,11 @@ package body Translation is Create_Image_Value_Subprograms ("i32", Ghdl_I32_Type, False, Ghdl_Image_I32, Ghdl_Value_I32); + -- procedure __ghdl_image_i64 (res : std_string_ptr_node; + -- val : ghdl_i64_type); + Create_Image_Value_Subprograms + ("i64", Ghdl_I64_Type, False, Ghdl_Image_I64, Ghdl_Value_I64); + -- procedure __ghdl_image_p32 (res : std_string_ptr_node; -- val : ghdl_i32_type; -- rti : ghdl_rti_access); |