Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cflags per Intel
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
Hal-10000
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2013
Posts: 120

PostPosted: Thu Sep 25, 2014 7:19 am    Post subject: cflags per Intel Reply with quote

Ciao, leggendo il post precedente mi sono chiesto anch'io se le impostazioni in make.conf siano adatte al mio processore che e' un intel core duo T2250 a 32 bit :
Code:
 $ grep -m1 -A3 "vendor_id" /proc/cpuinfo
vendor_id   : GenuineIntel
cpu family   : 6
model      : 14
model name   : Genuine Intel(R) CPU           T2250  @ 1.73GHz


questa e' l'impostazione che ho in make.conf che avevo tratto dal manuale di installazione di gentoo e che ho finora utilizzato

Code:
CFLAGS="-O2 -march=i686 -pipe"


In questa pagina del wiki invece http://wiki.gentoo.org/wiki/Safe_CFLAGS#Core_2_Duo si suggerisce una impostazione diversa, anche se pero' qui la cpu e' piu' recente (T7500) mentre la mia e' T2250 e l'esempio e' riferito ad un'architettura 64 bit.

Non so se possa servire, ma, quando ricompilo il kernel uso questa stringa
Code:
KCFLAGS="-march=native -O2 -pipe" KCPPFLAGS="-march=native -O2 -pipe" make -j3 && make modules_install && make install


Grazie per l'aiuto
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1014

PostPosted: Thu Sep 25, 2014 6:20 pm    Post subject: Reply with quote

ciao

se hai la flag "lm" (Long Mode) nelle flags del processore , allora è un 64 bit

Code:
# grep  -m1 lm /proc/cpuinfo


se hai installato da uno snapshot x86 ... mi sa che dovrai tornare indietro :roll: o continuare ad ottimizzare per i686

se lo snapshot era un amd64 , beh allora cambia ottimizzazione e buon lavoro ;)

PS : abilitando la USE "experimental" per i kernel , troverai nella configurazione del kernel alcune voci per il tipo di processore da ottimizzare (o meglio il codice da ottimizzare) oltre ad altri inserimenti , questo ti eviterà di passare i parametri ad ogni compilazione.

Code:
Processor type and features  --->
  Processor family (...) --->


vedi anche : https://wiki.gentoo.org/wiki/Project:Kernel/Experimental


PS : il tuo processore secondo le specifiche intel è un 32bit : http://ark.intel.com/products/27232/Intel-Core-Duo-Processor-T2250-%282M-Cache-1_73-GHz-533-MHz-FSB%29

per cui .... continua con 32 bit passando

i686
oppure
native se non vuoi sbattimenti

oppure aggiungi le flags manualmente secondo l'output di
Code:
# gcc -march=native -E -v - </dev/null 2>&1 | grep cc1


ci sono un paio di thread appena sotto a questo a riguardo
_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
Hal-10000
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2013
Posts: 120

PostPosted: Thu Sep 25, 2014 8:54 pm    Post subject: Reply with quote

Ciao sabayonino e grazie per la risposta.

Intanto sto cercando di capire qualcosa dell'argomento -che almeno per me non e' dei piu' facili- leggendo i precedenti thread e i vari link indicati. Quindi magari ti chiedero' qualche altra spiegazione in seguito.

Premesso cio' e confidando nella tua pazienza :lol: partirei dalla fine del tuo post, dove scrivi:
Quote:
.... continua con 32 bit passando

i686
oppure
native se non vuoi sbattimenti



Allora, visto che ho gia' i686 settato in make.conf
Code:
CFLAGS="-O2 -march=i686 -pipe"
lascio cosi, oppure sostituisco i686 con native?
Mi sembra, che secondo te la cosa sia pressocche' uguale.

Non devo quindi inserire core2 al posto di i686, come invece sembrerebbe dal qui http://wiki.gentoo.org/wiki/Safe_CFLAGS#Core_2_Duo dove si parla dei processori Core Duo, ma di una generazione piu' recente?


Quanto poi all'output di
Code:
gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
ho questo, ma non so come muovermi
Code:
gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
 /usr/libexec/gcc/i686-pc-linux-gnu/4.7.3/cc1 -E -quiet -v - -march=pentium-m -mno-cx16 -mno-sahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1014

