decode2: Reduce metavalue warnings
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 12 Aug 2022 09:46:45 +0000 (19:46 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 12 Aug 2022 10:22:33 +0000 (20:22 +1000)
Explicitly check for undefined values and propagate them.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
decode2.vhdl

index 98557f9618059d458c220a54720139e39c66489a..f58bd9b77e3602897dd9e9ed00dc941f069447d8 100644 (file)
@@ -434,27 +434,37 @@ begin
                         v.input_ov := '1';      -- need SO state if setting OV to 0
                     end if;
                 when OP_MFSPR =>
-                    case decode_spr_num(d_in.insn) is
-                        when SPR_XER =>
-                            v.input_ov := '1';
-                        when SPR_DAR | SPR_DSISR | SPR_PID | SPR_PTCR =>
-                            unit := LDST;
-                        when others =>
-                    end case;
+                    if is_X(d_in.insn) then
+                        v.input_ov := 'X';
+                    else
+                        case decode_spr_num(d_in.insn) is
+                            when SPR_XER =>
+                                v.input_ov := '1';
+                            when SPR_DAR | SPR_DSISR | SPR_PID | SPR_PTCR =>
+                                unit := LDST;
+                            when others =>
+                        end case;
+                    end if;
                 when OP_MTSPR =>
-                    case decode_spr_num(d_in.insn) is
-                        when SPR_XER =>
-                            v.e.output_xer := '1';
-                            v.output_ov := '1';
-                        when SPR_DAR | SPR_DSISR | SPR_PID | SPR_PTCR =>
-                            unit := LDST;
-                            if d_in.valid = '1' then
-                                v.sgl_pipe := '1';
-                            end if;
-                        when others =>
-                    end case;
-                    if d_in.spr_info.valid = '1' and d_in.valid = '1' then
-                        v.sgl_pipe := '1';
+                    if is_X(d_in.insn) then
+                        v.e.output_xer := 'X';
+                        v.output_ov := 'X';
+                        v.sgl_pipe := 'X';
+                    else
+                        case decode_spr_num(d_in.insn) is
+                            when SPR_XER =>
+                                v.e.output_xer := '1';
+                                v.output_ov := '1';
+                            when SPR_DAR | SPR_DSISR | SPR_PID | SPR_PTCR =>
+                                unit := LDST;
+                                if d_in.valid = '1' then
+                                    v.sgl_pipe := '1';
+                                end if;
+                            when others =>
+                        end case;
+                        if d_in.spr_info.valid = '1' and d_in.valid = '1' then
+                            v.sgl_pipe := '1';
+                        end if;
                     end if;
                 when OP_CMP | OP_MCRXRX =>
                     v.input_ov := '1';