Re: GCC bug?

Trampas Stern <[email protected]> Fri, 17 Dec 2021 11:20:59 -0500
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <CADqjcygbDkD5f0FvbQgsMLGENYyr=RzJc8qNO7ddQ1sghaQgbA@mail.gmail.com>
--0000000000004a4ae105d359ed0a
Content-Type: text/plain; charset="UTF-8"

Maybe one day even a problem in 32bit architectures.

On Thu, Dec 16, 2021 at 7:50 PM Bruce D. Lightner <[email protected]>
wrote:

> Ian,
>
> Just from a purely AVR architecture point of view, the AVR_HAVE_RAMPD
> #define indicates that the AVR chip in question supports the "RAMP" paging
> register, described as follows:
>
>    *RAMPD*
>    Register concatenated with the Z-register enabling direct addressing of
> the whole data space on MCUs
>    with more than 64KB data space.
>
> Eventually the originally tiny AVR chips' addressable memory got so big
> that we needed a "paging" register.  (That's a repeating theme with every
> 8-bit/16-bit microcontroller family.)
>
> So the "RAMPD" register needs to be saved along with the X, Y and Z
> "special function" registers, if it is present.
>
> Best regards,
>
> Bruce
>
> ------------------------------
> On 12/16/2021 3:46 PM, Ian Molton wrote:
>
> Browsing the GCC source, I found this in gcc/config/avr/avr.c
>
>  if (AVR_HAVE_RAMPZ
>           && TEST_HARD_REG_BIT (set, REG_Z)
>           && TEST_HARD_REG_BIT (set, REG_Z + 1))
>         {
>           emit_push_sfr (rampz_rtx, false /* frame */, AVR_HAVE_RAMPD,
> treg);
>         }
>
>
> I wont pretend to fully understand this part of the compiler, but that
> AVR_HAVE_RAMPD looks shady to me?
>
> Anyone with deeper knowledge want to have a look?
>
> -Ian
>
>
>
>
> --
> *Bruce D. Lightner*
> *Lightner Engineering*
> 8551 La Jolla Shores Drive
> La Jolla, California 92037-3044
> Mobile/SMS: +1-858-228-7579
> Voice: +1-858-551-0770 ext. 2
> Email: [email protected]
> URL: http://www.lightner.net/lightner/bruce/
>
> *CONFIDENTIALITY NOTICE: This e-mail and any attachments may contain
> confidential information intended solely for the use of the addressee. If
> the reader of this message is not the intended recipient, any distribution,
> copying, or use of this e-mail or its attachments is prohibited. If you
> received this message in error, please notify the sender immediately by
> e-mail and delete this message and any copies. Thank you.*
>

--0000000000004a4ae105d359ed0a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Maybe one day even a problem in 32bit=C2=A0architectures.=
=C2=A0</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_=
attr">On Thu, Dec 16, 2021 at 7:50 PM Bruce D. Lightner &lt;<a href=3D"mail=
to:[email protected]">[email protected]</a>&gt; wrote:<br></div><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef=
t:1px solid rgb(204,204,204);padding-left:1ex">
 =20
   =20
 =20
  <div>
    <div>Ian,<br>
      <br>
      Just from a purely AVR architecture point of view, the
      AVR_HAVE_RAMPD #define indicates that the AVR chip in question
      supports the &quot;RAMP&quot; paging register, described as follows:<=
br>
      <br>
      =C2=A0=C2=A0 <b>RAMPD</b><br>
      =C2=A0=C2=A0 Register concatenated with the Z-register enabling direc=
t
      addressing of the whole data space on MCUs<br>
      =C2=A0=C2=A0 with more than 64KB data space.<br>
      <br>
      Eventually the originally tiny AVR chips&#39; addressable memory got
      so big that we needed a &quot;paging&quot; register.=C2=A0 (That&#39;=
s a repeating
      theme with every 8-bit/16-bit microcontroller family.)<br>
      <br>
      So the &quot;RAMPD&quot; register needs to be saved along with the X,=
 Y and
      Z &quot;special function&quot; registers, if it is present.<br>
      <br>
      Best regards,<br>
      <br>
      Bruce<br>
      <br>
      <hr width=3D"100%" size=3D"2">On 12/16/2021 3:46 PM, Ian Molton wrote=
:<br>
    </div>
    <blockquote type=3D"cite">
      <pre>Browsing the GCC source, I found this in gcc/config/avr/avr.c

 if (AVR_HAVE_RAMPZ
          &amp;&amp; TEST_HARD_REG_BIT (set, REG_Z)
          &amp;&amp; TEST_HARD_REG_BIT (set, REG_Z + 1))
        {
          emit_push_sfr (rampz_rtx, false /* frame */, AVR_HAVE_RAMPD,
treg);
        }


I wont pretend to fully understand this part of the compiler, but that
AVR_HAVE_RAMPD looks shady to me?

Anyone with deeper knowledge want to have a look?

-Ian

</pre>
    </blockquote>
    <br>
    <br>
    <div>-- <br>
      <span style=3D"font-size:9pt;font-family:sans-serif"> <b>Bruce D.
          Lightner</b><br>
        <b>Lightner Engineering</b><br>
        8551 La Jolla Shores Drive<br>
        La Jolla, California 92037-3044<br>
        Mobile/SMS: +1-858-228-7579<br>
        Voice: +1-858-551-0770 ext. 2<br>
        Email: <a href=3D"mailto:[email protected]" target=3D"_blank">l=
[email protected]</a><br>
        URL: <a href=3D"http://www.lightner.net/lightner/bruce/" target=3D"=
_blank">http://www.lightner.net/lightner/bruce/</a><br>
        <br>
        <i>CONFIDENTIALITY NOTICE: This e-mail and any attachments may
          contain confidential information intended solely for the use
          of the addressee. If the reader of this message is not the
          intended recipient, any distribution, copying, or use of this
          e-mail or its attachments is prohibited. If you received this
          message in error, please notify the sender immediately by
          e-mail and delete this message and any copies. Thank you.</i>
      </span></div>
  </div>
</blockquote></div>

--0000000000004a4ae105d359ed0a--