Programowanie w systemie UNIX/Kompilacja: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Linia 300:
==cpu-type==
 
Typy CPU wg (mikro)architektury:
* nocona
* core2
* nehalem
* corei7
* westmere
* sandybridge
* corei7-avx
* ivybridge
* core-avx-i
* haswell
* core-avx2
* broadwell
* skylake
* skylake-avx512
* cannonlake
* icelake-client
* icelake-server
* cascadelake
* tigerlake
* cooperlake
* bonnell
* atom
* silvermont
* slm
* goldmont
* goldmont-plus
* tremont
* knl
* knm
* x86-64
* x86-64-v2
* x86-64-v3
* x86-64-v4
* eden-x2
* nano
* nano-1000
* nano-2000
* nano-3000
* nano-x2
* eden-x4
* nano-x4
* k8
* k8-sse3
* opteron
* opteron-sse3
* athlon64
* athlon64-sse3
* athlon-fx
* amdfam10
* barcelona
* bdver1
* bdver2
* bdver3
* bdver4
* znver1
* znver2
* znver3
* btver1
* btver2
* native
 
Polecenie:
Linia 306 ⟶ 366:
 
Wygeneruj instrukcje dla typu procesora z rodziny <ref>[https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html gcc 86-Options]</ref>
 
 
 
<pre>
-march=CPU[,+EXTENSION...]
generate code for CPU and EXTENSION, CPU is one of:
generic32, generic64, i386, i486, i586, i686,
pentium, pentiumpro, pentiumii, pentiumiii, pentium4,
prescott, nocona, core, core2, corei7, l1om, k1om,
iamcu, k6, k6_2, athlon, opteron, k8, amdfam10,
bdver1, bdver2, bdver3, bdver4, znver1, znver2,
znver3, btver1, btver2
EXTENSION is combination of:
8087, 287, 387, 687, cmov, fxsr, mmx, sse, sse2,
sse3, sse4a, ssse3, sse4.1, sse4.2, sse4, avx, avx2,
avx512f, avx512cd, avx512er, avx512pf, avx512dq,
avx512bw, avx512vl, vmx, vmfunc, smx, xsave,
xsaveopt, xsavec, xsaves, aes, pclmul, fsgsbase,
rdrnd, f16c, bmi2, fma, fma4, xop, lwp, movbe, cx16,
ept, lzcnt, popcnt, hle, rtm, invpcid, clflush, nop,
syscall, rdtscp, 3dnow, 3dnowa, padlock, svme, sse4a,
abm, bmi, tbm, adx, rdseed, prfchw, smap, mpx, sha,
clflushopt, prefetchwt1, se1, clwb, avx512ifma,
avx512vbmi, avx512_4fmaps, avx512_4vnniw,
avx512_vpopcntdq, avx512_vbmi2, avx512_vnni,
avx512_bitalg, avx_vnni, clzero, mwaitx, ospke,
rdpid, ptwrite, ibt, shstk, gfni, vaes, vpclmulqdq,
wbnoinvd, pconfig, waitpkg, cldemote, amx_int8,
amx_bf16, amx_tile, movdiri, movdir64b, avx512_bf16,
avx512_vp2intersect, tdx, enqcmd, serialize, rdpru,
mcommit, sev_es, tsxldtrk, kl, widekl, uintr, hreset,
no87, no287, no387, no687, nocmov, nofxsr, nommx,
nosse, nosse2, nosse3, nosse4a, nossse3, nosse4.1,
nosse4.2, nosse4, noavx, noavx2, noavx512f,
noavx512cd, noavx512er, noavx512pf, noavx512dq,
noavx512bw, noavx512vl, noavx512ifma, noavx512vbmi,
noavx512_4fmaps, noavx512_4vnniw, noavx512_vpopcntdq,
noavx512_vbmi2, noavx512_vnni, noavx512_bitalg,
noavx_vnni, noibt, noshstk, noamx_int8, noamx_bf16,
noamx_tile, nomovdiri, nomovdir64b, noavx512_bf16,
noavx512_vp2intersect, notdx, noenqcmd, noserialize,
notsxldtrk, nokl, nowidekl, nouintr, nohreset
-mtune=CPU optimize for CPU, CPU is one of:
generic32, generic64, i8086, i186, i286, i386, i486,
i586, i686, pentium, pentiumpro, pentiumii,
pentiumiii, pentium4, prescott, nocona, core, core2,
corei7, l1om, k1om, iamcu, k6, k6_2, athlon, opteron,
k8, amdfam10, bdver1, bdver2, bdver3, bdver4, znver1,
znver2, znver3, btver1, btver2
</pre>
 
Pełną listę możemy otrzymać za popmocą
 
<pre>
gcc --target-help -march=foo
cc1: error: bad value (‘foo’) for ‘-march=’ switch
cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake tigerlake cooperlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 native
</pre>
 
=Testowanie programu =