mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: musl 0.9.5 release and new website
Date: Sun, 16 Sep 2012 23:02:41 -0400	[thread overview]
Message-ID: <20120917030241.GH254@brightrain.aerifal.cx> (raw)
In-Reply-To: <20120916214208.GL9428@port70.net>

On Sun, Sep 16, 2012 at 11:42:08PM +0200, Szabolcs Nagy wrote:
> * Rich Felker <dalias@aerifal.cx> [2012-09-15 23:29:31 -0400]:
> > On Sat, Sep 15, 2012 at 03:53:41PM +0200, Szabolcs Nagy wrote:
> > > 	while (i < 16) {
> > > 		FF(a,b,c,d, W[i],  7, tab[i]); i++;
> > > 		FF(d,a,b,c, W[i], 12, tab[i]); i++;
> > > 		FF(c,d,a,b, W[i], 17, tab[i]); i++;
> > > 		FF(b,c,d,a, W[i], 22, tab[i]); i++;
> > > 	}
> > 
> > This is more of the same old ugly manual unrolling. The file is small
> > as-is, but I think it could be a lot smaller with -Os (and same speed
> > as now with -O3) if the manual unrolling were removed.
> > 
> 
> ok i removed the unrolling, the difference is about 200 bytes

Thanks. Unfortunately it's 10% slower at -O3 (and about 20% slower at
-Os), but as since there doesn't seem to be any way to configure
rounds, crypt_md5 performance is probably mostly irrelevant.

> is the 30K key limit reasonable?

I don't know; can you explain the motivation?

> -#define FF(a,b,c,d,w,s,t) a += F(b,c,d) + w + t; a = rol(a,s) + b
> -#define GG(a,b,c,d,w,s,t) a += G(b,c,d) + w + t; a = rol(a,s) + b
> -#define HH(a,b,c,d,w,s,t) a += H(b,c,d) + w + t; a = rol(a,s) + b
> -#define II(a,b,c,d,w,s,t) a += I(b,c,d) + w + t; a = rol(a,s) + b
> +#define FF(a,b,c,d,w,r,t) a += F(b,c,d) + w + t; a = rol(a,r) + b
> +#define GG(a,b,c,d,w,r,t) a += G(b,c,d) + w + t; a = rol(a,r) + b
> +#define HH(a,b,c,d,w,r,t) a += H(b,c,d) + w + t; a = rol(a,r) + b
> +#define II(a,b,c,d,w,r,t) a += I(b,c,d) + w + t; a = rol(a,r) + b

Is this changing anything but the argument name? Why the change?

> +static const uint8_t idx[64] = {
> +0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
> +1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,
> +5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,
> +0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9
> +};
> +static const uint8_t rot[64] = {
> +7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,
> +5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,
> +4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,
> +6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21

It would be nice if these could be done without tables. As-is, I'm not
really sure the the de-unrolled code is all that much cleaner than the
original, but at least it's slightly smaller...

Rich


  reply	other threads:[~2012-09-17  3:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-15  8:12 Rich Felker
2012-09-15 13:53 ` Szabolcs Nagy
2012-09-15 14:05   ` Luca Barbato
2012-09-16  3:35     ` Rich Felker
2012-09-16  3:48       ` Conrad Pankoff
2012-09-16  4:03         ` Gregor Richards
2012-09-16 11:04       ` Luca Barbato
2012-09-16  3:26   ` Rich Felker
2012-09-16 10:31     ` Szabolcs Nagy
2012-09-16 12:39       ` Rich Felker
2012-09-16  3:29   ` Rich Felker
2012-09-16 21:42     ` Szabolcs Nagy
2012-09-17  3:02       ` Rich Felker [this message]
2012-09-17  7:35         ` Szabolcs Nagy
2012-09-18 13:56           ` Rich Felker
2012-09-15 23:09 ` Isaac Dunham
2012-09-16  3:41 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120917030241.GH254@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).