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:
63 unsigned OptShift2 (CodeSeg* S);
70 ** might be replaced by N copies of
75 ** if X is not used later (X is assumed to be zero on entry).
78 unsigned OptShift3 (CodeSeg* S);
85 ** may get replaced by
89 ** if X is zero on entry and unused later. For shift counts > 1, more
96 unsigned OptShift4 (CodeSeg* S);
97 /* Calls to the asraxN or shraxN routines may get replaced by one or more lsr
98 ** insns if the value of X is zero.
101 unsigned OptShift5 (CodeSeg* S);
102 /* Search for the sequence
106 ** jsr aslax1/asrax1/shlax1/shrax1
119 ** or similar, provided that a/x is not used later
122 unsigned OptShift6 (CodeSeg* S);
123 /* Inline the shift subroutines. */
127 /* End of coptshift.h */