X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fia32%2Fia32_dbg_stat.h;h=ca367707879f8a2d6d118881fff069a77eb07a61;hb=1872920c09708b361d06c0dc9f4c1fd0a03544f5;hp=431c106a3ab0dd4b7b1a20a2cb40150d2f8c0ad4;hpb=d010bdc1939ae95c5791e8a86c303c1b235bb1e4;p=libfirm diff --git a/ir/be/ia32/ia32_dbg_stat.h b/ir/be/ia32/ia32_dbg_stat.h index 431c106a3..ca3677078 100644 --- a/ir/be/ia32/ia32_dbg_stat.h +++ b/ir/be/ia32/ia32_dbg_stat.h @@ -1,10 +1,30 @@ +/* + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + /** - * This file contains macros to update ia32 firm statistics - * @author Christian Wuerdig - * $Id$ + * @file + * @brief This file contains macros to update ia32 firm statistics. + * @author Christian Wuerdig + * @version $Id$ */ -#ifndef _IA32_DBG_STAT_H_ -#define _IA32_DBG_STAT_H_ +#ifndef FIRM_BE_IA32_IA32_DBG_STAT_H +#define FIRM_BE_IA32_IA32_DBG_STAT_H #include "irhooks.h" #include "dbginfo_t.h" @@ -18,12 +38,23 @@ * @param oldn the node * @param n the new lea */ -#define DBG_OPT_LEA1(oldn, n) \ +#define DBG_OPT_LEA1(oldn, n) \ do { \ hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_LEA); \ __dbg_info_merge_pair(n, oldn, dbg_backend); \ } while(0) +/** + * Merge the debug info due to a LEA creation. + * + * @param oldn the node + * @param n the new lea + */ +#define DBG_OPT_LEA1(oldn, n) \ + do { \ + hook_merge_nodes(&n, 1, &oldn, 1, FS_BE_IA32_LEA); \ + __dbg_info_merge_pair(n, oldn, dbg_backend); \ + } while(0) /** * Merge the debug info due to a LEA creation. @@ -119,7 +150,7 @@ * Merge the debug info due to a destination address mode creation. * * @param load the old load - * @param store yhe old store + * @param store the old store * @param n the new op */ #define DBG_OPT_AM_D(load, store, n) \ @@ -131,4 +162,72 @@ __dbg_info_merge_sets(&n, 1, ons, SIZ(ons), dbg_backend); \ } while(0) -#endif /* _IA32_DBG_STAT_H_ */ +/** + * A CJmp was created to save a cmp + * + * @param oldn the old node + */ +#define DBG_OPT_CJMP(oldn) \ + do { \ + hook_merge_nodes(NULL, 0, &oldn, 1, FS_BE_IA32_CJMP); \ + } while(0) + +/** + * A Copy was created to fulfill two address code constraints + * + * @param cpy the copy + */ +#define DBG_OPT_2ADDRCPY(cpy) \ + do { \ + hook_merge_nodes(NULL, 0, &cpy, 1, FS_BE_IA32_2ADDRCPY); \ + } while(0) + +/** + * A Store was created for a Spill + * + * @param spill the Spill + * @param store the Store + */ +#define DBG_OPT_SPILL2ST(spill, store) \ + do { \ + hook_merge_nodes(&store, 1, &spill, 1, FS_BE_IA32_SPILL2ST); \ + __dbg_info_merge_pair(store, spill, dbg_backend); \ + } while(0) + +/** + * A Load was created for a Reload + * + * @param rload the Reload + * @param load the Load + */ +#define DBG_OPT_RELOAD2LD(rload, load) \ + do { \ + hook_merge_nodes(&load, 1, &rload, 1, FS_BE_IA32_RELOAD2LD); \ + __dbg_info_merge_pair(load, rload, dbg_backend); \ + } while(0) + +/** + * A Sub was transformed into Neg-Add due to 2 address code limitations + * + * @param sub the old Sub + * @param nadd the new Add + */ +#define DBG_OPT_SUB2NEGADD(sub, nadd) \ + do { \ + hook_merge_nodes(&nadd, 1, &sub, 1, FS_BE_IA32_SUB2NEGADD); \ + __dbg_info_merge_pair(nadd, sub, dbg_backend); \ + } while(0) + +/** + * A Lea was transformed back into an Add + * + * @param lea the old Lea + * @param nadd the new Add + */ +#define DBG_OPT_LEA2ADD(lea, nadd) \ + do { \ + hook_merge_nodes(&nadd, 1, &lea, 1, FS_BE_IA32_LEA2ADD); \ + __dbg_info_merge_pair(nadd, lea, dbg_backend); \ + } while(0) + +#endif /* FIRM_BE_IA32_IA32_DBG_STAT_H */