Re: [PATCH] fix TASK_STOPPED vs TASK_NONINTERACTIVE interaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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)"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux