• Paul Burton's avatar
    MIPS: bitops: Allow immediates in test_and_{set,clear,change}_bit · a2e66b86
    Paul Burton authored
    The logical operations or & xor used in the test_and_set_bit_lock(),
    test_and_clear_bit() & test_and_change_bit() functions currently force
    the value 1<<bit to be placed in a register. If the bit is compile-time
    constant & fits within the immediate field of an or/xor instruction (ie.
    16 bits) then we can make use of the ori/xori instruction variants &
    avoid the use of an extra register. Add the extra "i" constraints in
    order to allow use of these immediate encodings.
    Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
    Cc: linux-mips@vger.kernel.org
    Cc: Huacai Chen <chenhc@lemote.com>
    Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
    Cc: linux-kernel@vger.kernel.org
    a2e66b86
bitops.h 14.2 KB