1 /*****************************************************************************/
9 /* (C) 2001-2012, Ullrich von Bassewitz */
10 /* Roemerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
46 /*****************************************************************************/
48 /*****************************************************************************/
52 unsigned OptShift1 (CodeSeg* S);
53 /* A call to the shlaxN routine may get replaced by one or more asl insns
54 * if the value of X is not used later. If X is used later, but it is zero
55 * on entry and it's a shift by one, it may get replaced by:
64 unsigned OptShift2(CodeSeg* S);
65 /* A call to the asrax1 routines may get replaced by something simpler, if
66 * X is not used later:
73 unsigned OptShift3 (CodeSeg* S);
84 * if X is zero on entry and unused later. For shift counts > 1, more
91 unsigned OptShift4 (CodeSeg* S);
92 /* Calls to the asraxN or shraxN routines may get replaced by one or more lsr
93 * insns if the value of X is zero.
96 unsigned OptShift5 (CodeSeg* S);
97 /* Search for the sequence
101 * jsr aslax1/asrax1/shlax1/shrax1
114 * or similar, provided that a/x is not used later
117 unsigned OptShift6 (CodeSeg* S);
118 /* Inline the shift subroutines. */
122 /* End of coptshift.h */