lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.1.10.0804301929360.5623@fbirervta.pbzchgretzou.qr>
Date:	Wed, 30 Apr 2008 19:30:45 +0200 (CEST)
From:	Jan Engelhardt <jengelh@...ozas.de>
To:	Soumyadip Das Mahapatra <dip_kernel@...oo.co.in>
cc:	linux-kernel@...r.kernel.org
Subject: Re: Improved Swapping Method In sort.c


On Wednesday 2008-04-30 19:09, Soumyadip Das Mahapatra wrote:

>Hello everybody, The swapping method (in function void u32_swap() line no.. 14
>to 16) in lib/sort.c can be improved by using the following code *(u32 *)b ^=
>*(u32 *)a ^= *(u32 *)b ^= *(u32 *)a instead of the code given.

GCC is smart enough to optimize the current instructions into a
bswap instruction or similar. While with xor, some are said to fail -
and three xor operations are surely slower than a swap if there is
a swap instruction.

Never heard of that?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