PostPosted: Thu Sep 25, 2014 11:06 pm    Post subject: Reply with quote

la versione di gcc che stai utilizzando vede "-march" come Pentium-M se passi il parametro "native" più tutte le atre flags
Code:
-march=pentium-m -mno-cx16 -mno-sahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=generic



che si dice delle flags processore ? :wink:


Code:
# cat /proc/cpuinfo | tail  | grep flags

_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
Hal-10000
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2013
Posts: 120

PostPosted: Fri Sep 26, 2014 6:19 am    Post subject: Reply with quote

Quote:
la versione di gcc che stai utilizzando vede "-march" come Pentium-


Ecco, e' proprio questo il fatto. Lasciando tutto cosi', non ci sarebbe alcuna ottimizzazione per il tipo del mio processore che non e' un Pentium ma un Core Duo (di qualche anno fa) :? .


Ecco le info della cpu

Code:
 # cat /proc/cpuinfo | tail  | grep flags
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts aperfmperf pni monitor est tm2 xtpr pdcm dtherm


Devo precisare poi che nella configurazione del kernel
Code:
Processor type and features  --->
  Processor family (...) --->   
ho attivato Core Duo ...
Back to top
View user's profile Send private message
loxdegio
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2014
Posts: 94

PostPosted: Fri Sep 26, 2014 7:56 am    Post subject: Reply with quote

Io ho trovato questo link se può aiutare, secondo me la situazione è identica
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1014

PostPosted: Fri Sep 26, 2014 10:15 am    Post subject: Reply with quote

loxdegio wrote:
Io ho trovato questo link se può aiutare, secondo me la situazione è identica


Quote:
Intel Core Solo/Duo, Pentium Dual-Core T20xx/T21xx

vendor_id : GenuineIntel
cpu family : 6
model : 14, 22, 4
model name : Genuine Intel(R) CPU TXXXX @ X.XXGHz
model name : Intel(R) Celeron(R) CPU 220 @ 1.20GHz
model name : Intel(R) Celeron(R) CPU 4X0 @ X.XXGHz
model name : Intel(R) Celeron(R) M CPU 4X0 @ X.XXGHz

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Notes:

It has been confirmed by hongjiu.lu@intel.com that prescott is the correct microarchitecture to use with this CPU. http://article.gmane.org/gmane.comp.gcc.devel/83870
The newer (eg. 420) Celeron-M processors are Core Solo based, not Pentium-M based. If your processor's family and model are 6 and 14, then you should use the -march=prescott option.
Both the Celeron 4x0 and 220 run fine with Processor family (Pentium M) selected in the kernel.


dalle tue info precedenti :
Code:
cpu family   : 6
model      : 14



puoi vedere i cabiamenti della tua arch anche qua --> http://www.cpu-world.com/CPUs/Core_Duo/index.html

stando a quantp indicato dovreti utilizzare

Code:
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"

_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
Hal-10000
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2013
Posts: 120

PostPosted: Fri Sep 26, 2014 12:04 pm    Post subject: Reply with quote

Ohh, perfetto!!!

1000 grazie a loxdegio e sabayonino

a questo punto vado di


Code:
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"


e poi

Code:
# emerge -e world


mi confermate per favore?

(intanto aggiorno il backup, non si sa mai..) :P
Back to top
View user's profile Send private message
Hal-10000
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2013
Posts: 120

PostPosted: Tue Sep 30, 2014 7:07 am    Post subject: Reply with quote

Beh, per la ricompilazione di tutto il sistema ci ha messo circa 14 ore! Erano 916 pacchetti ed il portatile è un pò lentino.


Adesso con le nuove CFLAGS non è che abbia guadagnato gran che in termini di prestazioni, che, almeno ad occhio, sembrano invariate; poi non saprei.


Questo ovviamente sempre a condizione che il comando
Code:
emerge -e world
sia stato quello giusto :roll:
Back to top
View user's profile Send private message
Hal-10000
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2013
Posts: 120

