public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kalai Rajah N <kalairajah@gmail.com>
To: Ian Lance Taylor <iant@google.com>,
	"gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Fwd: Thumb inline assembly
Date: Tue, 11 Jun 2013 00:20:00 -0000	[thread overview]
Message-ID: <CAPTDLfG_XuCfGrs6fur6W6trnDxp=y+7fvcQKCTCp7ecQ5XxCA@mail.gmail.com> (raw)
In-Reply-To: <CAPTDLfH--WkreVXSDb7nt6KsKP+vBH3q_eoJX7yvqm=O8QzF0A@mail.gmail.com>

missed the alias when replying back.


---------- Forwarded message ----------
From: Kalai Rajah N <kalairajah@gmail.com>
Date: Mon, Jun 10, 2013 at 5:19 PM
Subject: Re: Thumb inline assembly
To: Ian Lance Taylor <iant@google.com>


If the clobber-list is removed, the errors are on r1,r2, r3 and the
generated assembly code is ...

.thumb_func
.type check_reset_value, %function
check_reset_value:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
push {r4, r7}
sub sp, sp, #16
add r7, sp, #0
str r0, [r7, #12]
str r1, [r7, #8]
str r2, [r7, #4]
ldr r1, [r7, #12]
ldr r0, [r7, #8]
movw r3, #49374
movt r3, 47789
movw r2, #49374
movt r2, 24589
ldr r4, [r7, #4]
@ 24 "nvic_reg_read.c" 1
ldr r2, =8   /* number of register */
ldr r1, =r1 /* load the nvic_iser* register */
read_reg:
sub r2, r2, #1
ldr r0, [r1]
add r1, r1, #4 /* go to the next register */
cmp r0, r0
beq read_reg_ok
ldr r3, =r3
str r3, [r4] /* update status flag */
read_reg_ok:
cmp r2, #0
bne read_reg
ldr r3, =r2
str r3, [r4] /* update status flag */

- here the push seems fine.

On Mon, Jun 10, 2013 at 5:13 PM, Ian Lance Taylor <iant@google.com> wrote:
> On Mon, Jun 10, 2013 at 5:06 PM, Kalai Rajah N <kalairajah@gmail.com> wrote:
>> Do you mean push is not supported or the specific parameters used by
>> push in this code?
>>
>> But, from ARM's page, it seems the instruction is fine ...
>>
>> http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0283b/Babefbce.html
>
> That page says that in Thumb mode the push instruction only supports
> the lo registers.
>
> Ian
>
>> On Mon, Jun 10, 2013 at 4:51 PM, Ian Lance Taylor <iant@google.com> wrote:
>>> On Mon, Jun 10, 2013 at 4:19 PM, Kalai Rajah N <kalairajah@gmail.com> wrote:
>>>>
>>>> .thumb_func
>>>
>>> This is a Thumb function.
>>>
>>>> push {r4, r5, r6, r7, r8}
>>>
>>> As far as I know this is not a Thumb instruction.
>>>
>>> I don't know how this gets through the assembler.
>>>
>>> Ian

  parent reply	other threads:[~2013-06-11  0:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 21:41 Kalai Rajah N
2013-06-10 22:51 ` Ian Lance Taylor
2013-06-10 23:19   ` Kalai Rajah N
2013-06-10 23:59     ` Ian Lance Taylor
2013-06-11  0:06       ` Kalai Rajah N
2013-06-11  0:13         ` Ian Lance Taylor
     [not found]           ` <CAPTDLfH--WkreVXSDb7nt6KsKP+vBH3q_eoJX7yvqm=O8QzF0A@mail.gmail.com>
2013-06-11  0:20             ` Kalai Rajah N [this message]
2013-06-11  0:31               ` Ian Lance Taylor
2013-06-11  0:41                 ` Kalai Rajah N
2013-06-11  1:01                   ` Ian Lance Taylor
2013-06-11 18:27                     ` Kalai Rajah N

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='CAPTDLfG_XuCfGrs6fur6W6trnDxp=y+7fvcQKCTCp7ecQ5XxCA@mail.gmail.com' \
    --to=kalairajah@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=iant@google.com \
    /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).