public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "NickParker at Eaton dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/65082] Wasted cycles when using a register based varible
Date: Sun, 22 Feb 2015 22:17:00 -0000	[thread overview]
Message-ID: <bug-65082-4-nY7poMoY2i@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65082-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65082

--- Comment #3 from NickParker at Eaton dot com ---

register uint16_t r4 asm ("r4");
register uint16_t r6 asm ("r6");
volatile int8_t localOscCosine;
volatile int8_t acInput;

void pllExec(void)
{
  int16_t mix_output_s2=0;
  r4 += r6;
  localOscCosine = pgm_read_byte(&cosine7b[r4 >> 8]);
  mix_output_s2 = (localOscCosine * acInput); // GCC-AVR it give 16-bits....
};


---------------------------------------
results in.....


void pllExec(void)
  39:pll.c         **** {
  15                       .loc 1 39 0
  16                       .cfi_startproc
  17                   /* prologue: function */
  18                   /* frame size = 0 */
  19                   /* stack size = 0 */
  20                   .L__stack_usage = 0
  21                   .LVL0:
  40:pll.c         ****   //int16_t ss;
  41:pll.c         ****   int16_t mix_output_s2=0;
  42:pll.c         ****   r4 += r6;
  22                       .loc 1 42 0
  23 0000 F301              movw r30,r6
  24 0002 E40D              add r30,r4
  25 0004 F51D              adc r31,r5
  26 0006 2F01              movw r4,r30
  27                   .LVL1:
  28                   .LBB2:


  parent reply	other threads:[~2015-02-22 20:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 21:40 [Bug c/65082] New: " NickParker at Eaton dot com
2015-02-16 21:45 ` [Bug middle-end/65082] " pinskia at gcc dot gnu.org
2015-02-20 13:41 ` gjl at gcc dot gnu.org
2015-02-22 22:17 ` NickParker at Eaton dot com [this message]
2015-02-22 22:21 ` NickParker at Eaton dot com
2023-05-26  1:35 ` pinskia at gcc dot gnu.org
2023-05-26  1:38 ` pinskia at gcc dot gnu.org
2023-05-26  2:30 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65082-4-nY7poMoY2i@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).