VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.0.1/fastblt.h@ 67129

最後變更 在這個檔案從67129是 51223,由 vboxsync 提交於 11 年 前

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • 屬性 svn:eol-style 設為 native
檔案大小: 3.0 KB
 
1/* $Xorg: fastblt.h,v 1.4 2001/02/09 02:05:17 xorgcvs Exp $ */
2/*
3
4Copyright 1989, 1998 The Open Group
5
6Permission to use, copy, modify, distribute, and sell this software and its
7documentation for any purpose is hereby granted without fee, provided that
8the above copyright notice appear in all copies and that both that
9copyright notice and this permission notice appear in supporting
10documentation.
11
12The above copyright notice and this permission notice shall be included
13in all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
19OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21OTHER DEALINGS IN THE SOFTWARE.
22
23Except as contained in this notice, the name of The Open Group shall
24not be used in advertising or otherwise to promote the sale, use or
25other dealings in this Software without prior written authorization
26from The Open Group.
27
28*/
29/* $XFree86: xc/programs/Xserver/mfb/fastblt.h,v 1.4 2001/01/17 22:37:01 dawes Exp $ */
30
31/*
32 * Fast bitblt macros for certain hardware. If your machine has an addressing
33 * mode of small constant + register, you'll probably want this magic specific
34 * code. It's 25% faster for the R2000. I haven't studied the Sparc
35 * instruction set, but I suspect it also has this addressing mode. Also,
36 * unrolling the loop by 32 is possibly excessive for mfb. The number of times
37 * the loop is actually looped through is pretty small.
38 */
39
40/*
41 * WARNING: These macros make *a lot* of assumptions about
42 * the environment they are invoked in. Plenty of implicit
43 * arguments, lots of side effects. Don't use them casually.
44 */
45
46#define SwitchOdd(n) case n: BodyOdd(n)
47#define SwitchEven(n) case n: BodyEven(n)
48
49/* to allow mfb and cfb to share code... */
50#ifdef HAVE_DIX_CONFIG_H
51#include <dix-config.h>
52#endif
53
54#ifndef BitRight
55#define BitRight(a,b) SCRRIGHT(a,b)
56#define BitLeft(a,b) SCRLEFT(a,b)
57#endif
58
59#ifdef LARGE_INSTRUCTION_CACHE
60#define UNROLL 8
61#define PackedLoop \
62 switch (nl & (UNROLL-1)) { \
63 SwitchOdd( 7) SwitchEven( 6) SwitchOdd( 5) SwitchEven( 4) \
64 SwitchOdd( 3) SwitchEven( 2) SwitchOdd( 1) \
65 } \
66 while ((nl -= UNROLL) >= 0) { \
67 LoopReset \
68 BodyEven( 8) \
69 BodyOdd( 7) BodyEven( 6) BodyOdd( 5) BodyEven( 4) \
70 BodyOdd( 3) BodyEven( 2) BodyOdd( 1) \
71 }
72#else
73#define UNROLL 4
74#define PackedLoop \
75 switch (nl & (UNROLL-1)) { \
76 SwitchOdd( 3) SwitchEven( 2) SwitchOdd( 1) \
77 } \
78 while ((nl -= UNROLL) >= 0) { \
79 LoopReset \
80 BodyEven( 4) \
81 BodyOdd( 3) BodyEven( 2) BodyOdd( 1) \
82 }
83#endif
84
85#define DuffL(counter,label,body) \
86 switch (counter & 3) { \
87 label: \
88 body \
89 case 3: \
90 body \
91 case 2: \
92 body \
93 case 1: \
94 body \
95 case 0: \
96 if ((counter -= 4) >= 0) \
97 goto label; \
98 }
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette