2009-04-11 18:23 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/vm/Makefile
  * harbour/source/vm/vmmt/Makefile
  + harbour/source/vm/hvmall.c
    % added optional compilation HVM core files as single unit.
      It allows to use interprocedural optimizations for all defined
      functions. It's useful when compiler does not support IPO at link
      time. It should give some noticeable speed improvement for compilers
      which can benefit from such optimizations, f.e. GCC, ICC, MSVC.
      In my Linux box (GCC 4.3) it gives ~7% speed improvement in
      speedtst.prg linked with ST HVM and a little bit more in MT mode.
      It's interesting that it also reduces the HVM library size.
      At least for GCC builds.
      Set HB_HVM_ALL=yes envvar to enable such compilation.
      Warning some compiler may not compile such long single C file.
This commit is contained in:
Przemyslaw Czerpak
2009-04-11 16:16:08 +00:00
parent 806f4a9ad3
commit 3e2fc19b88
4 changed files with 150 additions and 32 deletions

View File

@@ -8,6 +8,22 @@
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2009-04-11 18:23 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/Makefile
* harbour/source/vm/vmmt/Makefile
+ harbour/source/vm/hvmall.c
% added optional compilation HVM core files as single unit.
It allows to use interprocedural optimizations for all defined
functions. It's useful when compiler does not support IPO at link
time. It should give some noticeable speed improvement for compilers
which can benefit from such optimizations, f.e. GCC, ICC, MSVC.
In my Linux box (GCC 4.3) it gives ~7% speed improvement in
speedtst.prg linked with ST HVM and a little bit more in MT mode.
It's interesting that it also reduces the HVM library size.
At least for GCC builds.
Set HB_HVM_ALL=yes envvar to enable such compilation.
Warning some compiler may not compile such long single C file.
2009-04-11 17:25 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/common/hbver.c
+ Added skeleton for hb_verHostCPU()

View File

@@ -24,41 +24,52 @@ else
endif
endif
ifeq ($(HB_HVM_ALL),yes)
C_SOURCES=\
hvmall.c \
else
C_SOURCES=\
hvm.c \
arrays.c \
arrayshb.c \
asort.c \
break.c \
classes.c \
cmdarg.c \
debug.c \
dynlibhb.c \
dynsym.c \
codebloc.c \
estack.c \
eval.c \
evalhb.c \
extend.c \
extrap.c \
fm.c \
garbage.c \
hashes.c \
itemapi.c \
macro.c \
memvars.c \
set.c \
thread.c \
endif
C_SOURCES+=\
arrayshb.c \
asort.c \
break.c \
cmdarg.c \
debug.c \
dynlibhb.c \
eval.c \
evalhb.c \
extrap.c \
hashfunc.c \
initexit.c \
initsymb.c \
itemapi.c \
macro.c \
$(C_MAIN) \
memvars.c \
memvclip.c \
pcount.c \
proc.c \
pvalue.c \
proc.c \
runner.c \
set.c \
thread.c \
vm.c \
$(C_MAIN) \
PRG_SOURCES=\
harbinit.prg \

View File

@@ -0,0 +1,80 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* common file with all HVM functions for compilers which can improve
* speed automatically inlining functions
*
* Copyright 2009 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
/* this #define HAVE TO be placed before all #include directives
*/
#define _HB_HASH_INTERNAL_
#define HB_MACRO_SUPPORT
#define HB_NO_FALTTEN
#define HB_STACK_LOCAL_MACROS
/* warning the order of included files is important
* due to macros used to overload some functions
*/
#include "hvm.c"
#include "itemapi.c"
#include "hashes.c"
#include "arrays.c"
#include "classes.c"
#include "codebloc.c"
#include "dynsym.c"
#include "macro.c"
#include "set.c"
#include "memvars.c"
#include "thread.c"
#include "garbage.c"
#include "fm.c"
#include "extend.c"
#include "estack.c"

View File

@@ -25,41 +25,52 @@ else
endif
endif
ifeq ($(HB_HVM_ALL),yes)
C_SOURCES=\
hvmall.c \
else
C_SOURCES=\
hvm.c \
arrays.c \
arrayshb.c \
asort.c \
break.c \
classes.c \
cmdarg.c \
debug.c \
dynlibhb.c \
dynsym.c \
codebloc.c \
estack.c \
eval.c \
evalhb.c \
extend.c \
extrap.c \
fm.c \
garbage.c \
hashes.c \
itemapi.c \
macro.c \
memvars.c \
set.c \
thread.c \
endif
C_SOURCES+=\
arrayshb.c \
asort.c \
break.c \
cmdarg.c \
debug.c \
dynlibhb.c \
eval.c \
evalhb.c \
extrap.c \
hashfunc.c \
initexit.c \
initsymb.c \
itemapi.c \
macro.c \
$(C_MAIN) \
memvars.c \
memvclip.c \
pcount.c \
proc.c \
pvalue.c \
proc.c \
runner.c \
set.c \
thread.c \
vm.c \
$(C_MAIN) \
PRG_SOURCES=\
harbinit.prg \