unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: wip-rtl, non-immediate constants like lists and arrays does not have a 64bit aligned address!
Date: Sat, 8 Sep 2012 13:49:41 +0200	[thread overview]
Message-ID: <CAGua6m01PnTbB_J5rh2+GzDMO5yECnwzdcUYbzH0PbJOSZy-HA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]

Hi,

I was a bit surprised when I coded the native versions of rtl-sinstruction,
make-non-immediate I just
assumed that alignement meant 64bit on 64bit platforms. It doesen't in for
example,

(define const
  (assemble-program
   `((begin-program test-bind-rest)
     (assert-nargs-ee/locals 0 2)
     (load-constant 0 '(1 2))
     (load-constant 1 #(1))
     (cons 0 0 1)
     (return 0)
     (end-program))))

-->
??dissassembles into

;;; ((assert-nargs-ee/locals (op : 20) (expected : 0) (nlocals : 2)))

;;; ((inst))

;;; ((make-non-immediate (op : 52) (dst : 0) (offset : -7) (ip : 20677408)))

;;; ((inst))

;;; ((make-non-immediate (op : 52) (dst : 1) (offset : -31) (ip :
20677320)))

;;; ((inst))

;;; ((cons (op : 74) (dst : 0) (x : 0) (y : 1)))

;;; ((inst))

;;; ((return (op : 5) (src : 0)))

And we see that 20677320 & 8 == 8, hence not 64 bit aligned. Assuming
alignment meant 32bit
the native code works very well!

But would I dear to suggest that we try to keep all non immediates aligned
on 64bit boundaries?

/Stefan

[-- Attachment #2: Type: text/html, Size: 1195 bytes --]

                 reply	other threads:[~2012-09-08 11:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=CAGua6m01PnTbB_J5rh2+GzDMO5yECnwzdcUYbzH0PbJOSZy-HA@mail.gmail.com \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.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).