Previous 199869 Revisions Next

r23312 Friday 31st May, 2013 at 09:26:20 UTC by O. Galibert
inpttype.h: Use O1 instead of O0 on the critical function [Hans Ostermeyer]

Some benchmarking for different compilers and levels (seconds):
gcc 4.4.7: O0=ICE  O1=38.62 O2=58.13 O3=3721.11
gcc 4.5.4: O0=6.21 O1=25.63 O2=38.24 O3=3085.74
gcc 4.6.4: O0=4.95 O1=15.89 O2=32.94 O3=48.95
gcc 4.7.3: O0=6.11 O1=22.03 O2=126.41 O3=348.02

Hans tracked a wrong compile issue in 4.7 to the use of -O0.  That
table shows that -O1 is acceptable for everybody.  Note that it isn't
a time critical function, and it doesn't make sense to optimize it
much (it's a bunch of calls to another function which itself is
optimized and no computations).
[src/emu]inpttype.h

trunk/src/emu/inpttype.h
r23311r23312
4949   typelist.append(*global_alloc(input_type_entry(IPT_##_type, IPG_##_group, (_player == 0) ? _player : (_player) - 1, (_player == 0) ? #_type : ("P" #_player "_" #_type), _name, _seq, _decseq, _incseq)));
5050
5151#if defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
52__attribute__((optimize("O0")))
52__attribute__((optimize("O1")))
5353#endif
5454#ifdef _MSC_VER
5555#pragma optimize("", off)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team