From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,97c2c57204de92f4,start X-Google-Attributes: gid111c93,public From: Solar Designer Subject: ccc vs. egcs at integer ops Date: 1999/10/05 Message-ID: <7tcjfb$e5n$1@prince.dataforce.net>#1/1 X-Deja-AN: 533013923 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=KOI8-R X-Complaints-To: usenet@news.dataforce.net X-Trace: prince.dataforce.net 939118891 14519 195.42.160.18 (5 Oct 1999 10:21:31 GMT) Organization: DataForce ISP Mime-Version: 1.0 User-Agent: tin/pre-1.4-980226 (UNIX) (Linux/2.0.37 (i686)) NNTP-Posting-Date: 5 Oct 1999 10:21:31 GMT Newsgroups: comp.os.linux.alpha Hi, I'm posting this for discussion here, as poor code performance doesn't seem to qualify as a problem in the submission form on the support site. Basically, in my testing the ccc beta doesn't seem to make efficient use of the integer registers, in functions that have more than ~20 integer variables in them. Both egcs and cc on DU have no problem allocating the registers efficiently for the very same C sources. One example is my bitslice DES code -- [ghost@alice src]$ objdump -d DES_bs_b.o-egcs-1.1.2 | grep -c st[ql] 429 [ghost@alice src]$ objdump -d DES_bs_b.o-ccc-6.2 | grep -c st[ql] 1332 [ghost@alice src]$ size DES_bs_b.o-egcs-1.1.2 DES_bs_b.o-ccc-6.2 text data bss dec hex filename 18816 0 0 18816 4980 DES_bs_b.o-egcs-1.1.2 25360 0 0 25360 6310 DES_bs_b.o-ccc-6.2 The ccc version of the code runs 3 times slower on my 21164PC, where the stores are quite expensive (both versions still fit into the cache: this file contains three separate loops of about equal size). This was compiled with "-arch host -O2"; the code became even slower with "-O4", mostly because of the extra NOP's making it use more of the cache. These results are consistent with those for my other crypto codes. For example, ccc produces slightly better (than egcs) code for a traditional implementation of MD5 (which doesn't need much registers). However, for the two-hashes-at-a-time implementation (that adds some instruction-level parallelism), ccc does lots of unnecessary memory stores, as if it was running out of registers (there _are_ enough registers for that task, in reality). Once again, egcs uses the registers for my 2xMD5 code, so that it's almost twice faster than the ccc-compiled version. Is anyone else seeing similar behavior? -- /sd