From ace84c069558b315e140c8712669cdc3b0806f68 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 4 Nov 2019 18:54:41 +0100 Subject: synth-oper: handle constant not. --- src/synth/synth-oper.adb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb index 6634a2b2b..c394df158 100644 --- a/src/synth/synth-oper.adb +++ b/src/synth/synth-oper.adb @@ -929,10 +929,15 @@ package body Synth.Oper is case Def is when Iir_Predefined_Error => return null; - when Iir_Predefined_Ieee_1164_Scalar_Not - | Iir_Predefined_Boolean_Not - | Iir_Predefined_Bit_Not => + when Iir_Predefined_Ieee_1164_Scalar_Not => return Synth_Bit_Monadic (Id_Not); + when Iir_Predefined_Boolean_Not + | Iir_Predefined_Bit_Not => + if Is_Const (Operand) then + return Create_Value_Discrete (1 - Operand.Scal, Oper_Typ); + else + return Synth_Bit_Monadic (Id_Not); + end if; when Iir_Predefined_Ieee_1164_Vector_Not | Iir_Predefined_Ieee_Numeric_Std_Not_Uns | Iir_Predefined_Ieee_Numeric_Std_Not_Sgn => -- cgit v1.2.3