Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #2574

Re: Architecture / Instruction Set / Language co-design.

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Subject Re: Architecture / Instruction Set / Language co-design.
Newsgroups comp.arch
References <3qJTp.58371$SG4.45010@newsfe03.iad> <516386065332608708.623253acolvin-efunct.com@news.eternal-september.org> <uBEUp.2630$%f4.1089@newsfe16.iad> <82nbf8-me72.ln1@ntp6.tmsw.no>
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Date 2011-07-18 11:49 +0000
Message-ID <2011Jul18.134908@mips.complang.tuwien.ac.at> (permalink)

Show all headers | View raw


Terje Mathisen <"terje.mathisen at tmsw.no"> writes:
>EricP wrote:
>> E.g.
>> Alpha LDQ_U Load Quadword Unaligned instruction masked the lower
>> 3 address bits allowing them to be used for tagged pointers.
>
>Wasn't that one of the required instructions to make it possible to 
>handle string (byte) operations with 64-bit operations?

Yes, bytes, 16-bit words, and unaligned accesses to anything are
synthesized with LDQ_U (or you rely on having the BWX instructions,
which allow you to do byte and 16-bit accesses in one instruction).

>I.e. you would use LDQ_U on the (presumably arbitrarily aligned) char * 
>passed in to strcpy() etc, along with another operation which would mask 
>a register based on the lower three bits.

Here's what gcc produces for a byte read:

        lda $16,1($16)
        ldq_u $0,-1($16)
        extqh $0,$16,$0
        sra $0,56,$0

>The fact that it would also work for languages that like to have tagged 
>pointers might have been more of a happy coincidence?

Yes, if it is helpful for them at all.  In most cases the code that
accesses through a tagged pointer knows what the tag is, so you can
use a normal (aligned) load or store and use an offset to turn the
tagged pointer into an aligned access.  E.g., if your lists have tag
3, then you access the head with "ldq ...,-3(...)"  and the tail with
"ldq ..., 5(...)".  The alignment check may be useful as a type check,
or there might be an explicit typecheck before the ldq.

- anton
-- 
M. Anton Ertl                    Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html

Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Architecture / Instruction Set / Language co-design. Roberto Waltman <usenet@rwaltman.com> - 2011-07-14 15:37 -0400
  Re: Architecture / Instruction Set / Language co-design. blp@cs.stanford.edu (Ben Pfaff) - 2011-07-14 13:03 -0700
    Re: Architecture / Instruction Set / Language co-design. Peter Flass <Peter_Flass@Yahoo.com> - 2011-07-14 21:16 -0400
  Re: Architecture / Instruction Set / Language co-design. Peter Flass <Peter_Flass@Yahoo.com> - 2011-07-14 16:06 -0400
    Re: Architecture / Instruction Set / Language co-design. Charles Richmond <frizzle@tx.rr.com> - 2011-07-14 20:42 -0500
      Re: Architecture / Instruction Set / Language co-design. Peter Flass <Peter_Flass@Yahoo.com> - 2011-07-15 07:50 -0400
        Re: Architecture / Instruction Set / Language co-design. Anne & Lynn Wheeler <lynn@garlic.com> - 2011-07-15 09:56 -0400
        Re: Architecture / Instruction Set / Language co-design. John Levine <johnl@iecc.com> - 2011-07-15 17:38 +0000
          Re: Architecture / Instruction Set / Language co-design. Charles Richmond <frizzle@tx.rr.com> - 2011-07-15 23:22 -0500
            Re: Architecture / Instruction Set / Language co-design. John Levine <johnl@iecc.com> - 2011-07-17 19:33 +0000
  Re: Architecture / Instruction Set / Language co-design. cb@mer.df.lth.se (Christian Brunschen) - 2011-07-14 20:25 +0000
  Re: Architecture / Instruction Set / Language co-design. EricP <ThatWouldBeTelling@thevillage.com> - 2011-07-14 17:42 -0400
    Re: Architecture / Instruction Set / Language co-design. mac <acolvin@efunct.com> - 2011-07-17 15:31 +0000
      Re: Architecture / Instruction Set / Language co-design. Bill Findlay <yaldnif.w@blueyonder.co.uk> - 2011-07-17 16:59 +0100
      Re: Architecture / Instruction Set / Language co-design. Anne & Lynn Wheeler <lynn@garlic.com> - 2011-07-17 12:11 -0400
        Re: Architecture / Instruction Set / Language co-design. Mike Hore <mike_horeREM@OVE.invalid.aapt.net.au> - 2011-07-19 12:04 +1000
      Re: Architecture / Instruction Set / Language co-design. EricP <ThatWouldBeTelling@thevillage.com> - 2011-07-17 13:02 -0400
        Re: Architecture / Instruction Set / Language co-design. Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-07-17 20:42 +0200
          Re: Architecture / Instruction Set / Language co-design. anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-07-18 11:49 +0000
        Re: Architecture / Instruction Set / Language co-design. Andrew Reilly <areilly---@bigpond.net.au> - 2011-07-17 23:14 +0000
          Re: Architecture / Instruction Set / Language co-design. EricP <ThatWouldBeTelling@thevillage.com> - 2011-07-19 12:54 -0400
            Re: Architecture / Instruction Set / Language co-design. Andrew Reilly <areilly---@bigpond.net.au> - 2011-07-19 22:16 +0000
      Re: Architecture / Instruction Set / Language co-design. Roberto Waltman <usenet@rwaltman.com> - 2011-07-17 19:20 -0400
        Re: Architecture / Instruction Set / Language co-design. EricP <ThatWouldBeTelling@thevillage.com> - 2011-07-19 12:54 -0400
          Re: Architecture / Instruction Set / Language co-design. Roberto Waltman <usenet@rwaltman.com> - 2011-07-19 14:50 -0400
        Re: Architecture / Instruction Set / Language co-design. EricP <ThatWouldBeTelling@thevillage.com> - 2011-07-19 16:24 -0400
  Re: Architecture / Instruction Set / Language co-design. Andrew Reilly <areilly---@bigpond.net.au> - 2011-07-14 22:57 +0000
    Re: Architecture / Instruction Set / Language co-design. Michael S <already5chosen@yahoo.com> - 2011-07-19 16:16 -0700
  Re: Architecture / Instruction Set / Language co-design. EricP <ThatWouldBeTelling@thevillage.com> - 2011-07-14 19:04 -0400
  Re: Architecture / Instruction Set / Language co-design. Al Kossow <aek@bitsavers.org> - 2011-07-14 17:15 -0700
  Re: Architecture / Instruction Set / Language co-design. Robert Wessel <robertwessel2@yahoo.com> - 2011-07-14 20:34 -0500
  Re: Architecture / Instruction Set / Language co-design. torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-07-15 10:28 +0200
  Re: Architecture / Instruction Set / Language co-design. kenney@cix.compulink.co.uk - 2011-07-15 04:31 -0500
  Re: Architecture / Instruction Set / Language co-design. Mark Thorson <nospam@sonic.net> - 2011-07-18 14:26 -0800
    Re: Architecture / Instruction Set / Language co-design. Charles Richmond <plano.net@aquaporin4.com> - 2011-07-20 01:10 -0500

csiph-web