Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Dec 2000 14:14:43 -0800 (PST)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        "Daniel C. Sobral" <dcs@newsguy.com>
Cc:        John Baldwin <jhb@FreeBSD.ORG>, Jeroen Ruigrok van der Werven <asmodai@FreeBSD.ORG>, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/usr.bin/tail forward.c read.c reverse.c tail
Message-ID:  <200012072214.eB7MEhF13510@earth.backplane.com>
References:  <XFMail.001204105855.jhb@FreeBSD.org> <3A2EEF7B.6F8F2BE@newsguy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
:
:Not true. The register keyword is _not_ ignored and _does_ change
:register allocation. I know. I spent some time looking at the assembler
:code generated from regex, which makes extensive use of register
:keyword.
:
:-- 
:Daniel C. Sobral			(8-DCS)

    In general, there isn't much point in using 'register' any more.
    Old compilers only allocated registers when you told them to.  Newer
    compilers (generally anything newer then 15-20 years ago) will
    automatically allocate registers and the 'register' keyword will just
    mess around with the selection heuristic to make it 'more likely'.

    Not to mention the fact that declaring registers in one architecture
    to optimize code can very well deoptimize it for another architecture.

    This goes all the way back to the 'writing hand assembly to optimize the
    code' verses 'let the compiler do it' argument.  The 'let the compiler
    do it' argument eventually won, because porting assembly between
    architectures is rather difficult.  While the register keyword isn't
    quite that bad, the portability argument still holds.

    I still remember all the 'register'ized hand-optimized C code and
    embedded assembly in games and libraries specifically optimized for
    VAXen.   It's still very much in evidence... anyone remember all the
    garbage that used to be in the 'compress' program to make it go fast
    on a vax?  I sure do!


					-Matt


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012072214.eB7MEhF13510>