Bug 26630

Summary: [SRPM] curious '-mcpu=k6' optimizations
Product: [Retired] Red Hat Raw Hide Reporter: Enrico Scholz <rh-bugzilla>
Component: zlibAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED NOTABUG QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: bcrl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-09 03:20:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Enrico Scholz 2001-02-08 01:22:28 UTC
zlib compiles with a '-mcpu=k6' on all (non-k6) ix86-platforms.

It would make more sense when writing

------------------
ZLIB_OPT_FLAGS=$RPM_OPT_FLAGS
%ifarch i386 i486 i586 i686
ZLIB_OPT_FLAGS="$ZLIB_OPT_FLAGS -O2 -fschedule-insns -fschedule-insns2
-malign-loops=1 -malign-jumps=1 -fomit
-frame-pointer"
%endif
------------------

instead of the formerly

------------------
%ifarch i386 i486 i586 i686
ZLIB_OPT_FLAGS="-mcpu=k6 -O2 -fschedule-insns -fschedule-insns2
-malign-loops=1 -malign-jumps=1 -fomit
-frame-pointer"
%else
ZLIB_OPT_FLAGS="$RPM_OPT_FLAGS"
%endif
------------------

code in zlib.spec. Because $RPM_OPT_FLAGS contains architecture specific
optimizations, an option corresponding to '-mcpu=k6' will be set by this
variant also.

Comment 1 Trond Eivind Glomsrxd 2001-02-09 03:20:19 UTC
This (the k6 flag) was added when Ben went on an optimization spree for zlib...
Ben, should the -march=k6 be there?

Comment 2 Ben LaHaise 2001-02-09 03:48:19 UTC
This is intentional.  Specifying K6 optimizations seems to have the best overall
performance for the Athlon/PIII/Pentium/K6 mix of CPUs (it makes a 30%
difference on K6s but only a ~3% difference for other cpus).  -march=k6 can't be
specified as the resulting code wouldn't run on 386/486s.