Re: [lfs-support] Compiling gcc-4.9.2 from 7.7 without CMOV

2021-04-12 Thread Xi Ruoyao
On 2021-04-12 21:44 -0400, Michael Shell wrote:
> On Fri, 9 Apr 2021 10:46:30 -0400
> Chris Fowler  wrote:
> 
> > I am fully aware that other OSS packages could use CMOV with inline
> > assembly.  I'm just wanting GCC to forget it even exists when it tries to
> > implement CMOV during -03 optimization.
> 
> 
> I think the most correct approach for your CPU is just to invoke
> 
> -march=i586
> 
> to avoid the use of CMOV:
> 
> https://clfs-support.cross-lfs.narkive.com/x1E4tLvU/i586-target-with-cmov

You shouldn't need that.  If you need this, it means your GCC is misconfigured.
It may happen if you specify a wrong --with-arch value, or config.guess outputed
i686-pc-linux-gnu (which is wrong on 586).

I don't have an i586 so I can't test config.guess on it.  You can try to run it.
If it outputs i686, you can manually override it and report this as a bug, to
config.guess maintainers (not GCC maintainers: config.guess is a seperated
project at https://git.savannah.gnu.org/gitweb/?p=config.git).
-- 
Xi Ruoyao 
School of Aerospace Science and Technology, Xidian University

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] Compiling gcc-4.9.2 from 7.7 without CMOV

2021-04-12 Thread Michael Shell
On Fri, 9 Apr 2021 10:46:30 -0400
Chris Fowler  wrote:

> I am fully aware that other OSS packages could use CMOV with inline
> assembly.  I'm just wanting GCC to forget it even exists when it tries to
> implement CMOV during -03 optimization.


I think the most correct approach for your CPU is just to invoke

-march=i586

to avoid the use of CMOV:

https://clfs-support.cross-lfs.narkive.com/x1E4tLvU/i586-target-with-cmov

This page might also be of help:
https://stackoverflow.com/questions/60837883/removing-cmov-instructions-using-gcc-9-2-0-x86
which suggests adding the options (if you can't/don't use -march=i586)

-fdisable-tree-phiopt[1-4] and -fdisable-rtl-ce[1-3] 

Note that there is a -mno-cmov for gcc, but that only seems to be available
for the NDS32 platform:

https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Option-Summary.html

Sigh.


   Cheers,

   Mike Shell
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] Compiling gcc-4.9.2 from 7.7 without CMOV

2021-04-10 Thread Xi Ruoyao
On 2021-04-09 10:46 -0400, Chris Fowler wrote:
> I'm revisiting something I worked on a few years ago where I worked through 
> LFS
> 7.7 on a i586 device that lacks CMOV.   There are -march options for 'no MMX',
> but nothing for 'no CMOV'.  Where in the GCC source are those defined and can 
> I
> create one for 'no CMOV' before I start building /tools

> I am fully aware that other OSS packages could use CMOV with inline assembly. 
> I'm just wanting GCC to forget it even exists when it tries to implement CMOV
> during -03 optimization.

GCC won't generate CMOV if it can't make sure it's avaliable for the target.  If
you see some CMOV in your binaries, the possiblities are:

1. it comes from (maybe inline) assembly
2. some package have CMOV in (maybe inline) assembly, or it tells the compiler
to generate CMOV, it means either:
  (1) it is buggy, or
  (2) it has runtime checking to avoid execution of CMOV on platforms w/o it
3. you are using wrong -march setting
4. there is a GCC bug (unlikely - I just took a look at GCC code for checking if
CMOV is usable. The code seems correct.).

-- 
Xi Ruoyao 
School of Aerospace Science and Technology, Xidian University

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


[lfs-support] Compiling gcc-4.9.2 from 7.7 without CMOV

2021-04-09 Thread Chris Fowler
I'm revisiting something I worked on a few years ago where I worked through
LFS 7.7 on a i586 device that lacks CMOV.   There are -march options for
'no MMX', but nothing for 'no CMOV'.  Where in the GCC source are those
defined and can I create one for 'no CMOV' before I start building /tools

I am fully aware that other OSS packages could use CMOV with inline
assembly.  I'm just wanting GCC to forget it even exists when it tries to
implement CMOV during -03 optimization.

/proc/cpuinfo:
processor   : 0
vendor_id   : Genuine  RDC
cpu family  : 5
model   : 8
model name  : 05/08
stepping: 6
cpu MHz : 1000.136
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 1
wp  : yes
flags   : fpu tsc cx8 mmx up
bogomips: 2000.27
clflush size: 32
cache_alignment : 32
address sizes   : 32 bits physical, 32 bits virtual
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style