]> Shamusworld >> Repos - rmac/commitdiff
All size optimisation warnings are hidden by default unless rmac is invoked with...
authorggn <ggn.dbug@gmail.com>
Sat, 18 Jul 2020 15:26:53 +0000 (18:26 +0300)
committerShamus Hammons <jlhamm@acm.org>
Mon, 3 Aug 2020 16:42:36 +0000 (11:42 -0500)
dsp56k_amode.c

index 7937b106b87c54623bdaffdb17d665d4679b980a..4e86f362f11c28a81384568eff4388763bdc3485 100644 (file)
@@ -437,7 +437,8 @@ static inline int dsp_parmode(int *am, int *areg, TOKEN * AnEXPR, uint64_t * AnE
                        {
                                if (*AnEXVAL > 0x3F)
                                {
-                                       warn("short addressing mode forced but address is bigger than $3F - switching to long");
+                                       if (optim_warn_flag)
+                                               warn("short addressing mode forced but address is bigger than $3F - switching to long");
                                        *am = M_DSPEA;
                                        *memspace = 1 << 6;     // Mark we're on Y memory space
                                        *areg = DSP_EA_ABS;
@@ -1609,7 +1610,8 @@ x_gotea1:
                {
                        if (dspImmedEXVAL > 0x3F)
                        {
-                               warn("short addressing mode forced but address is bigger than $3F - switching to long");
+                               if (optim_warn_flag)
+                                       warn("short addressing mode forced but address is bigger than $3F - switching to long");
                                force_imm = NUM_FORCE_LONG;
                                deposit_extra_ea = DEPOSIT_EXTRA_WORD;
                                ea1 = DSP_EA_ABS;
@@ -1876,7 +1878,8 @@ static inline LONG parse_y(LONG inst, LONG S1, LONG D1, LONG S2)
         {
             // We're in 'S1,D1 Y:ea,D2' or 'S1,D1 S1,Y:ea'
             // there's no Y:aa mode here, so we'll force long
-            warn("forced short addressing in R:Y mode is not allowed - switching to long");
+                       if (optim_warn_flag)
+                               warn("forced short addressing in R:Y mode is not allowed - switching to long");
 
             if (expr(dspImmedEXPR, &dspImmedEXVAL, &dspImmedEXATTR, &dspImmedESYM) != OK)
                 return ERROR;
@@ -1899,7 +1902,8 @@ static inline LONG parse_y(LONG inst, LONG S1, LONG D1, LONG S2)
             {
                 if (dspImmedEXVAL > 0xfff)
                 {
-                    warn("short addressing mode forced but address is bigger than $fff - switching to long");
+                                       if (optim_warn_flag)
+                                               warn("short addressing mode forced but address is bigger than $fff - switching to long");
                     ea1 = DSP_EA_ABS;
                     force_imm = NUM_FORCE_LONG;
                     deposit_extra_ea = DEPOSIT_EXTRA_WORD;
@@ -2484,7 +2488,8 @@ LONG parmoves(WORD dest)
                                                }
                                                else
                                                {
-                                                       warn("forced short immediate value doesn't fit in 8 bits - switching to long");
+                                                       if (optim_warn_flag)
+                                                               warn("forced short immediate value doesn't fit in 8 bits - switching to long");
                                                        force_imm = NUM_FORCE_LONG;
                                                }
                                        }
@@ -2554,7 +2559,8 @@ deposit_immediate_short_with_register:
                                        {
                                                // Value's 16 lower bits are not set so the value can fit in a single byte
                                                // (check parallel I move quoted above)
-                                               warn("Immediate value fits inside 8 bits, so using instruction short format");
+                                               if (optim_warn_flag)
+                                                       warn("Immediate value fits inside 8 bits, so using instruction short format");
                                                dspImmedEXVAL >>= 16;
                                                goto deposit_immediate_short_with_register;
                                        }
@@ -2563,7 +2569,8 @@ deposit_immediate_short_with_register:
                                        {
                                                if ((dspImmedEXVAL & 0xFFFF) != 0)
                                                {
-                                                       warn("Immediate value short format forced but value does not fit inside 8 bits - switching to long format");
+                                                       if (optim_warn_flag)
+                                                               warn("Immediate value short format forced but value does not fit inside 8 bits - switching to long format");
                                                        goto deposit_immediate_long_with_register;
                                                }