diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-07 17:41:00 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-11 06:37:26 +0200 |
commit | 2b3a1bb316317453d4e40bc3a650b4ed07eee7a8 (patch) | |
tree | 2d4446502e2ab262c6a3fcf03b2d912bfad2944d /src/vhdl | |
parent | 89969411e5d6ecb5efd89172a9462a92878f093b (diff) | |
download | ghdl-2b3a1bb316317453d4e40bc3a650b4ed07eee7a8.tar.gz ghdl-2b3a1bb316317453d4e40bc3a650b4ed07eee7a8.tar.bz2 ghdl-2b3a1bb316317453d4e40bc3a650b4ed07eee7a8.zip |
vhdl: recognize numeric_std shift_left.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/vhdl-ieee-numeric.adb | 19 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.ads | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-ieee-numeric.adb b/src/vhdl/vhdl-ieee-numeric.adb index 4d5c0d5e3..500c0a260 100644 --- a/src/vhdl/vhdl-ieee-numeric.adb +++ b/src/vhdl/vhdl-ieee-numeric.adb @@ -477,6 +477,8 @@ package body Vhdl.Ieee.Numeric is Set_Implicit_Definition (Decl, Predefined); end Handle_Std_Match; + + Res : Iir_Predefined_Functions; begin Decl := Get_Declaration_Chain (Pkg_Decl); @@ -589,6 +591,23 @@ package body Vhdl.Ieee.Numeric is Handle_Resize; when Name_Std_Match => Handle_Std_Match; + when Name_Shift_Left => + if Arg1_Kind = Arg_Vect + and then Arg2_Kind = Arg_Scal + and then Arg2_Sign = Type_Unsigned + then + case Arg1_Sign is + when Type_Signed => + Res := + Iir_Predefined_Ieee_Numeric_Std_Shl_Sgn_Nat; + when Type_Unsigned => + Res := + Iir_Predefined_Ieee_Numeric_Std_Shl_Uns_Nat; + when others => + Res := Iir_Predefined_None; + end case; + Set_Implicit_Definition (Decl, Res); + end if; when others => null; end case; diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads index 93407a5df..de1df09e9 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -4992,6 +4992,11 @@ package Vhdl.Nodes is Iir_Predefined_Ieee_Numeric_Std_Ne_Sgn_Int, Iir_Predefined_Ieee_Numeric_Std_Ne_Int_Sgn, + Iir_Predefined_Ieee_Numeric_Std_Shl_Uns_Nat, + Iir_Predefined_Ieee_Numeric_Std_Shr_Uns_Nat, + Iir_Predefined_Ieee_Numeric_Std_Shl_Sgn_Nat, + Iir_Predefined_Ieee_Numeric_Std_Shr_Sgn_Nat, + Iir_Predefined_Ieee_Numeric_Std_Not_Uns, Iir_Predefined_Ieee_Numeric_Std_Not_Sgn, |