Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

GCC 4.6.x invalid code generation (Developers)

posted by RayeR Homepage, CZ, 10.04.2012, 13:44

> GCC has always assumed an FPU, I think. But also I think Linux kernel has
> CMOV emulation (presumably via trapping SIGILL), so maybe that's why they
> don't care, it should always work. Even Clang (I think?) by default targets
> P4 w/ SSE2.

FPU is not needed/can be disabled. At work we had 2 small Vortex86 PC (without FPU) running debian linux. The first attempt running precompiled linux crashed on lack of FPU. But when recompiled kernel with disabled FPU and some other settings it started OK...

> True, but I don't know of a better way.

I think it shouln'd be hard to make such tool that will take ASM source, grep some sets of instructions organized by CPU family from newest to oldes and report what was used, e.g. in form of a histogram displaying e.g.
386 opcodes: 90%
486 opcodes: 9%
586 opcodes: 1%
686 opcodes: 0%
...
I wonder if there doesn't exist such tool...

> Dunno, try
> gcc281b.zip,
> and see what happens. It shouldn't make any CMOVs ... ever! ;-)

Hm but old GCC doesn't support C99 and other GNU extension - useless for newer sources.

> EDIT: If it were me, I'd totally revert to a non-buggy patch in GCC trunk,
> but alas it's not my call (and obviously I don't have repo write access).
> Also, I think CMOV optimizations are hugely overrated, but silly GCC is
> obsessed with them for whatever reason.

Now I think that the problem is more caused by invalid objdump disassembly rather than invalid gcc code emision. I compared some programs that objdump reported contain CMOV with IDA disassembler and IDA didn's found any CMOV there. I don't know what other tool use to disassembly djgpp coffs to confirm it. In case of X264 the CMOVs also come from assembler modules that cannot be disabled so there's no way to make fully 586 valid code without further mods in ASM...

---
DOS gives me freedom to unlimited HW access.

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum