All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randolph Chung <randolph@tausq.org>
To: Will Newton <will@misconception.org.uk>
Cc: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] 64 byte alignment
Date: Fri, 30 Aug 2002 16:57:06 -0700	[thread overview]
Message-ID: <20020830235705.GD14634@tausq.org> (raw)
In-Reply-To: <E17kvMv-0002G4-00.2002-08-31-00-40-01@cmailg2.svr.pol.co.uk>

> I'm trying to 64 byte align a stack pointer, unfortunately it's not working. 
> Here is my code:
> 
>         ldi 0x03f,%r21                  ; Load mask (b0111111)
>         and,<> %r3,%r21,%r21            ; Check alignment
>         addi 64,%r3,%r3                 ; If not aligned round up
>         depwi 0x0,31,6,%r3               ; Clear low order bits
> 
> Basically the idea is:
>  and the low 6 bits with a mask to see if any are set.
>  if any are set, add 64 and clear the low order bits
> 
> I may be doing something horribly ignorant here, but PA-RISC assembly is not 
> the most widely documented of things. :)

nullification only applies to one instruction. you probably need a
branch there.

as for documentation, the entire intruction set is documented for pa1.1
and 2.0 on the hp web site:

http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,958!1!253,00.html

http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,959,00.html

horrid link names :-(

another good way to do this is to write what you want in C, and tell gcc
to tell you what you want :-)


input: r26, r20 is scratch

        extru %r26,31,6,%r20
        comib,=,n 0,%r20,.L2
        ldo 64(%r26),%r26
        depi 0,31,6,%r26
.L2:
        /* ... */

randolph
--  
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

  reply	other threads:[~2002-08-30 23:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-30 23:43 [parisc-linux] 64 byte alignment Will Newton
2002-08-30 23:57 ` Randolph Chung [this message]
2002-08-31  0:10   ` Will Newton
2002-08-31  1:12   ` John David Anglin

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=20020830235705.GD14634@tausq.org \
    --to=randolph@tausq.org \
    --cc=parisc-linux@lists.parisc-linux.org \
    --cc=will@misconception.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.