From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/4] tst_atomic: make tst_atomic_inc take a signed integer
Date: Wed, 13 Apr 2016 17:33:08 +0200 [thread overview]
Message-ID: <20160413153307.GE11529@rei.lan> (raw)
In-Reply-To: <1325842962.871291.1460557922959.JavaMail.zimbra@redhat.com>
Hi!
> > > This is a preparation for upcoming patches, which add atomic_add_return(),
> > > that takes signed integer.
> >
> > What is the problem with unsigned integer?
>
> All atomic code in kernel is int based. I wanted to match that as closely
> as possible in our code.
I on x86 that should not matter as addition for numbers in two's
complement is just the same for both signed and unsigned numbers and the
instruction just sets both carry and overflow flags and
programmer/compiler just uses one of them depending on if the number is
supposed to be signed or unsigned.
But I'm not expert on powerpc assembly nor s390 assembly and I certainly
do not want to become one :). So let's follow what kernel does here.
--
Cyril Hrubis
chrubis@suse.cz
prev parent reply other threads:[~2016-04-13 15:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 13:10 [LTP] [PATCH 1/4] tst_atomic: make tst_atomic_inc take a signed integer Jan Stancek
2016-04-13 13:10 ` [LTP] [PATCH 2/4] m4: add a check for __sync_add_and_fetch Jan Stancek
2016-04-13 14:04 ` Cyril Hrubis
2016-04-13 13:10 ` [LTP] [PATCH 3/4] tst_atomic: add atomic_add_return for x86/64, ppc/64 and s390/x Jan Stancek
2016-04-13 13:59 ` Cyril Hrubis
2016-04-13 14:36 ` Jan Stancek
2016-04-13 15:03 ` Cyril Hrubis
2016-04-13 13:10 ` [LTP] [PATCH 4/4] tst_atomic: add test for tst_atomic_inc Jan Stancek
2016-04-13 14:15 ` Cyril Hrubis
2016-04-13 14:07 ` [LTP] [PATCH 1/4] tst_atomic: make tst_atomic_inc take a signed integer Cyril Hrubis
2016-04-13 14:32 ` Jan Stancek
2016-04-13 15:33 ` Cyril Hrubis [this message]
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=20160413153307.GE11529@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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