graysky2 / kernel_compiler_patch

Kernel patch enables compiler optimizations for additional CPUs.
GNU General Public License v2.0
652 stars 76 forks source link

Atom mtune flags #39

Closed herfenara closed 5 years ago

herfenara commented 5 years ago

Hello, just wondering why -march for atom defines -mtune for both bonnell and generic? Which is actually used?

graysky2 commented 5 years ago

That was taken from upstream (ie unpatched) kernel code: https://github.com/torvalds/linux/blob/master/arch/x86/Makefile#L126

Could it be a mistake upsteam? Possible. I do not have an atom processor to test changing it to march=bonnel and mtune=bonnel. Do you?

What's the output of gcc -c -Q -march=native --help=target

herfenara commented 5 years ago

I do! Output as follows:

The following options are target specific: -m128bit-long-double [enabled] -m16 [disabled] -m32 [disabled] -m3dnow [disabled] -m3dnowa [disabled] -m64 [enabled] -m80387 [enabled] -m8bit-idiv [disabled] -m96bit-long-double [disabled] -mabi= sysv -mabm [disabled] -maccumulate-outgoing-args [enabled] -maddress-mode= long -madx [disabled] -maes [disabled] -malign-data= compat -malign-double [disabled] -malign-functions= 0 -malign-jumps= 0 -malign-loops= 0 -malign-stringops [enabled] -mandroid [disabled] -march= bonnell -masm= att -mavx [disabled] -mavx2 [disabled] -mavx256-split-unaligned-load [disabled] -mavx256-split-unaligned-store [disabled] -mavx5124fmaps [disabled] -mavx5124vnniw [disabled] -mavx512bw [disabled] -mavx512cd [disabled] -mavx512dq [disabled] -mavx512er [disabled] -mavx512f [disabled] -mavx512ifma [disabled] -mavx512pf [disabled] -mavx512vbmi [disabled] -mavx512vl [disabled] -mavx512vpopcntdq [disabled] -mbionic [disabled] -mbmi [disabled] -mbmi2 [disabled] -mbranch-cost= 3 -mcld [disabled] -mclflushopt [disabled] -mclwb [disabled] -mclzero [disabled] -mcmodel= [default] -mcpu=
-mcrc32 [disabled] -mcx16 [enabled] -mdispatch-scheduler [disabled] -mdump-tune-features [disabled] -mf16c [disabled] -mfancy-math-387 [enabled] -mfentry [disabled] -mfma [disabled] -mfma4 [disabled] -mforce-drap [disabled] -mfp-ret-in-387 [enabled] -mfpmath= sse -mfsgsbase [disabled] -mfunction-return= keep -mfused-madd
-mfxsr [enabled] -mgeneral-regs-only [disabled] -mglibc [enabled] -mhard-float [enabled] -mhle [disabled] -miamcu [disabled] -mieee-fp [enabled] -mincoming-stack-boundary= 0 -mindirect-branch-register [disabled] -mindirect-branch= keep -minline-all-stringops [disabled] -minline-stringops-dynamically [disabled] -mintel-syntax
-mlarge-data-threshold= 65536 -mlong-double-128 [disabled] -mlong-double-64 [disabled] -mlong-double-80 [enabled] -mlwp [disabled] -mlzcnt [disabled] -mmemcpy-strategy=
-mmemset-strategy=
-mmitigate-rop [disabled] -mmmx [enabled] -mmovbe [enabled] -mmpx [disabled] -mms-bitfields [disabled] -mmusl [disabled] -mmwaitx [disabled] -mno-align-stringops [disabled] -mno-default [disabled] -mno-fancy-math-387 [disabled] -mno-push-args [disabled] -mno-red-zone [disabled] -mno-sse4 [enabled] -mnop-mcount [disabled] -momit-leaf-frame-pointer [disabled] -mpc32 [disabled] -mpc64 [disabled] -mpc80 [disabled] -mpclmul [disabled] -mpcommit [disabled] -mpku [disabled] -mpopcnt [disabled] -mprefer-avx128 [disabled] -mpreferred-stack-boundary= 0 -mprefetchwt1 [disabled] -mprfchw [disabled] -mpush-args [enabled] -mrdpid [disabled] -mrdrnd [disabled] -mrdseed [disabled] -mrecip [disabled] -mrecip=
-mrecord-mcount [disabled] -mred-zone [enabled] -mregparm= 6 -mrtd [disabled] -mrtm [disabled] -msahf [enabled] -msgx [disabled] -msha [disabled] -mskip-rax-setup [disabled] -msoft-float [disabled] -msse [enabled] -msse2 [enabled] -msse2avx [disabled] -msse3 [enabled] -msse4 [disabled] -msse4.1 [disabled] -msse4.2 [disabled] -msse4a [disabled] -msse5
-msseregparm [disabled] -mssse3 [enabled] -mstack-arg-probe [disabled] -mstack-protector-guard= tls -mstackrealign [disabled] -mstringop-strategy= [default] -mstv [enabled] -mtbm [disabled] -mtls-dialect= gnu -mtls-direct-seg-refs [enabled] -mtune-ctrl=
-mtune= bonnell -muclibc [disabled] -mveclibabi= [default] -mvect8-ret-in-mem [disabled] -mvzeroupper [enabled] -mx32 [disabled] -mxop [disabled] -mxsave [disabled] -mxsavec [disabled] -mxsaveopt [disabled] -mxsaves [disabled]

Known assembler dialects (for use with the -masm= option): att intel

Known ABIs (for use with the -mabi= option): ms sysv

Known code models (for use with the -mcmodel= option): 32 kernel large medium small

Valid arguments to -mfpmath=: 387 387+sse 387,sse both sse sse+387 sse,387

Known indirect branch choices (for use with the -mindirect-branch=/-mfunction-return= options): keep thunk thunk-extern thunk-inline

Known data alignment choices (for use with the -malign-data= option): abi cacheline compat

Known vectorization library ABIs (for use with the -mveclibabi= option): acml svml

Known address mode (for use with the -maddress-mode= option): long short

Known stack protector guard (for use with the -mstack-protector-guard= option): global tls

Valid arguments to -mstringop-strategy=: byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop vector_loop

Known TLS dialects (for use with the -mtls-dialect= option): gnu gnu2

herfenara commented 5 years ago

May I ask how I could change it manually?

graysky2 commented 5 years ago

Try: https://github.com/graysky2/kernel_gcc_patch/commit/24064a361f6f3cfce244f4b92ba7fb8b98fecf3d

graysky2 commented 5 years ago

@herfenara - Any feedback good or bad?

herfenara commented 5 years ago

Sorry, had so much course work. Compiling now!

herfenara commented 5 years ago

All went smoothly. Certainly feels faster :)

graysky2 commented 5 years ago

I'm not sure if it makes a difference or not, but no perceived regressions is good.

krasCGQ commented 5 years ago

@herfenara: It's not defining 2 mtune flags, but rather like this:

graysky2 commented 5 years ago

@krasCGQ - Then https://github.com/graysky2/kernel_gcc_patch/commit/d500f8451890971ecd6284f71c665c734c3ee191 should be reverted.