From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Vgbrz-0008In-OP for mharc-grub-devel@gnu.org; Wed, 13 Nov 2013 09:56:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgbrt-0008Ib-5Z for grub-devel@gnu.org; Wed, 13 Nov 2013 09:56:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vgbrn-0005il-GQ for grub-devel@gnu.org; Wed, 13 Nov 2013 09:56:33 -0500 Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]:32768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgbrn-0005ie-8k for grub-devel@gnu.org; Wed, 13 Nov 2013 09:56:27 -0500 Received: by mail-ee0-f50.google.com with SMTP id b45so272155eek.9 for ; Wed, 13 Nov 2013 06:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=JCBbsi548fskRYM6igjufe22hIdWYDBko/D6aowQmB0=; b=RlZUfe0Jnwz/dRRFQzaeX/PGocSYx1kQpaAXUYpWzHPf3UJgNe42o6NqHaJ7PvWZae Zka/gwIIkCrU51ueFpUVexk5Wm1d5dhAG+YYoIaZgjkRV9WmLoTlcATAfSp/IByNl5eE tR3TOFxaTrBoH4eplXpAMdkwcvwi5qxv6AVHTi7PmP1YnlfueQ8P049dGGDeivAaBKUt TfNtCHAFelUcR3+cQrOnpm3x+0hFZl8YaMUrZjMgMJGdg2qaAIjhx7MS8J3UV+A+ZzOJ uffGONKKEXpVmzxuE4bAhzWYzey6sobM9vIEU2DwhgGeV+UZTVSABeEZvnY2ScZIqOGl Kl5w== X-Received: by 10.15.48.67 with SMTP id g43mr49829513eew.17.1384354586150; Wed, 13 Nov 2013 06:56:26 -0800 (PST) Received: from [192.168.1.16] (31-249.1-85.cust.bluewin.ch. [85.1.249.31]) by mx.google.com with ESMTPSA id h8sm89162907eew.16.2013.11.13.06.56.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Nov 2013 06:56:25 -0800 (PST) Message-ID: <52839317.2050204@gmail.com> Date: Wed, 13 Nov 2013 15:56:23 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [RFT] Use pair of shifts instead of and in ARM code References: <5282C111.70100@gmail.com> <20131113141608.GT1557@rocoto.smurfnet.nu> In-Reply-To: <20131113141608.GT1557@rocoto.smurfnet.nu> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2WGAOLJCNOONNPOSWPSVV" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::232 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Nov 2013 14:56:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2WGAOLJCNOONNPOSWPSVV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 13.11.2013 15:16, Leif Lindholm wrote: > On Wed, Nov 13, 2013 at 01:00:17AM +0100, Vladimir '=CF=86-coder/phcode= r' Serbinenko wrote: >> 1ff and 3fff can't be easily loaded on ARM. This patch replaces load+a= nd >> with pair of shift to keep only wanted bits. > =20 > Actually, on ARMv7 we could just use MOVW instead: >=20 Another goal of this patch was to make this code compilable with clang (just a silly experiment) which lacks many useful ARM facilities including architecture switching in file (other than thumb<->arm). This was one of culprits. The other one was that I had to manually assemble barrier instructions. >> diff --git a/grub-core/kern/arm/cache_armv7.S >> b/grub-core/kern/arm/cache_armv7.S >> index 0c16b10..454bad3 100644 >> --- a/grub-core/kern/arm/cache_armv7.S >> +++ b/grub-core/kern/arm/cache_armv7.S >> @@ -58,11 +64,17 @@ clean_invalidate_dcache: >> @ read current cache information >> mrc p15, 1, r8, c0, c0, 0 @ Read CCSIDR >> lsr r3, r8, #13 @ Number of sets -1 >> - ldr r9, =3D0x3fff > movw r9, #0x3fff >> - and r3, r3, r9 >> + >> + @ Keep only 14 bits of r3 >> + lsl r3, r3, #18 >> + lsr r3, r3, #18 >> + >> lsr r4, r8, #3 @ Number of ways -1 >> - ldr r9, =3D0x1ff > movw r9, #0x1ff >> - and r4, r4, r9 >> + >> + @ Keep only 9 bits of r4 >> + lsl r4, r4, #23 >> + lsr r4, r4, #23 >> + >> and r7, r8, #7 @ log2(line size in words) - 2= >> add r7, r7, #2 @ adjust >> mov r8, #1 >> >=20 > / > Leif >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 ------enig2WGAOLJCNOONNPOSWPSVV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlKDkxcACgkQmBXlbbo5nOvCWgD/eLg1fw8aK7tbfKY/44pWi5T6 PPikXiDaVQP1H/Kb8+sBAKOLhH/NtJz4kD8v1oT35Y3Ha48u8Gyk9Fr15Fx6N8/x =NW+x -----END PGP SIGNATURE----- ------enig2WGAOLJCNOONNPOSWPSVV--