PostPosted: Sat Oct 18, 2014 9:36 am    Post subject: Reply with quote

Scusate se ritorno sull'argomento, ma mi e' sorto un dubbio.

Avevo modificato le CFLAGS specificando il tipo di processore (prescott) per cui il make.conf adesso e' cosi
Code:
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"

mentre prima avevo
Code:
CFLAGS="-O2 -march=i686 -pipe"


e dopo ho dovuto ricompilare tutto il sistema con la nuova flag dando
Code:
emerge -e world
.
Ci e' voluta una giornata intera (!)


Ora mi chiedo se, prima di ricompilare tutto il sistema, avrei dovuto ricompilare il kernel con la nuova flag.
Mi spiego. Prima, quando installavo un nuovo kernel, lo ricompilavo cosi:
Code:
KCFLAGS="-march=native -O2 -pipe" KCPPFLAGS="-march=native -O2 -pipe" make -j3 && make modules_install && make install


Domanda:
adesso, dopo che ho cambiato la flag in make.conf, devo PRIMA ricompilare il kernel cosi:
Code:
KCFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer" KCPPFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer" make -j3 && make modules_install && make install


e POI ricompilare DI NUOVO tutto il sistema con
Code:
emerge -e world
???


Grazie per l'aiuto
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1014

PostPosted: Sat Oct 18, 2014 10:40 am    Post subject: Reply with quote

no. il kernel ha le sue opzioni a parte.

comunque se attivi la flag "experimental" ai gentoo-sources , alla voce "Processor Type and features" -->"Processor family"

avrai la possibilità di selezionare alcune flags di ottimizzazione

Code:

                                                               │  hotkey of the item you wish to select followed by the <SPACE │ 
                                                               │  BAR>. Press <?> for additional information about this        │ 
                                                               │ ┌───────────^(-)────────────────────────────────────────────┐ │ 
                                                               │ │       ( ) Intel Core i7                                   │ │ 
                                                               │ │       ( ) Intel Core 2nd Gen AVX                          │ │ 
                                                               │ │       ( ) Intel Core 3rd Gen AVX                          │ │ 
                                                               │ │       ( ) Intel Core AVX2                                 │ │ 
                                                               │ │       ( ) Generic-x86-64                                  │ │ 
                                                               │ │       (X) Native optimizations autodetected by GCC        │ │ 
                                                               │ └────────────────────────────────────────────────────




nel caso di autodeect
Code:
 CONFIG_MNATIVE:                                                                                                                                                                         │ 
  │                                                                                                                                                                                         │ 
  │                                                                                                                                                                                         │ 
  │ GCC 4.2 and above support -march=native, which automatically detects                                                                                                                    │ 
  │ the optimum settings to use based on your processor. -march=native                                                                                                                      │ 
  │ also detects and applies additional settings beyond -march specific                                                                                                                     │ 
  │ to your CPU, (eg. -msse4). Unless you have a specific reason not to                                                                                                                     │ 
  │ (e.g. distcc cross-compiling), you should probably be using                                                                                                                             │ 
  │ -march=native rather than anything listed below.                                                                                                                                        │ 
  │                                                                                                                                                                                         │ 
  │ Enables -march=native                                                                                                                                                                   │ 
  │                                                                                                                                                                                         │ 
  │ Symbol: MNATIVE [=y]                                                                                                                                                                    │ 
  │ Type  : boolean                                                                                                                                                                         │ 
  │ Prompt: Native optimizations autodetected by GCC                                                                                                                                        │ 
  │   Location:                                                                                                                                                                             │ 
  │     -> Processor type and features                                                                                                                                                      │ 
  │       -> Processor family (<choice> [=y])                                                                                                                                               │ 
  │   Defined at arch/x86/Kconfig.cpu:357                                                                                                                                                   │ 
  │   Depends on: <choice>                                                                                                                                                                  │ 
  │                       


e non necessita di passre i parametri manualmente (se non vuoi)
buon esperimento
_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
Hal-10000
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2013
Posts: 120

PostPosted: Sat Oct 18, 2014 6:46 pm    Post subject: Reply with quote

Grazie per la risposta. Sto sperimentando un pò :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum