From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15214 invoked by alias); 12 Mar 2015 23:55:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 15201 invoked by uid 89); 12 Mar 2015 23:55:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 12 Mar 2015 23:55:10 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id 7DFD834067D; Thu, 12 Mar 2015 23:55:07 +0000 (UTC) Date: Thu, 12 Mar 2015 23:55:00 -0000 From: Mike Frysinger To: Jiri Gaisler Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v3 03/14] sim/erc32: Switched emulated memory to host endian order. Message-ID: <20150312235507.GG877@vapier> Mail-Followup-To: Jiri Gaisler , gdb-patches@sourceware.org References: <1425244244-27709-1-git-send-email-jiri@gaisler.se> <1425244244-27709-4-git-send-email-jiri@gaisler.se> <20150302011342.GH19363@vapier> <55020453.9080502@gaisler.se> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="z9ECzHErBrwFF8sy" Content-Disposition: inline In-Reply-To: <55020453.9080502@gaisler.se> X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00384.txt.bz2 --z9ECzHErBrwFF8sy Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1440 On 12 Mar 2015 22:25, Jiri Gaisler wrote: > On 02/03/15 02:13, Mike Frysinger wrote: > >> +#ifdef HOST_LITTLE_ENDIAN > >> > + for (i =3D 0; i < (count / 4); i++) wbuffer[i] =3D ntohl(wbuf= fer[i]); // endian swap > >> > +#endif > > > > sim-endian.h already provides a lot of helper funcs that i'm pretty sur= e you=20 > > can use here. >=20 > I don't understand why ntohl() is a problem. It is a common Posix function > that converts big endian to host endian, exactly what is needed. Using > sim-endian.h pulls in a lot of the sim-*.c files due to dependencies and > makes the simulator larger than necessary .... "network" has no meaning here. using it as a proxy for moving between big= =20 endian and native endian when there are clear functions that the sim has=20 standardized on isn't correct. your code also (1) requires duplicating bra= nches=20 and (2) inline preprocessor checks. it also does not properly handle bi-en= dian=20 builds. sim-endian does all of these for you. the whole point of common/ = is=20 to delete code from each sim rather than open coding it everywhere. wrt size, i don't think that's a compelling argument. we're talking units = of=20 KiB here, and i can't even count that low :P. if you're having trouble converting the build over (compiling/linking error= s),=20 then we can discuss that. but it'd be a matter of "do we do it now or late= r"=20 rather than "do we do ever convert". -mike --z9ECzHErBrwFF8sy Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVAidbAAoJEEFjO5/oN/WBGLsP/RyCpSF5PDh/O6x+9y7n/RRd Vl109Y9/pUgmLTRVR8v+2b4XIS53P51wXK1uPAsBbMbmBc5vJx5MgBS0arwfeZfv 7feazNKn3xHtUqVEjURrhTFmlGvWjGWvP9tXOjXVlhw4yxMlD8bCT6XEWzZabYMq pFGBf8duuLkLOWqfgP7CuwGZVHGlzO3hBECulpkuSujPy2qWIGTWegRzL5vgw4aP Lj21mFetT59lctd629vzENH3tgyD6NacUwecV7ZI4iwKOzfD9IAmMd06Zc7A2Fju HegfqpPzYfVur5ad1wvfNowWC+nc7qCs3IEEj3knvEt0g3qS7j990lvaT3ZmNppt 0wkT+JXiseVLLqJhOvUNfw6q4ppbzBAuF4mhWt28Yp50NoFskhybKvltNF7i+jcF VVDsJnrG+pmyVl6lG5BGb4Xla3OCHjeLwyWEhzSFljLWq4nMgkM2Ng4W5Yt70+FM il9cVk1rcbUu4PlSk6/k/qcOM0rAS18z47JahHs9oEOSOW7ZmyvEVleJllgpVIsZ ZQoSb58UjHE4XD9ELot+OdPntePhJ0CYq4SKbr9jKKMg2Alykhs69zXpSoze9MFg fAsS9OKlkrLh8VvJ7l+lNQpIGj0pV/++T/gOEtkymoFlRs0QZ2KQwZZUflOb9qjl KaspxJJhkGrPDkHsU/H7 =vVbU -----END PGP SIGNATURE----- --z9ECzHErBrwFF8sy--