pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb]
Date: Mon, 19 Dec 2011 16:53:41 -0500
Message-ID: <20111219215341.GD9495@tornado.leadboat.com> (raw)
In-Reply-To: <4EEFABB2.5050100@enterprisedb.com>
References: <4EEB1C77.1000309@enterprisedb.com>
	<20111218224203.GA2950@piware.de>
	<CA+TgmoZzgNrWT3af50YL3_zfSN8AtNXK9sOeACti=5ukwiR0vg@mail.gmail.com>
	<4EEF5397.8090200@enterprisedb.com>
	<20111219200341.GB9495@tornado.leadboat.com>
	<14852.1324325578@sss.pgh.pa.us>
	<4EEFABB2.5050100@enterprisedb.com>

On Mon, Dec 19, 2011 at 11:25:06PM +0200, Heikki Linnakangas wrote:
> I compiled the attached test program on an HP Itanium box, using the  
> same flags you get from PostgreSQL's configure on that box. The relevant  
> assembler output is:
>
>         xchg4           r14 = [r15], r14           // M [slocktest.c: 66/3]
> //file/line/col slocktest.c/67/3
>         ld1.acq         r16 = [r11]                // M [slocktest.c: 67/3]
>         nop.i           0                          // I
> //file/line/col slocktest.c/68/3
>         st1.rel         [r11] = r10             ;; // M [slocktest.c: 68/3]
> //file/line/col slocktest.c/69/3
>         st4.rel         [r15] = r0                 // M [slocktest.c: 69/3]
> //file/line/col slocktest.c/70/1
>
>
> The trick I missed is that the compiler attaches .rel to all the stores  
> and .acq to all the loads through a volatile pointer. gcc seems to do  
> the same. So we're safe.

The Intel compiler appears not to follow this convention:
http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/lin/compiler_c/copt...

If you have that compiler installed, could you see which opcode it generates?

Thanks,
nm



view thread (17+ messages)  latest in thread

Message-ID: <20111219215341.GD9495@tornado.leadboat.com>
Permalink:  ../20111219215341.GD9495@tornado.leadboat.com/
Also on:    postgresql.org/message-id/20111219215341.GD9495@tornado.leadboat.com

 · 

reply

Reply instructions:

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

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noah@leadboat.com, heikki.linnakangas@enterprisedb.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com
  Subject: Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb]
  In-Reply-To: <20111219215341.GD9495@tornado.leadboat.com>
  References: <4EEB1C77.1000309@enterprisedb.com> <20111218224203.GA2950@piware.de> <CA+TgmoZzgNrWT3af50YL3_zfSN8AtNXK9sOeACti=5ukwiR0vg@mail.gmail.com> <4EEF5397.8090200@enterprisedb.com> <20111219200341.GB9495@tornado.leadboat.com> <14852.1324325578@sss.pgh.pa.us> <4EEFABB2.5050100@enterprisedb.com> <20111219215341.GD9495@tornado.leadboat.com>

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

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox