From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9086 Path: news.gmane.org!not-for-mail From: Markus Wichmann Newsgroups: gmane.linux.lib.musl.general Subject: Re: atomic.h cleanup Date: Sun, 10 Jan 2016 18:37:13 +0100 Message-ID: <20160110173713.GH2016@debian> References: <20160110122139.GF2016@debian> <20160110165718.GR238@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="sdtB3X0nJg68CQEu" X-Trace: ger.gmane.org 1452447451 11691 80.91.229.3 (10 Jan 2016 17:37:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2016 17:37:31 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9099-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jan 10 18:37:29 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aIJvk-0000el-7f for gllmg-musl@m.gmane.org; Sun, 10 Jan 2016 18:37:28 +0100 Original-Received: (qmail 16285 invoked by uid 550); 10 Jan 2016 17:37:26 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 16257 invoked from network); 10 Jan 2016 17:37:25 -0000 Content-Disposition: inline In-Reply-To: <20160110165718.GR238@brightrain.aerifal.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:lvdSQTJLWqWkeluCkKH4V189ppWWMKGmQnMykwQXISQPeZsXNSg IZG25GpWrx3J8BBwcszE4lgDlDnkoBgedIUmQ+eauDCQ6VHbcquJhknqMI7J7i/nV36gYCr ee4+SOMpArrMZqLMBOGmBG4wJfHYfTkS6Q9yqUnzYLBdEHOHmpNKn5kFsfohSuGlbUH2fpb r/d2VUxDGoQNsMyzrvAEw== X-UI-Out-Filterresults: notjunk:1;V01:K0:LMpe0q4TO8A=:g1bEuNGYKEONvMhLECWTKX iKP2pgD9P0JcfbVudS6eDO5eBURkvzsOoHLX98yl2aUheN7e+b6tSLSlNi7p6BkQYKJiod1Vn 8J2oW5y3Frh66H41CdJnULzOo+XoukQyvptcG6AfesqW7i6gfABE8tAbLAnTU0egyouhtBbAQ MV0EFEQ5Qg+bM4J1E8RvLF/IFP4PGHEP+Bf0zToS/4x1nCyNOci4nzoA/UWvLDxIAA6QYw1NE 8XqxLyW5AOx9f/VePdZfohg0mrwsrc9mXlDdRrrvYaGtxruuHXj7mDJgDX+u7+TfWJcfA1Zea bgmy9mjvS4q1Iv/7Hh4UpnMw0irtH5DMDVe+bwAzVh0/T78Z4KxJ9N6wPpX4AFvvOzzvkyHf7 fSrMmacvaEbbhoOCLJp1VijBekQYLmbko4cIFML//8WJeo1KXwjFR9oyGgRc+W4+NLvXfyDe7 FboDefqS/49VdA48hPLcmKXB6CtWK9X2QAnOgT7fvYa8PIEyllWdthQlTgQAmEE0zuFZWmCs8 9viXWDYHpjRnqghfiKVcP4guP4oQRJ9AFf4tR/eyFcZcYg/9MJbR/RIMpOqOBklFhRhjTL0Pp 8pvB/XXmXrYWvjxFHyoJ2oWQocKuEHjfSiIvc6nl/NTzFLYW0mMXLjHf5bPIH5odh8mWz8GM9 S/19wAbn9mFyY6OWohC9HqhTF5NPDcjjSNhWRfa971NM67cFrSCNFqho17AdTHNRy6eTo7lLk gLBza1xuaxAO+eWeOB1RJuU6HfkakiG3qnx9VTRF+mLpRNiX3tt2NrdO0z4= Xref: news.gmane.org gmane.linux.lib.musl.general:9086 Archived-At: --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, And once more with the promised attachments. I'm sorry. Ciao, Markus --sdtB3X0nJg68CQEu Content-Type: text/x-csrc; charset=us-ascii Content-Disposition: attachment; filename="cas.c" static inline int a_ll(volatile int *p) { int x; asm volatile ("lwarx %0, 0, %1" : "=r"(x) : "r"(p) : "memory"); return x; } static inline int a_sc(volatile int *p, int x) { asm goto ("stwcx. %0, 0, %1\nbne- %l2" : : "r"(x), "r"(p) : "cc","memory" : fail); return 1; fail: return 0; } int a_cas(volatile int *p, int t, int s) { int x; do { x = a_ll(p); if (x != t) break; } while (!a_sc(p, s)); return x; } --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="cas.s" .file "cas.c" .section ".text" .align 2 .globl a_cas .type a_cas, @function a_cas: .L2: #APP # 3 "cas.c" 1 lwarx 9, 0, 3 # 0 "" 2 #NO_APP cmpw 7,4,9 bne- 7,.L4 #APP # 8 "cas.c" 1 stwcx. 5, 0, 3 bne- .L2 # 0 "" 2 #NO_APP .L3: mr 3,4 blr .L4: mr 4,9 b .L3 .size a_cas, .-a_cas .ident "GCC: (GNU) 4.9.2" .section .note.GNU-stack,"",@progbits --sdtB3X0nJg68CQEu--