From 0661f846bdd4ef584ab5d0e85e3fecf74a1d9922 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 13 Sep 2012 17:32:42 +0000 Subject: Email address change in misc/ git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5144 42af7a65-404d-4744-a932-0658087f49c3 --- misc/pascal/insn32/Makefile | 2 +- misc/pascal/insn32/include/builtins.h | 2 +- misc/pascal/insn32/include/pexec.h | 2 +- misc/pascal/insn32/include/pinsn32.h | 2 +- misc/pascal/insn32/include/rinsn32.h | 2 +- misc/pascal/insn32/libinsn/Makefile | 2 +- misc/pascal/insn32/libinsn/paddopcode.c | 2 +- misc/pascal/insn32/libinsn/paddtmpopcode.c | 2 +- misc/pascal/insn32/libinsn/pdasm.c | 2 +- misc/pascal/insn32/libinsn/pgen.c | 2 +- misc/pascal/insn32/libinsn/pgetopcode.c | 2 +- misc/pascal/insn32/libinsn/preloc.c | 2 +- misc/pascal/insn32/libinsn/presettmpopcodewrite.c | 2 +- misc/pascal/insn32/plist/Makefile | 2 +- misc/pascal/insn32/plist/plist.c | 2 +- misc/pascal/insn32/popt/Makefile | 2 +- misc/pascal/insn32/popt/pcopt.c | 2 +- misc/pascal/insn32/popt/pcopt.h | 94 +-- misc/pascal/insn32/popt/pfopt.c | 2 +- misc/pascal/insn32/popt/pfopt.h | 108 +-- misc/pascal/insn32/popt/pjopt.c | 898 +++++++++++----------- misc/pascal/insn32/popt/pjopt.h | 88 +-- misc/pascal/insn32/popt/plopt.c | 2 +- misc/pascal/insn32/popt/plopt.h | 86 +-- misc/pascal/insn32/popt/polocal.c | 542 ++++++------- misc/pascal/insn32/popt/polocal.h | 146 ++-- misc/pascal/insn32/popt/popt.c | 654 ++++++++-------- misc/pascal/insn32/popt/popt.h | 104 +-- misc/pascal/insn32/popt/psopt.c | 2 +- misc/pascal/insn32/popt/psopt.h | 108 +-- misc/pascal/insn32/regm/Makefile | 2 +- misc/pascal/insn32/regm/regm.c | 2 +- misc/pascal/insn32/regm/regm.h | 2 +- misc/pascal/insn32/regm/regm_pass1.c | 2 +- misc/pascal/insn32/regm/regm_pass1.h | 116 +-- misc/pascal/insn32/regm/regm_pass2.c | 2 +- misc/pascal/insn32/regm/regm_pass2.h | 2 +- misc/pascal/insn32/regm/regm_registers2.c | 2 +- misc/pascal/insn32/regm/regm_registers2.h | 2 +- misc/pascal/insn32/regm/regm_tree.c | 2 +- misc/pascal/insn32/regm/regm_tree.h | 2 +- 41 files changed, 1502 insertions(+), 1502 deletions(-) (limited to 'misc/pascal/insn32') diff --git a/misc/pascal/insn32/Makefile b/misc/pascal/insn32/Makefile index a456dc25b..d02de859b 100644 --- a/misc/pascal/insn32/Makefile +++ b/misc/pascal/insn32/Makefile @@ -2,7 +2,7 @@ # insn32/Makefile # # Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/include/builtins.h b/misc/pascal/insn32/include/builtins.h index 04aacfde9..6fe3dc919 100644 --- a/misc/pascal/insn32/include/builtins.h +++ b/misc/pascal/insn32/include/builtins.h @@ -3,7 +3,7 @@ * Definitions of built-in function calls. * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/include/pexec.h b/misc/pascal/insn32/include/pexec.h index 6a52ff95d..647a1d88c 100644 --- a/misc/pascal/insn32/include/pexec.h +++ b/misc/pascal/insn32/include/pexec.h @@ -2,7 +2,7 @@ * pexec.h * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/include/pinsn32.h b/misc/pascal/insn32/include/pinsn32.h index 29cf363e7..eaceeba7e 100644 --- a/misc/pascal/insn32/include/pinsn32.h +++ b/misc/pascal/insn32/include/pinsn32.h @@ -3,7 +3,7 @@ * 32-bit P-code operation code definitions * * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/include/rinsn32.h b/misc/pascal/insn32/include/rinsn32.h index 8894023ff..8826eefb1 100644 --- a/misc/pascal/insn32/include/rinsn32.h +++ b/misc/pascal/insn32/include/rinsn32.h @@ -3,7 +3,7 @@ * 32-bit register module instruction definitions * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/libinsn/Makefile b/misc/pascal/insn32/libinsn/Makefile index 04ea4cee8..4814bdf9d 100644 --- a/misc/pascal/insn32/libinsn/Makefile +++ b/misc/pascal/insn32/libinsn/Makefile @@ -2,7 +2,7 @@ # insn32/libinsn/Makefile # # Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/libinsn/paddopcode.c b/misc/pascal/insn32/libinsn/paddopcode.c index 2f873eb7f..6799fdbc6 100644 --- a/misc/pascal/insn32/libinsn/paddopcode.c +++ b/misc/pascal/insn32/libinsn/paddopcode.c @@ -3,7 +3,7 @@ * P-Code access utilities * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/libinsn/paddtmpopcode.c b/misc/pascal/insn32/libinsn/paddtmpopcode.c index e4e10b458..e08cccc51 100644 --- a/misc/pascal/insn32/libinsn/paddtmpopcode.c +++ b/misc/pascal/insn32/libinsn/paddtmpopcode.c @@ -3,7 +3,7 @@ * P-Code access utilities * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/libinsn/pdasm.c b/misc/pascal/insn32/libinsn/pdasm.c index 31d45088f..e0968b43b 100644 --- a/misc/pascal/insn32/libinsn/pdasm.c +++ b/misc/pascal/insn32/libinsn/pdasm.c @@ -3,7 +3,7 @@ * P-Code Disassembler * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/libinsn/pgen.c b/misc/pascal/insn32/libinsn/pgen.c index a3219d388..e92cc98f4 100644 --- a/misc/pascal/insn32/libinsn/pgen.c +++ b/misc/pascal/insn32/libinsn/pgen.c @@ -3,7 +3,7 @@ * P-Code generation logic * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/libinsn/pgetopcode.c b/misc/pascal/insn32/libinsn/pgetopcode.c index bbcc011e9..a6f9507b2 100644 --- a/misc/pascal/insn32/libinsn/pgetopcode.c +++ b/misc/pascal/insn32/libinsn/pgetopcode.c @@ -3,7 +3,7 @@ * P-Code access utilities * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/libinsn/preloc.c b/misc/pascal/insn32/libinsn/preloc.c index b752abba5..7c0999219 100644 --- a/misc/pascal/insn32/libinsn/preloc.c +++ b/misc/pascal/insn32/libinsn/preloc.c @@ -3,7 +3,7 @@ * Perform P-Code relocations * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/libinsn/presettmpopcodewrite.c b/misc/pascal/insn32/libinsn/presettmpopcodewrite.c index e4e10b458..e08cccc51 100644 --- a/misc/pascal/insn32/libinsn/presettmpopcodewrite.c +++ b/misc/pascal/insn32/libinsn/presettmpopcodewrite.c @@ -3,7 +3,7 @@ * P-Code access utilities * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/plist/Makefile b/misc/pascal/insn32/plist/Makefile index 506cdfee2..d74839878 100644 --- a/misc/pascal/insn32/plist/Makefile +++ b/misc/pascal/insn32/plist/Makefile @@ -2,7 +2,7 @@ # insn32/plist/Makefile # # Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/plist/plist.c b/misc/pascal/insn32/plist/plist.c index d57e7deb7..a1667c7c2 100644 --- a/misc/pascal/insn32/plist/plist.c +++ b/misc/pascal/insn32/plist/plist.c @@ -3,7 +3,7 @@ * POFF file lister * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/popt/Makefile b/misc/pascal/insn32/popt/Makefile index 6073ff165..760c18fca 100644 --- a/misc/pascal/insn32/popt/Makefile +++ b/misc/pascal/insn32/popt/Makefile @@ -2,7 +2,7 @@ # insn32/popt/Makefile # # Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/popt/pcopt.c b/misc/pascal/insn32/popt/pcopt.c index 2c4c1fa01..a0c0a0226 100644 --- a/misc/pascal/insn32/popt/pcopt.c +++ b/misc/pascal/insn32/popt/pcopt.c @@ -3,7 +3,7 @@ * Constant Expression Optimizations * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/popt/pcopt.h b/misc/pascal/insn32/popt/pcopt.h index f638fcf28..0c3d453b9 100644 --- a/misc/pascal/insn32/popt/pcopt.h +++ b/misc/pascal/insn32/popt/pcopt.h @@ -1,47 +1,47 @@ -/*************************************************************************** - * pcopt.h - * External Declarations associated with PCOPT.C - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ***************************************************************************/ - -#ifndef __PCOPT_H -#define __PCOPT_H - -/*************************************************************************** - * Global Function Prototypes - ***************************************************************************/ - -extern int unaryOptimize ( void ); -extern int binaryOptimize ( void ); - -#endif /* __PCOPT_H */ +/*************************************************************************** + * pcopt.h + * External Declarations associated with PCOPT.C + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ***************************************************************************/ + +#ifndef __PCOPT_H +#define __PCOPT_H + +/*************************************************************************** + * Global Function Prototypes + ***************************************************************************/ + +extern int unaryOptimize ( void ); +extern int binaryOptimize ( void ); + +#endif /* __PCOPT_H */ diff --git a/misc/pascal/insn32/popt/pfopt.c b/misc/pascal/insn32/popt/pfopt.c index cf71fe005..a9f1659c6 100644 --- a/misc/pascal/insn32/popt/pfopt.c +++ b/misc/pascal/insn32/popt/pfopt.c @@ -3,7 +3,7 @@ * Finalization of optimized image * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/popt/pfopt.h b/misc/pascal/insn32/popt/pfopt.h index d792d11bf..07ce738b1 100644 --- a/misc/pascal/insn32/popt/pfopt.h +++ b/misc/pascal/insn32/popt/pfopt.h @@ -1,54 +1,54 @@ -/*************************************************************************** - * pfopt.h - * External Declarations associated with pfopt.c - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ***************************************************************************/ - -#ifndef __PFOPT_H -#define __PFOPT_H - -/*************************************************************************** - * Included Files - ***************************************************************************/ - -#include "pofflib.h" - -/*************************************************************************** - * Global Function Prototypes - ***************************************************************************/ - -extern void optFinalize(poffHandle_t poffHandle, - poffProgHandle_t poffProgHandle); - -#endif /* __PFOPT_H */ - +/*************************************************************************** + * pfopt.h + * External Declarations associated with pfopt.c + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ***************************************************************************/ + +#ifndef __PFOPT_H +#define __PFOPT_H + +/*************************************************************************** + * Included Files + ***************************************************************************/ + +#include "pofflib.h" + +/*************************************************************************** + * Global Function Prototypes + ***************************************************************************/ + +extern void optFinalize(poffHandle_t poffHandle, + poffProgHandle_t poffProgHandle); + +#endif /* __PFOPT_H */ + diff --git a/misc/pascal/insn32/popt/pjopt.c b/misc/pascal/insn32/popt/pjopt.c index c10962d3c..17b77c4ef 100644 --- a/misc/pascal/insn32/popt/pjopt.c +++ b/misc/pascal/insn32/popt/pjopt.c @@ -1,449 +1,449 @@ -/********************************************************************** - * pjopt.c - * Branch Optimizations - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - **********************************************************************/ - -/********************************************************************** - * Included Files - **********************************************************************/ - -#include - -#include "keywords.h" -#include "pdefs.h" -#include "pinsn32.h" - -#include "popt.h" -#include "polocal.h" -#include "pjopt.h" - -/**********************************************************************/ - -int BranchOptimize (void) -{ - int nchanges = 0; - register int i; - - TRACE(stderr, "[BranchOptimize]"); - - /* At least two pcodes are need to perform branch optimizations */ - - i = 0; - while (i < nops-1) - { - switch (pptr[i]->op) - { - case oNOT : - switch (pptr[i+1]->op) - { - case oJEQUZ : - pptr[i+1]->op = oJNEQZ; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJEQUZ; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oNEG : - switch (pptr[i+1]->op) - { - case oJLTZ : - pptr[i+1]->op = oJGTZ; - deletePcode(i); - nchanges++; - break; - - case oJGTEZ : - pptr[i+1]->op = oJLTEZ; - deletePcode(i); - nchanges++; - break; - - case oJGTZ : - pptr[i+1]->op = oJLTZ; - deletePcode(i); - nchanges++; - break; - - case oJLTEZ : - pptr[i+1]->op = oJGTEZ; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oEQU : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oNEQ; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJNEQ; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJEQU; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oNEQ : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oEQU; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJEQU; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJNEQ; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oLT : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oGTE; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJGTE; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJLT; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oGTE : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oLT; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJLT; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJGTE; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oGT : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oLTE; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJLTE; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJGT; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oLTE : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oGT; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJGT; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJLTE; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oEQUZ : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oNEQZ; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJNEQZ; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJEQUZ; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oNEQZ : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oEQUZ; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - case oJNEQZ : - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oLTZ : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oGTEZ; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJGTEZ; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJLTZ; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oGTEZ : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oLTZ; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJLTZ; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJGTEZ; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oGTZ : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oLTEZ; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJLTEZ; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJGTZ; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - case oLTEZ : - switch (pptr[i+1]->op) - { - case oNOT : - pptr[i]->op = oGTZ; - deletePcode(i+1); - nchanges++; - break; - - case oJEQUZ : - pptr[i+1]->op = oJGTZ; - deletePcode(i); - nchanges++; - break; - - case oJNEQZ : - pptr[i+1]->op = oJLTEZ; - deletePcode(i); - nchanges++; - break; - - default : - i++; - break; - } /* end switch */ - break; - - default : - i++; - break; - } /* end switch */ - } /* end while */ - return (nchanges); - -} /* end BranchOptimize */ - -/**********************************************************************/ - +/********************************************************************** + * pjopt.c + * Branch Optimizations + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include + +#include "keywords.h" +#include "pdefs.h" +#include "pinsn32.h" + +#include "popt.h" +#include "polocal.h" +#include "pjopt.h" + +/**********************************************************************/ + +int BranchOptimize (void) +{ + int nchanges = 0; + register int i; + + TRACE(stderr, "[BranchOptimize]"); + + /* At least two pcodes are need to perform branch optimizations */ + + i = 0; + while (i < nops-1) + { + switch (pptr[i]->op) + { + case oNOT : + switch (pptr[i+1]->op) + { + case oJEQUZ : + pptr[i+1]->op = oJNEQZ; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJEQUZ; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oNEG : + switch (pptr[i+1]->op) + { + case oJLTZ : + pptr[i+1]->op = oJGTZ; + deletePcode(i); + nchanges++; + break; + + case oJGTEZ : + pptr[i+1]->op = oJLTEZ; + deletePcode(i); + nchanges++; + break; + + case oJGTZ : + pptr[i+1]->op = oJLTZ; + deletePcode(i); + nchanges++; + break; + + case oJLTEZ : + pptr[i+1]->op = oJGTEZ; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oEQU : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oNEQ; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJNEQ; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJEQU; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oNEQ : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oEQU; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJEQU; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJNEQ; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oLT : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oGTE; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJGTE; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJLT; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oGTE : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oLT; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJLT; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJGTE; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oGT : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oLTE; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJLTE; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJGT; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oLTE : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oGT; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJGT; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJLTE; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oEQUZ : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oNEQZ; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJNEQZ; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJEQUZ; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oNEQZ : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oEQUZ; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + case oJNEQZ : + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oLTZ : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oGTEZ; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJGTEZ; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJLTZ; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oGTEZ : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oLTZ; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJLTZ; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJGTEZ; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oGTZ : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oLTEZ; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJLTEZ; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJGTZ; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + case oLTEZ : + switch (pptr[i+1]->op) + { + case oNOT : + pptr[i]->op = oGTZ; + deletePcode(i+1); + nchanges++; + break; + + case oJEQUZ : + pptr[i+1]->op = oJGTZ; + deletePcode(i); + nchanges++; + break; + + case oJNEQZ : + pptr[i+1]->op = oJLTEZ; + deletePcode(i); + nchanges++; + break; + + default : + i++; + break; + } /* end switch */ + break; + + default : + i++; + break; + } /* end switch */ + } /* end while */ + return (nchanges); + +} /* end BranchOptimize */ + +/**********************************************************************/ + diff --git a/misc/pascal/insn32/popt/pjopt.h b/misc/pascal/insn32/popt/pjopt.h index 4564ec6c6..75a0b64f2 100644 --- a/misc/pascal/insn32/popt/pjopt.h +++ b/misc/pascal/insn32/popt/pjopt.h @@ -1,44 +1,44 @@ -/*************************************************************************** - * pjopt.h - * External Declarations associated with pjopt.c - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ***************************************************************************/ - -#ifndef __PJOPT_H -#define __PJOPT_H - -extern int BranchOptimize ( void ); - -#endif __PJOPT_H - - +/*************************************************************************** + * pjopt.h + * External Declarations associated with pjopt.c + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ***************************************************************************/ + +#ifndef __PJOPT_H +#define __PJOPT_H + +extern int BranchOptimize ( void ); + +#endif __PJOPT_H + + diff --git a/misc/pascal/insn32/popt/plopt.c b/misc/pascal/insn32/popt/plopt.c index b0a469533..05e8559ef 100644 --- a/misc/pascal/insn32/popt/plopt.c +++ b/misc/pascal/insn32/popt/plopt.c @@ -3,7 +3,7 @@ * Load/Store Optimizations * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/popt/plopt.h b/misc/pascal/insn32/popt/plopt.h index 05596cd45..3783cf400 100644 --- a/misc/pascal/insn32/popt/plopt.h +++ b/misc/pascal/insn32/popt/plopt.h @@ -1,43 +1,43 @@ -/*************************************************************************** - * plopt.h - * External Declarations associated with plopt.c - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ***************************************************************************/ - -#ifndef __PLOPT_H -#define __PLOPT_H - -extern int LoadOptimize ( void ); -extern int StoreOptimize ( void ); - -#endif /* __PLOPT_H */ +/*************************************************************************** + * plopt.h + * External Declarations associated with plopt.c + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ***************************************************************************/ + +#ifndef __PLOPT_H +#define __PLOPT_H + +extern int LoadOptimize ( void ); +extern int StoreOptimize ( void ); + +#endif /* __PLOPT_H */ diff --git a/misc/pascal/insn32/popt/polocal.c b/misc/pascal/insn32/popt/polocal.c index 551913a49..036182372 100644 --- a/misc/pascal/insn32/popt/polocal.c +++ b/misc/pascal/insn32/popt/polocal.c @@ -1,271 +1,271 @@ -/********************************************************************** - * polocal.c - * P-Code Local Optimizer - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - **********************************************************************/ - -/********************************************************************** - * Included Files - **********************************************************************/ - -#include - -#include "keywords.h" -#include "podefs.h" -#include "pinsn32.h" - -#include "pofflib.h" -#include "paslib.h" -#include "pinsn.h" -#include "pcopt.h" -#include "plopt.h" -#include "pjopt.h" -#include "polocal.h" - -/********************************************************************** - * Private Function Prototypes - **********************************************************************/ - -static void initPTable (void); -static void putPCodeFromTable (void); -static void setupPointer (void); - -/********************************************************************** - * Global Variables - **********************************************************************/ - -OPTYPE ptable [WINDOW]; /* Pcode Table */ -OPTYPE *pptr [WINDOW]; /* Valid Pcode Pointers */ - -int nops = 0; /* No. Valid Pcode Pointers */ -int end_out = 0; /* 1 = oEND pcode has been output */ - -/********************************************************************** - * Private Variables - **********************************************************************/ - -static poffHandle_t myPoffHandle; /* Handle to POFF object */ -static poffProgHandle_t myPoffProgHandle;/* Handle to temporary POFF object */ - -/********************************************************************** - * Global Functions - **********************************************************************/ - -/***********************************************************************/ - -void localOptimization(poffHandle_t poffHandle, - poffProgHandle_t poffProgHandle) -{ - int nchanges; - - TRACE(stderr, "[pass2]"); - - /* Save the handles for use by other, private functions */ - - myPoffHandle = poffHandle; - myPoffProgHandle = poffProgHandle; - - /* Initialization */ - - initPTable(); - - /* Outer loop traverse the file op-code by op-code until the oEND P-Code - * has been output. NOTE: it is assumed throughout that oEND is the - * final P-Code in the program data section. - */ - - while (!(end_out)) - { - /* The inner loop optimizes the buffered P-Codes until no further - * changes can be made. Then the outer loop will advance the buffer - * by one P-Code - */ - - do - { - nchanges = unaryOptimize (); - nchanges += binaryOptimize(); - nchanges += BranchOptimize(); - nchanges += LoadOptimize(); - nchanges += StoreOptimize(); - } while (nchanges); - - putPCodeFromTable(); - } -} - -/***********************************************************************/ - -void deletePcode(int delIndex) -{ - TRACE(stderr, "[deletePcode]"); - - PUTOP(pptr[delIndex], oNOP); - PUTARG(pptr[delIndex], 0); - setupPointer(); -} - -/**********************************************************************/ - -void deletePcodePair(int delIndex1, int delIndex2) -{ - TRACE(stderr, "[deletePcodePair]"); - - PUTOP(pptr[delIndex1], oNOP); - PUTARG(pptr[delIndex1], 0); - PUTOP(pptr[delIndex2], oNOP); - PUTARG(pptr[delIndex2], 0); - setupPointer(); -} - -/********************************************************************** - * Private Functions - **********************************************************************/ - -/***********************************************************************/ - -static void putPCodeFromTable(void) -{ - register int i; - - TRACE(stderr, "[putPCodeFromTable]"); - - /* Transfer all buffered P-Codes (except NOPs) to the optimized file */ - do - { - if ((GETOP(&ptable[0]) != oNOP) && !(end_out)) - { - insn_AddTmpOpCode(myPoffProgHandle, &ptable[0]); - end_out = (GETOP(&ptable[0]) == oEND); - } - - /* Move all P-Codes down one slot */ - - for (i = 1; i < WINDOW; i++) - { - ptable[i-1] = ptable[i]; - } - - /* Then fill the end slot with a new P-Code from the input file */ - - insn_GetOpCode(myPoffHandle, &ptable[WINDOW-1]); - - } while (GETOP(&ptable[0]) == oNOP); - setupPointer(); -} - -/**********************************************************************/ - -static void setupPointer(void) -{ - register int pindex; - - TRACE(stderr, "[setupPointer]"); - - for (pindex = 0; pindex < WINDOW; pindex++) - pptr[pindex] = (OPTYPE *) NULL; - - nops = 0; - for (pindex = 0; pindex < WINDOW; pindex++) - { - switch (GETOP(&ptable[pindex])) - { - /* Terminate list when a break from sequential logic is - * encountered - */ - - case oRET : - case oEND : - case oJMP : - case oLABEL : - case oPCAL : - return; - - /* Terminate list when a condition break from sequential logic is - * encountered but include the conditional branch in the list - */ - - case oJEQUZ : - case oJNEQZ : - case oJLTZ : - case oJGTEZ : - case oJGTZ : - case oJLTEZ : - pptr[nops] = &ptable[pindex]; - nops++; - return; - - /* Skip over NOPs and comment class pcodes */ - - case oNOP : - case oLINE : - break; - - /* Include all other pcodes in the optimization list and continue */ - - default : - pptr[nops] = &ptable[pindex]; - nops++; - } - } -} - -/**********************************************************************/ - -static void initPTable(void) -{ - register int i; - - TRACE(stderr, "[intPTable]"); - - /* Skip over leading pcodes. NOTE: assumes executable begins after - * the first oLABEL pcode - */ - - do - { - insn_GetOpCode(myPoffHandle, &ptable[0]); - insn_AddTmpOpCode(myPoffProgHandle, &ptable[0]); - } - while ((GETOP(&ptable[0]) != oLABEL) && (GETOP(&ptable[0]) != oEND)); - - /* Fill the pcode window and setup pointers to working section */ - - for (i = 0; i < WINDOW; i++) - { - insn_GetOpCode(myPoffHandle, &ptable[i]); - } - setupPointer(); -} - -/***********************************************************************/ +/********************************************************************** + * polocal.c + * P-Code Local Optimizer + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include + +#include "keywords.h" +#include "podefs.h" +#include "pinsn32.h" + +#include "pofflib.h" +#include "paslib.h" +#include "pinsn.h" +#include "pcopt.h" +#include "plopt.h" +#include "pjopt.h" +#include "polocal.h" + +/********************************************************************** + * Private Function Prototypes + **********************************************************************/ + +static void initPTable (void); +static void putPCodeFromTable (void); +static void setupPointer (void); + +/********************************************************************** + * Global Variables + **********************************************************************/ + +OPTYPE ptable [WINDOW]; /* Pcode Table */ +OPTYPE *pptr [WINDOW]; /* Valid Pcode Pointers */ + +int nops = 0; /* No. Valid Pcode Pointers */ +int end_out = 0; /* 1 = oEND pcode has been output */ + +/********************************************************************** + * Private Variables + **********************************************************************/ + +static poffHandle_t myPoffHandle; /* Handle to POFF object */ +static poffProgHandle_t myPoffProgHandle;/* Handle to temporary POFF object */ + +/********************************************************************** + * Global Functions + **********************************************************************/ + +/***********************************************************************/ + +void localOptimization(poffHandle_t poffHandle, + poffProgHandle_t poffProgHandle) +{ + int nchanges; + + TRACE(stderr, "[pass2]"); + + /* Save the handles for use by other, private functions */ + + myPoffHandle = poffHandle; + myPoffProgHandle = poffProgHandle; + + /* Initialization */ + + initPTable(); + + /* Outer loop traverse the file op-code by op-code until the oEND P-Code + * has been output. NOTE: it is assumed throughout that oEND is the + * final P-Code in the program data section. + */ + + while (!(end_out)) + { + /* The inner loop optimizes the buffered P-Codes until no further + * changes can be made. Then the outer loop will advance the buffer + * by one P-Code + */ + + do + { + nchanges = unaryOptimize (); + nchanges += binaryOptimize(); + nchanges += BranchOptimize(); + nchanges += LoadOptimize(); + nchanges += StoreOptimize(); + } while (nchanges); + + putPCodeFromTable(); + } +} + +/***********************************************************************/ + +void deletePcode(int delIndex) +{ + TRACE(stderr, "[deletePcode]"); + + PUTOP(pptr[delIndex], oNOP); + PUTARG(pptr[delIndex], 0); + setupPointer(); +} + +/**********************************************************************/ + +void deletePcodePair(int delIndex1, int delIndex2) +{ + TRACE(stderr, "[deletePcodePair]"); + + PUTOP(pptr[delIndex1], oNOP); + PUTARG(pptr[delIndex1], 0); + PUTOP(pptr[delIndex2], oNOP); + PUTARG(pptr[delIndex2], 0); + setupPointer(); +} + +/********************************************************************** + * Private Functions + **********************************************************************/ + +/***********************************************************************/ + +static void putPCodeFromTable(void) +{ + register int i; + + TRACE(stderr, "[putPCodeFromTable]"); + + /* Transfer all buffered P-Codes (except NOPs) to the optimized file */ + do + { + if ((GETOP(&ptable[0]) != oNOP) && !(end_out)) + { + insn_AddTmpOpCode(myPoffProgHandle, &ptable[0]); + end_out = (GETOP(&ptable[0]) == oEND); + } + + /* Move all P-Codes down one slot */ + + for (i = 1; i < WINDOW; i++) + { + ptable[i-1] = ptable[i]; + } + + /* Then fill the end slot with a new P-Code from the input file */ + + insn_GetOpCode(myPoffHandle, &ptable[WINDOW-1]); + + } while (GETOP(&ptable[0]) == oNOP); + setupPointer(); +} + +/**********************************************************************/ + +static void setupPointer(void) +{ + register int pindex; + + TRACE(stderr, "[setupPointer]"); + + for (pindex = 0; pindex < WINDOW; pindex++) + pptr[pindex] = (OPTYPE *) NULL; + + nops = 0; + for (pindex = 0; pindex < WINDOW; pindex++) + { + switch (GETOP(&ptable[pindex])) + { + /* Terminate list when a break from sequential logic is + * encountered + */ + + case oRET : + case oEND : + case oJMP : + case oLABEL : + case oPCAL : + return; + + /* Terminate list when a condition break from sequential logic is + * encountered but include the conditional branch in the list + */ + + case oJEQUZ : + case oJNEQZ : + case oJLTZ : + case oJGTEZ : + case oJGTZ : + case oJLTEZ : + pptr[nops] = &ptable[pindex]; + nops++; + return; + + /* Skip over NOPs and comment class pcodes */ + + case oNOP : + case oLINE : + break; + + /* Include all other pcodes in the optimization list and continue */ + + default : + pptr[nops] = &ptable[pindex]; + nops++; + } + } +} + +/**********************************************************************/ + +static void initPTable(void) +{ + register int i; + + TRACE(stderr, "[intPTable]"); + + /* Skip over leading pcodes. NOTE: assumes executable begins after + * the first oLABEL pcode + */ + + do + { + insn_GetOpCode(myPoffHandle, &ptable[0]); + insn_AddTmpOpCode(myPoffProgHandle, &ptable[0]); + } + while ((GETOP(&ptable[0]) != oLABEL) && (GETOP(&ptable[0]) != oEND)); + + /* Fill the pcode window and setup pointers to working section */ + + for (i = 0; i < WINDOW; i++) + { + insn_GetOpCode(myPoffHandle, &ptable[i]); + } + setupPointer(); +} + +/***********************************************************************/ diff --git a/misc/pascal/insn32/popt/polocal.h b/misc/pascal/insn32/popt/polocal.h index a46e4dc9c..fc97cb819 100644 --- a/misc/pascal/insn32/popt/polocal.h +++ b/misc/pascal/insn32/popt/polocal.h @@ -1,73 +1,73 @@ -/*************************************************************************** - * polocal.h - * External Declarations associated with polocal.c - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ***************************************************************************/ - -#ifndef __POLOCAL_H -#define __POLOCAL_H - -/*************************************************************************** -* Included Files -****************************************************************************/ - -#include "keywords.h" -#include "pdefs.h" -#include "pofflib.h" - -/*************************************************************************** -* Definitions -****************************************************************************/ - -#define WINDOW 10 /* size of optimization window */ - -/*************************************************************************** -* Global Function Prototypes -****************************************************************************/ - -extern void localOptimization(poffHandle_t poffHandle, - poffProgHandle_t poffProgHandle); -extern void deletePcode (int delIndex); -extern void deletePcodePair (int delIndex1, int delIndex2); - -/*************************************************************************** - * Global Variables - ****************************************************************************/ - -extern OPTYPE ptable [WINDOW]; /* Pcode Table */ -extern OPTYPE *pptr [WINDOW]; /* Valid Pcode Pointers */ - -extern int nops; /* No. Valid Pcode Pointers */ -extern int end_out; /* 1 = oEND pcode has been output */ - -#endif /* __PLOCAL_H */ +/*************************************************************************** + * polocal.h + * External Declarations associated with polocal.c + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ***************************************************************************/ + +#ifndef __POLOCAL_H +#define __POLOCAL_H + +/*************************************************************************** +* Included Files +****************************************************************************/ + +#include "keywords.h" +#include "pdefs.h" +#include "pofflib.h" + +/*************************************************************************** +* Definitions +****************************************************************************/ + +#define WINDOW 10 /* size of optimization window */ + +/*************************************************************************** +* Global Function Prototypes +****************************************************************************/ + +extern void localOptimization(poffHandle_t poffHandle, + poffProgHandle_t poffProgHandle); +extern void deletePcode (int delIndex); +extern void deletePcodePair (int delIndex1, int delIndex2); + +/*************************************************************************** + * Global Variables + ****************************************************************************/ + +extern OPTYPE ptable [WINDOW]; /* Pcode Table */ +extern OPTYPE *pptr [WINDOW]; /* Valid Pcode Pointers */ + +extern int nops; /* No. Valid Pcode Pointers */ +extern int end_out; /* 1 = oEND pcode has been output */ + +#endif /* __PLOCAL_H */ diff --git a/misc/pascal/insn32/popt/popt.c b/misc/pascal/insn32/popt/popt.c index cf8c76ce3..5cf039a16 100644 --- a/misc/pascal/insn32/popt/popt.c +++ b/misc/pascal/insn32/popt/popt.c @@ -1,327 +1,327 @@ -/********************************************************************** - * popt.c - * P-Code Optimizer Main Logic - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - **********************************************************************/ - -/********************************************************************** - * Included Files - **********************************************************************/ - -#include -#include -#include - -#include "keywords.h" -#include "podefs.h" -#include "paslib.h" -#include "pofflib.h" - -#include "pinsn.h" -#include "popt.h" -#include "psopt.h" -#include "polocal.h" -#include "pfopt.h" - -/********************************************************************** - * Private Function Prototypes - **********************************************************************/ - -static void showUsage (const char *progname, int errcode); -static void readPoffFile (const char *filename); -static void pass1 (void); -static void pass2 (void); -static void pass3 (void); -static void writePoffFile (const char *filename); - -/********************************************************************** - * Global Variables - **********************************************************************/ - -/********************************************************************** - * Private Variables - **********************************************************************/ - -static poffHandle_t poffHandle; /* Handle to POFF object */ -static int no_resolve = 0; - -/********************************************************************** - * Global Functions - **********************************************************************/ - -/***********************************************************************/ - -int main(int argc, char *argv[], char *envp[]) -{ - const char *outfilename; - TRACE(stderr, "[main]"); - int option; - - /* Process command line argruments */ - - while ((option = getopt(argc, argv, "rh")) > 0) - { - switch (option) - { - case 'r' : - no_resolve++; - break; - case 'h' : - showUsage(argv[0], 0); - default: - fprintf(stderr, "Unrecognized option\n"); - showUsage(argv[0], -1); - } - } - - /* Check for existence of filename argument */ - - if (optind != argc - 1) - { - printf("Filename required at end of command line.\n"); - showUsage(argv[0], -1); - } /* end if */ - - /* Read the POFF file into memory */ - - outfilename = argv[optind]; - readPoffFile(outfilename); - - /* Performs pass1 optimization */ - - pass1(); - - /* Performs pass2 optimization */ - - insn_ResetOpCodeRead(poffHandle); - pass2(); - - if (!no_resolve) - { - /* Create final section offsets and relocation entries */ - - insn_ResetOpCodeRead(poffHandle); - pass3(); - } - - /* Write the POFF file */ - - writePoffFile(outfilename); - return 0; - -} /* End main */ - -/********************************************************************** - * Private Functions - **********************************************************************/ - -/***********************************************************************/ - -static void showUsage(const char *progname, int errcode) -{ - fprintf(stderr, "USAGE:\n"); - fprintf(stderr, " %s -h\n", progname); - fprintf(stderr, " %s [-r] \n", progname); - fprintf(stderr, "WHERE:\n"); - fprintf(stderr, " -r: Disables label resolution (default: labels resolved)\n"); - fprintf(stderr, " -h: Shows this message\n"); - exit(errcode); -} - -/***********************************************************************/ - -static void readPoffFile(const char *filename) -{ - char objname [FNAME_SIZE+1]; - FILE *objFile; - int errcode; - - TRACE(stderr, "[readPoffFile]"); - - /* Open the pass1 POFF object file -- Use .o1 extension */ - - (void)extension(filename, "o1", objname, 1); - if (!(objFile = fopen(objname, "rb"))) - { - printf("Error Opening %s\n", objname); - exit(1); - } /* end if */ - - /* Get a handle to a POFF input object */ - - poffHandle = poffCreateHandle(); - if (!poffHandle) - { - printf("Could not get POFF handle\n"); - exit(1); - } /* end if */ - - /* Read the POFF file into memory */ - - errcode = poffReadFile(poffHandle, objFile); - if (errcode != 0) - { - printf("Could not read POFF file, errcode=0x%02x\n", errcode); - exit(1); - } - - /* Close the input file */ - - fclose(objFile); -} /* end pass1 */ - -/***********************************************************************/ - -static void pass1(void) -{ - poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */ - - TRACE(stderr, "[pass1]"); - - /* Create a handle to a temporary object to store new POFF program - * data. - */ - - poffProgHandle = poffCreateProgHandle(); - if (!poffProgHandle) - { - printf("Could not get POFF handle\n"); - exit(1); - } /* end if */ - - /* Clean up garbage left from the wasteful string stack logic */ - - stringStackOptimize(poffHandle, poffProgHandle); - - /* Replace the original program data with the new program data */ - - poffReplaceProgData(poffHandle, poffProgHandle); - - /* Release the temporary POFF object */ - - poffDestroyProgHandle(poffProgHandle); -} /* end pass1 */ - -/***********************************************************************/ - -static void pass2(void) -{ - poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */ - - TRACE(stderr, "[pass2]"); - - /* Create a handle to a temporary object to store new POFF program - * data. - */ - - poffProgHandle = poffCreateProgHandle(); - if (!poffProgHandle) - { - printf("Could not get POFF handle\n"); - exit(1); - } /* end if */ - - /* Perform Local Optimizatin Initialization */ - - localOptimization(poffHandle, poffProgHandle); - - /* Replace the original program data with the new program data */ - - poffReplaceProgData(poffHandle, poffProgHandle); - - /* Release the temporary POFF object */ - - poffDestroyProgHandle(poffProgHandle); -} /* end pass2 */ - -/***********************************************************************/ - -static void pass3 (void) -{ - poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */ - TRACE(stderr, "[pass3]"); - - /* Create a handle to a temporary object to store new POFF program - * data. - */ - - poffProgHandle = poffCreateProgHandle(); - if (!poffProgHandle) - { - printf("Could not get POFF handle\n"); - exit(1); - } /* end if */ - - /* Finalize program section, create relocation and line number - * sections. - */ - - optFinalize(poffHandle, poffProgHandle); - - /* Release the temporary POFF object */ - - poffDestroyProgHandle(poffProgHandle); -} - -/***********************************************************************/ - -static void writePoffFile(const char *filename) -{ - char optname [FNAME_SIZE+1]; - FILE *optFile; - - TRACE(stderr, "[writePoffFile]"); - - /* Open optimized p-code file -- Use .o extension */ - - (void)extension(filename, "o", optname, 1); - if (!(optFile = fopen(optname, "wb"))) - { - printf("Error Opening %s\n", optname); - exit(1); - } /* end if */ - - /* Then write the new POFF file */ - - poffWriteFile(poffHandle, optFile); - - /* Destroy the POFF object */ - - poffDestroyHandle(poffHandle); - - /* Close the files used on writePoffFile */ - - (void)fclose(optFile); -} /* end writePoffFile */ - -/***********************************************************************/ +/********************************************************************** + * popt.c + * P-Code Optimizer Main Logic + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + **********************************************************************/ + +/********************************************************************** + * Included Files + **********************************************************************/ + +#include +#include +#include + +#include "keywords.h" +#include "podefs.h" +#include "paslib.h" +#include "pofflib.h" + +#include "pinsn.h" +#include "popt.h" +#include "psopt.h" +#include "polocal.h" +#include "pfopt.h" + +/********************************************************************** + * Private Function Prototypes + **********************************************************************/ + +static void showUsage (const char *progname, int errcode); +static void readPoffFile (const char *filename); +static void pass1 (void); +static void pass2 (void); +static void pass3 (void); +static void writePoffFile (const char *filename); + +/********************************************************************** + * Global Variables + **********************************************************************/ + +/********************************************************************** + * Private Variables + **********************************************************************/ + +static poffHandle_t poffHandle; /* Handle to POFF object */ +static int no_resolve = 0; + +/********************************************************************** + * Global Functions + **********************************************************************/ + +/***********************************************************************/ + +int main(int argc, char *argv[], char *envp[]) +{ + const char *outfilename; + TRACE(stderr, "[main]"); + int option; + + /* Process command line argruments */ + + while ((option = getopt(argc, argv, "rh")) > 0) + { + switch (option) + { + case 'r' : + no_resolve++; + break; + case 'h' : + showUsage(argv[0], 0); + default: + fprintf(stderr, "Unrecognized option\n"); + showUsage(argv[0], -1); + } + } + + /* Check for existence of filename argument */ + + if (optind != argc - 1) + { + printf("Filename required at end of command line.\n"); + showUsage(argv[0], -1); + } /* end if */ + + /* Read the POFF file into memory */ + + outfilename = argv[optind]; + readPoffFile(outfilename); + + /* Performs pass1 optimization */ + + pass1(); + + /* Performs pass2 optimization */ + + insn_ResetOpCodeRead(poffHandle); + pass2(); + + if (!no_resolve) + { + /* Create final section offsets and relocation entries */ + + insn_ResetOpCodeRead(poffHandle); + pass3(); + } + + /* Write the POFF file */ + + writePoffFile(outfilename); + return 0; + +} /* End main */ + +/********************************************************************** + * Private Functions + **********************************************************************/ + +/***********************************************************************/ + +static void showUsage(const char *progname, int errcode) +{ + fprintf(stderr, "USAGE:\n"); + fprintf(stderr, " %s -h\n", progname); + fprintf(stderr, " %s [-r] \n", progname); + fprintf(stderr, "WHERE:\n"); + fprintf(stderr, " -r: Disables label resolution (default: labels resolved)\n"); + fprintf(stderr, " -h: Shows this message\n"); + exit(errcode); +} + +/***********************************************************************/ + +static void readPoffFile(const char *filename) +{ + char objname [FNAME_SIZE+1]; + FILE *objFile; + int errcode; + + TRACE(stderr, "[readPoffFile]"); + + /* Open the pass1 POFF object file -- Use .o1 extension */ + + (void)extension(filename, "o1", objname, 1); + if (!(objFile = fopen(objname, "rb"))) + { + printf("Error Opening %s\n", objname); + exit(1); + } /* end if */ + + /* Get a handle to a POFF input object */ + + poffHandle = poffCreateHandle(); + if (!poffHandle) + { + printf("Could not get POFF handle\n"); + exit(1); + } /* end if */ + + /* Read the POFF file into memory */ + + errcode = poffReadFile(poffHandle, objFile); + if (errcode != 0) + { + printf("Could not read POFF file, errcode=0x%02x\n", errcode); + exit(1); + } + + /* Close the input file */ + + fclose(objFile); +} /* end pass1 */ + +/***********************************************************************/ + +static void pass1(void) +{ + poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */ + + TRACE(stderr, "[pass1]"); + + /* Create a handle to a temporary object to store new POFF program + * data. + */ + + poffProgHandle = poffCreateProgHandle(); + if (!poffProgHandle) + { + printf("Could not get POFF handle\n"); + exit(1); + } /* end if */ + + /* Clean up garbage left from the wasteful string stack logic */ + + stringStackOptimize(poffHandle, poffProgHandle); + + /* Replace the original program data with the new program data */ + + poffReplaceProgData(poffHandle, poffProgHandle); + + /* Release the temporary POFF object */ + + poffDestroyProgHandle(poffProgHandle); +} /* end pass1 */ + +/***********************************************************************/ + +static void pass2(void) +{ + poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */ + + TRACE(stderr, "[pass2]"); + + /* Create a handle to a temporary object to store new POFF program + * data. + */ + + poffProgHandle = poffCreateProgHandle(); + if (!poffProgHandle) + { + printf("Could not get POFF handle\n"); + exit(1); + } /* end if */ + + /* Perform Local Optimizatin Initialization */ + + localOptimization(poffHandle, poffProgHandle); + + /* Replace the original program data with the new program data */ + + poffReplaceProgData(poffHandle, poffProgHandle); + + /* Release the temporary POFF object */ + + poffDestroyProgHandle(poffProgHandle); +} /* end pass2 */ + +/***********************************************************************/ + +static void pass3 (void) +{ + poffProgHandle_t poffProgHandle; /* Handle to temporary POFF object */ + TRACE(stderr, "[pass3]"); + + /* Create a handle to a temporary object to store new POFF program + * data. + */ + + poffProgHandle = poffCreateProgHandle(); + if (!poffProgHandle) + { + printf("Could not get POFF handle\n"); + exit(1); + } /* end if */ + + /* Finalize program section, create relocation and line number + * sections. + */ + + optFinalize(poffHandle, poffProgHandle); + + /* Release the temporary POFF object */ + + poffDestroyProgHandle(poffProgHandle); +} + +/***********************************************************************/ + +static void writePoffFile(const char *filename) +{ + char optname [FNAME_SIZE+1]; + FILE *optFile; + + TRACE(stderr, "[writePoffFile]"); + + /* Open optimized p-code file -- Use .o extension */ + + (void)extension(filename, "o", optname, 1); + if (!(optFile = fopen(optname, "wb"))) + { + printf("Error Opening %s\n", optname); + exit(1); + } /* end if */ + + /* Then write the new POFF file */ + + poffWriteFile(poffHandle, optFile); + + /* Destroy the POFF object */ + + poffDestroyHandle(poffHandle); + + /* Close the files used on writePoffFile */ + + (void)fclose(optFile); +} /* end writePoffFile */ + +/***********************************************************************/ diff --git a/misc/pascal/insn32/popt/popt.h b/misc/pascal/insn32/popt/popt.h index 9cd151a89..c7645be9e 100644 --- a/misc/pascal/insn32/popt/popt.h +++ b/misc/pascal/insn32/popt/popt.h @@ -1,52 +1,52 @@ -/*************************************************************************** - * popt.h - * External Declarations associated with popt.c - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ***************************************************************************/ - -#ifndef __POPT_H -#define __POPT_H - -/*************************************************************************** -* Included Files -****************************************************************************/ - -/*************************************************************************** - * Global Variables - ****************************************************************************/ - -/*************************************************************************** -* Global Function Prototypes -****************************************************************************/ - -#endif /* __POPT_H */ +/*************************************************************************** + * popt.h + * External Declarations associated with popt.c + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ***************************************************************************/ + +#ifndef __POPT_H +#define __POPT_H + +/*************************************************************************** +* Included Files +****************************************************************************/ + +/*************************************************************************** + * Global Variables + ****************************************************************************/ + +/*************************************************************************** +* Global Function Prototypes +****************************************************************************/ + +#endif /* __POPT_H */ diff --git a/misc/pascal/insn32/popt/psopt.c b/misc/pascal/insn32/popt/psopt.c index 16824106e..7ecd3b6a9 100644 --- a/misc/pascal/insn32/popt/psopt.c +++ b/misc/pascal/insn32/popt/psopt.c @@ -3,7 +3,7 @@ * String Stack Optimizaitons * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/popt/psopt.h b/misc/pascal/insn32/popt/psopt.h index c174aac8e..3ea1ee227 100644 --- a/misc/pascal/insn32/popt/psopt.h +++ b/misc/pascal/insn32/popt/psopt.h @@ -1,54 +1,54 @@ -/*************************************************************************** - * psopt.h - * External Declarations associated with psopt.c - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ***************************************************************************/ - -#ifndef __PSOPT_H -#define __PSOPT_H - -/*************************************************************************** - * Included Files - ***************************************************************************/ - -#include "pofflib.h" - -/*************************************************************************** - * Global Function Prototypes - ***************************************************************************/ - -extern void stringStackOptimize(poffHandle_t poffHandle, - poffProgHandle_t poffProgHandle); - -#endif /* __PSOPT_H */ - +/*************************************************************************** + * psopt.h + * External Declarations associated with psopt.c + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ***************************************************************************/ + +#ifndef __PSOPT_H +#define __PSOPT_H + +/*************************************************************************** + * Included Files + ***************************************************************************/ + +#include "pofflib.h" + +/*************************************************************************** + * Global Function Prototypes + ***************************************************************************/ + +extern void stringStackOptimize(poffHandle_t poffHandle, + poffProgHandle_t poffProgHandle); + +#endif /* __PSOPT_H */ + diff --git a/misc/pascal/insn32/regm/Makefile b/misc/pascal/insn32/regm/Makefile index 2fa4a3424..0dca7196d 100644 --- a/misc/pascal/insn32/regm/Makefile +++ b/misc/pascal/insn32/regm/Makefile @@ -2,7 +2,7 @@ # insn32/regm/Makefile # # Copyright (C) 2008 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/regm/regm.c b/misc/pascal/insn32/regm/regm.c index b037e87b2..1b8c22fce 100644 --- a/misc/pascal/insn32/regm/regm.c +++ b/misc/pascal/insn32/regm/regm.c @@ -3,7 +3,7 @@ * Convert 32-bit pcode defintions to a register model * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/regm/regm.h b/misc/pascal/insn32/regm/regm.h index 4ab5999b1..dbce7e876 100644 --- a/misc/pascal/insn32/regm/regm.h +++ b/misc/pascal/insn32/regm/regm.h @@ -3,7 +3,7 @@ * External Declarations associated with regm.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/regm/regm_pass1.c b/misc/pascal/insn32/regm/regm_pass1.c index c3f5b30ef..dcc7c572c 100644 --- a/misc/pascal/insn32/regm/regm_pass1.c +++ b/misc/pascal/insn32/regm/regm_pass1.c @@ -3,7 +3,7 @@ * Break the pcode data into sections * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/regm/regm_pass1.h b/misc/pascal/insn32/regm/regm_pass1.h index f1998b1cb..98fafcb87 100644 --- a/misc/pascal/insn32/regm/regm_pass1.h +++ b/misc/pascal/insn32/regm/regm_pass1.h @@ -1,58 +1,58 @@ -/*************************************************************************** - * regm_pass1.h - * External Declarations associated with regm_pass1.c - * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ***************************************************************************/ - -#ifndef __REGM_PASS1_H -#define __REGM_PASS1_H - -/*************************************************************************** - * Included Files - ***************************************************************************/ - -/*************************************************************************** - * Definitions - ***************************************************************************/ - -/*************************************************************************** - * Global Variables - ***************************************************************************/ - -/*************************************************************************** - * Global Function Prototypes - ***************************************************************************/ - -extern void regm_Pass1(poffHandle_t hPoff); - -#endif /* __REGM_PASS1_H */ +/*************************************************************************** + * regm_pass1.h + * External Declarations associated with regm_pass1.c + * + * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ***************************************************************************/ + +#ifndef __REGM_PASS1_H +#define __REGM_PASS1_H + +/*************************************************************************** + * Included Files + ***************************************************************************/ + +/*************************************************************************** + * Definitions + ***************************************************************************/ + +/*************************************************************************** + * Global Variables + ***************************************************************************/ + +/*************************************************************************** + * Global Function Prototypes + ***************************************************************************/ + +extern void regm_Pass1(poffHandle_t hPoff); + +#endif /* __REGM_PASS1_H */ diff --git a/misc/pascal/insn32/regm/regm_pass2.c b/misc/pascal/insn32/regm/regm_pass2.c index 86380984d..619d06501 100644 --- a/misc/pascal/insn32/regm/regm_pass2.c +++ b/misc/pascal/insn32/regm/regm_pass2.c @@ -5,7 +5,7 @@ * registers) and with 32-bit immediate size. * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/regm/regm_pass2.h b/misc/pascal/insn32/regm/regm_pass2.h index 8d3ba91db..22d958c27 100644 --- a/misc/pascal/insn32/regm/regm_pass2.h +++ b/misc/pascal/insn32/regm/regm_pass2.h @@ -3,7 +3,7 @@ * External Declarations associated with regm_pass2.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/regm/regm_registers2.c b/misc/pascal/insn32/regm/regm_registers2.c index 25aaddfaf..e4c4212b9 100644 --- a/misc/pascal/insn32/regm/regm_registers2.c +++ b/misc/pascal/insn32/regm/regm_registers2.c @@ -3,7 +3,7 @@ * Pass 2 register management functions * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/regm/regm_registers2.h b/misc/pascal/insn32/regm/regm_registers2.h index eabe76f5b..24209082f 100644 --- a/misc/pascal/insn32/regm/regm_registers2.h +++ b/misc/pascal/insn32/regm/regm_registers2.h @@ -3,7 +3,7 @@ * Definitions for management of registers * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/regm/regm_tree.c b/misc/pascal/insn32/regm/regm_tree.c index 0a59bbdbd..9e2abdaff 100644 --- a/misc/pascal/insn32/regm/regm_tree.c +++ b/misc/pascal/insn32/regm/regm_tree.c @@ -3,7 +3,7 @@ * Tree managmenet * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/misc/pascal/insn32/regm/regm_tree.h b/misc/pascal/insn32/regm/regm_tree.h index 0d6336d74..9d1bcc0f5 100644 --- a/misc/pascal/insn32/regm/regm_tree.h +++ b/misc/pascal/insn32/regm/regm_tree.h @@ -3,7 +3,7 @@ * External Declarations associated with regm_tree.c * * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions -- cgit v1.2.3