mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: linux@horizon.com
To: linux-kernel@vger.kernel.org
Cc: torvalds@osdl.org
Subject: Re: [PATCH] fix TASK_STOPPED vs TASK_NONINTERACTIVE interaction
Date: 3 Oct 2005 19:49:00 -0400	[thread overview]
Message-ID: <20051003234900.27066.qmail@science.horizon.com> (raw)

> Any CPU I can think of has a "and + compare against zero". x86 calls it 
> "test", although a regular "and" will do it too. ppc has "andi.". alpha 
> comparisons are against registers being zero or not, so again it's an 
> "and".

About the only one for which "cmp" is faster than "test" is the 680x0.
"cmp" is a subtract that doesn't write the result (except to the condition
codes).  "tst" (called "bit" on the VAX and 6502) is a similar AND.

The 68k doesn't have that.  You have to obliterate one of the operands,
and it can't be the immediate operand, so it's often two instructions.

The 68k does have an instruction called "test", but it just sets the
condition codes based on a single operand (since it doesn't set the
condition codes on a simple move).

It *does* have a single-bit test instruction, which evaluates
"if (x & 1<<y)" in one cycle, but that doesn't help for multi-bit masks
like "if (x % 4096 == 0)"

             reply	other threads:[~2005-10-03 23:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-03 23:49 linux [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-09-29 21:54 Roland McGrath
2005-09-29 22:15 ` Linus Torvalds
2005-09-30 16:51 ` Oleg Nesterov
2005-09-30 17:18   ` Linus Torvalds
2005-10-01 11:32     ` Oleg Nesterov
2005-10-02  1:12     ` Roland McGrath
2005-09-29 15:58 Oleg Nesterov
2005-09-29 16:02 ` Linus Torvalds
2005-09-29 16:25   ` Paulo Marques
2005-10-03  2:54   ` Coywolf Qi Hunt
2005-10-03  3:24     ` Linus Torvalds

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=20051003234900.27066.qmail@science.horizon.com \
    --to=linux@horizon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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

all inboxes | Powered by JetHome®