2 * Copyright 1996 The XFree86 Project
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * HARM HANEMAAYER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
24 /* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaTEGlyphBlt.S,v 1.1 1999/07/10 07:24:54 dawes Exp $ */
28 * Intel Pentium-optimized versions of "terminal emulator font" text
29 * bitmap transfer routines.
33 * Only for glyphs with a fixed width of 6 pixels or 8 pixels.
39 FILE("xaaTEGlyphBlt.s")
47 * Definition of stack frame function arguments.
48 * All functions have the same arguments (some don't have glyphwidth,
49 * but that's OK, since it comes last and doesn't affect the offset
50 * of the other arguments).
53 #define base_arg REGOFF(20,ESP)
54 #define glyphp_arg REGOFF(24,ESP)
55 #define line_arg REGOFF(28,ESP)
56 #define width_arg REGOFF(32,ESP)
57 #define glyphwidth_arg REGOFF(36,ESP)
59 #define BYTE_REVERSED GLNAME(byte_reversed)
61 /* I assume %eax and %edx can be trashed. */
69 GLOBL GLNAME(DrawTETextScanlineWidth6PMSBFirstFixedBase)
70 GLNAME(DrawTETextScanlineWidth6PMSBFirstFixedBase):
72 GLOBL GLNAME(DrawTETextScanlineWidth6PLSBFirstFixedBase)
73 GLNAME(DrawTETextScanlineWidth6PLSBFirstFixedBase):
77 GLOBL GLNAME(DrawTETextScanlineWidth6PMSBFirst)
78 GLNAME(DrawTETextScanlineWidth6PMSBFirst):
80 GLOBL GLNAME(DrawTETextScanlineWidth6PLSBFirst)
81 GLNAME(DrawTETextScanlineWidth6PLSBFirst):
85 /* Definition of stack frame function arguments. */
87 #define base_arg REGOFF(20,ESP)
88 #define glyphp_arg REGOFF(24,ESP)
89 #define line_arg REGOFF(28,ESP)
90 #define width_arg REGOFF(32,ESP)
93 MOV_L (EBP,REGOFF(12,ESP)) /* PUSH EBP */
94 MOV_L (EBX,REGOFF(8,ESP)) /* PUSH EBX */
95 MOV_L (ESI,REGOFF(4,ESP)) /* PUSH ESI */
96 MOV_L (EDI,REGOFF(0,ESP)) /* PUSH EDI */
100 MOV_L (glyphp_arg,ESI)
105 /* Pentium-optimized instruction pairing. */
106 /* EBX = bits = glyph[0][line] */
107 MOV_L (REGOFF(4,ESI),EDX) /* glyphp[1] */
108 MOV_L (REGIND(ESI),EBX) /* glyphp[0] */
109 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[1][line] */
110 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[0][line] */
111 SAL_L (CONST(6),EDX) /* glyphp[1][line] << 6 */
112 MOV_L (REGOFF(8,ESI),ECX) /* glyphp[2] */
113 MOV_L (REGOFF(12,ESI),EAX) /* glyphp[3] */
114 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[2][line] */
115 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[3][line] */
116 SAL_L (CONST(12),ECX) /* glyphp[2][line] << 12 */
117 OR_L (EDX,EBX) /* bits |= ..[1].. << 6 */
118 SAL_L (CONST(18),EAX) /* glyphp[3][line] << 18 */
119 OR_L (ECX,EBX) /* bits |= ..[2].. << 12 */
121 MOV_L (REGOFF(16,ESI),EDX) /* glyphp[4] */
122 MOV_L (REGOFF(20,ESI),ECX) /* glyphp[5] */
123 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[4][line] */
124 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[5][line] */
125 SAL_L (CONST(24),EDX) /* glyphp[4][line] << 24 */
126 OR_L (EAX,EBX) /* bits |= ..[3].. << 18 */
127 SAL_L (CONST(30),ECX) /* glyphp[5][line] << 30 */
128 OR_L (EDX,EBX) /* bits |= ..[4].. << 24 */
131 MOV_L (REGOFF(20,ESI),EAX) /* glyphp[5] */
132 OR_L (ECX,EBX) /* bits |= ..[5].. << 30 */
133 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[5][line] */
134 MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
137 OR_L (ECX,EBX) /* bits |= ..[5].. << 30 */
141 MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
142 MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
143 ROL_L (CONST(16),EBX)
146 MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
147 MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
148 ROL_L (CONST(16),EBX)
149 MOV_L (REGOFF(20,ESI),EAX) /* glyphp[5] */
150 MOV_L (EBX,REGIND(EDI))
151 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[5][line] */
154 CMP_L (CONST(32),width_arg)
157 ADD_L (CONST(4),EDI) /* base++ */
161 /* Note that glyphp[5][line] is already read again. */
162 /* EAX = bits = glyphp[5][line] >> 2 */
163 MOV_L (REGOFF(24,ESI),EDX) /* glyphp[6] */
164 MOV_L (REGOFF(28,ESI),EBX) /* glyphp[7] */
165 SHR_L (CONST(2),EAX) /* glyphp[5][line] >> 2 */
166 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[6][line] */
167 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[7][line] */
168 MOV_L (REGOFF(32,ESI),ECX) /* glyphp[8] */
169 SAL_L (CONST(4),EDX) /* glyphp[6][line] << 4 */
170 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[8][line] */
171 SAL_L (CONST(10),EBX) /* glyphp[7][line] << 10 */
172 OR_L (EDX,EAX) /* bits |= ..[6].. << 4 */
173 SAL_L (CONST(16),ECX) /* glyphp[8][line] << 16 */
174 MOV_L (REGOFF(36,ESI),EDX) /* glyphp[9] */
175 OR_L (EBX,EAX) /* bits |= ..[7].. << 10 */
176 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[9][line] */
177 OR_L (ECX,EAX) /* bits |= ..[8].. << 16 */
178 MOV_L (REGOFF(40,ESI),EBX) /* glyphp[10] */
179 SAL_L (CONST(22),EDX) /* glyphp[9][line] << 22 */
180 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[10][line] */
181 OR_L (EDX,EAX) /* bits |= ..[9].. << 22 */
184 MOV_L (REGOFF(40,ESI),ECX) /* glyphp[10] */
185 SAL_L (CONST(28),EBX) /* glyphp[10][line] << 28 */
186 MOV_L (REGOFF(44,ESI),EDX) /* glyphp[11] */
187 OR_L (EBX,EAX) /* bits |= ..[10].. << 28 */
188 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[10][line] */
190 MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
192 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
194 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[11][line] */
197 SAL_L (CONST(28),EBX) /* glyphp[10][line] << 28 */
199 OR_L (EBX,EAX) /* bits |= ..[10].. << 28 */
202 MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
203 MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
204 ROL_L (CONST(16),EAX)
207 MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
208 MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
209 MOV_L (REGOFF(40,ESI),ECX) /* glyphp[10] */
210 ROL_L (CONST(16),EAX)
211 MOV_L (REGOFF(44,ESI),EDX) /* glyphp[11] */
213 MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
215 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
217 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[10][line] */
218 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[11][line] */
221 CMP_L (CONST(64),width_arg)
224 ADD_L (CONST(8),EDI) /* base+=2 */
228 /* Note that glyphp[10][line] is read again. */
229 /* EAX = bits = glyphp[10][line] >> 4 */
230 SHR_L (CONST(4),ECX) /* glyphp[10][line] >> 4 */
231 MOV_L (REGOFF(48,ESI),EBX) /* glyphp[12] */
232 SAL_L (CONST(2),EDX) /* glyphp[11][line] << 2 */
233 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[12][line] */
234 OR_L (EDX,ECX) /* bits |= ..[11].. << 2 */
235 MOV_L (REGOFF(52,ESI),EAX) /* glyphp[13] */
236 SAL_L (CONST(8),EBX) /* glyphp[12][line] << 8 */
237 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[13][line] */
238 OR_L (EBX,ECX) /* bits |= ..[12].. << 8 */
239 MOV_L (REGOFF(56,ESI),EDX) /* glyphp[14] */
240 SAL_L (CONST(14),EAX) /* glyphp[13][line] << 14 */
241 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[14][line] */
242 OR_L (EAX,ECX) /* bits |= ..[13].. << 14 */
243 MOV_L (REGOFF(60,ESI),EBX) /* glyphp[15] */
244 SAL_L (CONST(20),EDX) /* glyphp[14][line] << 20 */
245 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[15][line] */
246 OR_L (EDX,ECX) /* bits |= ..[14].. << 20 */
249 SAL_L (CONST(26),EBX) /* glyphp[15][line] << 26 */
250 OR_L (EBX,ECX) /* bits |= ..[15].. << 26 */
252 MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
254 MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
258 SAL_L (CONST(26),EBX) /* glyphp[15][line] << 26 */
260 OR_L (EBX,ECX) /* bits |= ..[15].. << 26 */
263 MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
264 MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
265 ROL_L (CONST(16),ECX)
268 MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
269 MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
270 ROL_L (CONST(16),ECX)
272 MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
274 MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
279 ADD_L (CONST(12),EDI) /* base += 3*/
281 CMP_L (CONST(96),width_arg)
283 ADD_L (CONST(64),ESI) /* glyphp += 16 */
284 SUB_L (CONST(96),width_arg)
290 MOV_L (EDI,EAX) /* return base */
292 MOV_L (base_arg,EAX) /* return base */
294 MOV_L (REGOFF(0,ESP),EDI) /* POPL EDI */
295 MOV_L (REGOFF(4,ESP),ESI) /* POPL ESI */
296 MOV_L (REGOFF(8,ESP),EBX) /* POPL EBX */
297 MOV_L (REGOFF(12,ESP),EBP) /* POPL EBP */
298 ADD_L (CONST(16),ESP)
306 GLOBL GLNAME(DrawTETextScanlineWidth8PMSBFirstFixedBase)
307 GLNAME(DrawTETextScanlineWidth8PMSBFirstFixedBase):
309 GLOBL GLNAME(DrawTETextScanlineWidth8PLSBFirstFixedBase)
310 GLNAME(DrawTETextScanlineWidth8PLSBFirstFixedBase):
314 GLOBL GLNAME(DrawTETextScanlineWidth8PMSBFirst)
315 GLNAME(DrawTETextScanlineWidth8PMSBFirst):
317 GLOBL GLNAME(DrawTETextScanlineWidth8PLSBFirst)
318 GLNAME(DrawTETextScanlineWidth8PLSBFirst):
322 SUB_L (CONST(16),ESP)
323 MOV_L (EBP,REGOFF(12,ESP)) /* PUSH EBP */
324 MOV_L (EBX,REGOFF(8,ESP)) /* PUSH EBX */
325 MOV_L (ESI,REGOFF(4,ESP)) /* PUSH ESI */
326 MOV_L (EDI,REGOFF(0,ESP)) /* PUSH EDI */
330 MOV_L (glyphp_arg,ESI)
335 /* Pentium-optimized instruction pairing. */
337 MOV_L (REGIND(ESI),EAX) /* glyphp[0] */
338 MOV_L (REGOFF(4,ESI),EDX) /* glyphp[1] */
339 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[0][line] */
340 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[1][line] */
342 MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
343 MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
345 MOV_L (EAX,EBX) /* bits = glyph[0][line] */
346 MOV_B (DL,BH) /* bits |= ..[1].. << 8 */
349 ROL_L (CONST(16),EBX)
350 MOV_L (REGOFF(8,ESI),EAX) /* glyphp[2] */
351 MOV_L (REGOFF(12,ESI),ECX) /* glyphp[3] */
352 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[2][line] */
353 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[3][line] */
355 MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
356 MOV_B (REGOFF(BYTE_REVERSED,ECX),BH)
358 MOV_B (AL,BL) /* bits |= ..[2].. << 16 */
359 MOV_B (CL,BH) /* bits |= ..[3].. << 24 */
361 ROL_L (CONST(16),EBX)
362 MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
363 CMP_L (CONST(32),width_arg)
370 MOV_L (REGOFF(16,ESI),EAX) /* glyphp[4] */
371 MOV_L (REGOFF(20,ESI),EDX) /* glyphp[5] */
372 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[4][line] */
373 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[5][line] */
375 MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
376 MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
378 MOV_L (EAX,EBX) /* bits = glyph[4][line] */
379 MOV_B (DL,BH) /* nits |= ..[5].. << 8 */
382 ROL_L (CONST(16),EBX)
383 MOV_L (REGOFF(24,ESI),EAX) /* glyphp[6] */
384 MOV_L (REGOFF(28,ESI),ECX) /* glyphp[7] */
385 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[6][line] */
386 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[7][line] */
388 MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
389 MOV_B (REGOFF(BYTE_REVERSED,ECX),BH)
391 MOV_B (AL,BL) /* bits |= ..[6].. << 16 */
392 MOV_B (CL,BH) /* bits |= ..[7].. << 24 */
394 ROL_L (CONST(16),EBX)
396 MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base+1, bits) */
397 ADD_L (CONST(8),EDI) /* base += 2 */
399 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
401 CMP_L (CONST(64),width_arg)
403 ADD_L (CONST(32),ESI) /* glyphp += 8 */
404 SUB_L (CONST(64),width_arg)
409 ADD_L (CONST(4),EDI) /* base++ */
411 MOV_L (EDI,EAX) /* return base */
414 MOV_L (base_arg,EAX) /* return base */
416 MOV_L (REGOFF(0,ESP),EDI) /* POPL EDI */
417 MOV_L (REGOFF(4,ESP),ESI) /* POPL ESI */
418 MOV_L (REGOFF(8,ESP),EBX) /* POPL EBX */
419 MOV_L (REGOFF(12,ESP),EBP) /* POPL EBP */
420 ADD_L (CONST(16),ESP)
427 GLOBL GLNAME(DrawTETextScanlineWidth9PMSBFirstFixedBase)
428 GLNAME(DrawTETextScanlineWidth9PMSBFirstFixedBase):
430 GLOBL GLNAME(DrawTETextScanlineWidth9PLSBFirstFixedBase)
431 GLNAME(DrawTETextScanlineWidth9PLSBFirstFixedBase):
435 GLOBL GLNAME(DrawTETextScanlineWidth9PMSBFirst)
436 GLNAME(DrawTETextScanlineWidth9PMSBFirst):
438 GLOBL GLNAME(DrawTETextScanlineWidth9PLSBFirst)
439 GLNAME(DrawTETextScanlineWidth9PLSBFirst):
443 SUB_L (CONST(16),ESP)
444 MOV_L (EBP,REGOFF(12,ESP)) /* PUSH EBP */
445 MOV_L (EBX,REGOFF(8,ESP)) /* PUSH EBX */
446 MOV_L (ESI,REGOFF(4,ESP)) /* PUSH ESI */
447 MOV_L (EDI,REGOFF(0,ESP)) /* PUSH EDI */
451 MOV_L (glyphp_arg,ESI)
456 /* Pentium-optimized instruction pairing. */
458 MOV_L (REGOFF(4,ESI),EBX) /* glyphp[1] */
459 MOV_L (REGIND(ESI),EAX) /* glyphp[0] */
460 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[1][line] */
461 MOV_L (REGOFF(8,ESI),ECX) /* glyphp[2] */
462 SAL_L (CONST(9),EBX) /* glyphp[1][line] << 9 */
463 MOV_L (REGOFF(12,ESI),EDX) /* glyphp[3] */
464 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[0][line] */
465 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[3][line] */
466 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[2][line] */
467 OR_L (EBX,EAX) /* bits |= ..[1].. << 9 */
468 SAL_L (CONST(18),ECX) /* glyphp[2][line] << 18 */
469 OR_L (ECX,EAX) /* bits |= ..[2].. << 18 */
470 SAL_L (CONST(27),EDX) /* glyphp[3][line << 27 */
473 MOV_L (REGOFF(12,ESI),EBX) /* glyphp[3] */
474 OR_L (EDX,EAX) /* bits |= ..[3].. << 27 */
475 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[3][line] */
476 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
479 OR_L (EDX,EAX) /* bits |= ..[3].. << 27 */
483 MOV_B (REGOFF(BYTE_REVERSED,EBX),AL)
484 MOV_B (REGOFF(BYTE_REVERSED,ECX),AH)
485 ROL_L (CONST(16),EAX)
488 MOV_B (REGOFF(BYTE_REVERSED,EBX),AL)
489 MOV_B (REGOFF(BYTE_REVERSED,ECX),AH)
490 MOV_L (REGOFF(12,ESI),EBX) /* glyphp[3] */
491 ROL_L (CONST(16),EAX)
492 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[3][line] */
493 MOV_L (EAX,REGIND(EDI))
496 CMP_L (CONST(32),width_arg)
499 ADD_L (CONST(4),EDI) /* base++ */
503 /* Note that glyphp[3][line] is read again. */
504 /* EAX = bits, EBX = glyphp[3][line] >> 5 */
505 SHR_L (CONST(5),EBX) /* glyphp[3][line] >> 5 */
506 MOV_L (REGOFF(16,ESI),EAX) /* glyphp[4] */
507 MOV_L (REGOFF(20,ESI),ECX) /* glyphp[5] */
508 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[4][line] */
509 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[5][line] */
510 MOV_L (REGOFF(24,ESI),EDX) /* glyphp[6] */
511 SAL_L (CONST(4),EAX) /* glyphp[4][line] << 4 */
512 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[6][line] */
513 SAL_L (CONST(13),ECX) /* glyphp[5][line] << 13 */
514 OR_L (EBX,EAX) /* bits |= ..[4].. << 4 */
515 SAL_L (CONST(22),EDX) /* glyphp[6][line] << 22 */
516 MOV_L (REGOFF(28,ESI),EBX) /* glyphp[7] */
517 OR_L (ECX,EAX) /* bits |= ..[5].. << 13 */
518 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[7][line] */
519 OR_L (EDX,EAX) /* bits |= ..[6].. << 22 */
522 MOV_L (REGOFF(28,ESI),ECX) /* glyphp[7] */
523 SAL_L (CONST(31),EBX) /* glyphp[7][line] << 31 */
524 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[7][line] */
525 OR_L (EBX,EAX) /* bits |= ..[7].. << 31 */
526 MOV_L (REGOFF(32,ESI),EDX) /* glyphp[8] */
528 MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
530 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
534 SAL_L (CONST(31),EBX) /* glyphp[7][line] << 31 */
536 OR_L (EBX,EAX) /* bits |= ..[7].. << 31 */
539 MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
540 MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
541 ROL_L (CONST(16),EAX)
544 MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
545 MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
546 MOV_L (REGOFF(28,ESI),ECX) /* glyphp[7] */
547 ROL_L (CONST(16),EAX)
548 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[7][line] */
550 MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
552 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
554 MOV_L (REGOFF(32,ESI),EDX) /* glyphp[8] */
557 CMP_L (CONST(64),width_arg)
560 ADD_L (CONST(8),EDI) /* base+=2 */
565 /* Note that glyphp[7][line] is read again. */
566 /* ECX = bits = glyphp[7][line] >> 1 */
567 SHR_L (CONST(1),ECX) /* glyphp[7][line] >> 1 */
568 MOV_L (REGOFF(36,ESI),EBX) /* glyphp[9] */
569 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[8][line] */
570 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[9][line] */
571 SAL_L (CONST(8),EDX) /* glyphp[8][line] << 8 */
572 MOV_L (REGOFF(40,ESI),EAX) /* glyphp[10] */
573 SAL_L (CONST(17),EBX) /* glyphp[9][line] << 17 */
574 OR_L (EDX,ECX) /* bits |= ..[8].. << 8 */
575 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[10][line] */
576 OR_L (EBX,ECX) /* bits |= ..[9].. << 17 */
577 SAL_L (CONST(26),EAX) /* glyphp[10][line] << 26 */
580 MOV_L (REGOFF(40,ESI),EDX) /* glyphp[10] */
581 OR_L (EAX,ECX) /* bits |= ..[10].. << 26 */
582 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[10][line] */
584 MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
586 MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
590 OR_L (EAX,ECX) /* bits |= ..[10].. << 26 */
594 MOV_B (REGOFF(BYTE_REVERSED,EDX),CL)
595 MOV_B (REGOFF(BYTE_REVERSED,EBX),CH)
596 ROL_L (CONST(16),ECX)
599 MOV_B (REGOFF(BYTE_REVERSED,EDX),CL)
600 MOV_B (REGOFF(BYTE_REVERSED,EBX),CH)
601 MOV_L (REGOFF(40,ESI),EDX) /* glyphp[10] */
602 ROL_L (CONST(16),ECX)
603 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[10][line] */
605 MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
607 MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
611 CMP_L (CONST(96),width_arg)
614 ADD_L (CONST(12),EDI) /* base+=3 */
618 /* Note that glyphp[10][line] is read again. */
619 /* EDX = bits = glyphp[10][line] >> 6 */
620 SHR_L (CONST(6),EDX) /* glyphp[10][line] >> 6 */
621 MOV_L (REGOFF(44,ESI),EBX) /* glyphp[11] */
622 MOV_L (REGOFF(48,ESI),EAX) /* glyphp[12] */
623 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[11][line] */
624 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[12][line] */
625 MOV_L (REGOFF(52,ESI),ECX) /* glyphp[13] */
626 SAL_L (CONST(3),EBX) /* glyphp[11][line] << 3 */
627 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[13][line] */
628 SAL_L (CONST(12),EAX) /* glyphp[12][line] << 12 */
629 OR_L (EBX,EDX) /* bits |= ..[11].. << 3 */
630 SAL_L (CONST(21),ECX) /* glyphp[13][line] << 21 */
631 MOV_L (REGOFF(56,ESI),EBX) /* glyphp[14] */
632 OR_L (EAX,EDX) /* bits |= ..[12].. << 17 */
633 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[14][line] */
634 SAL_L (CONST(30),EBX) /* glyphp[14][line] << 30 */
635 OR_L (ECX,EDX) /* bits |= ..[13].. << 21 */
638 MOV_L (REGOFF(56,ESI),EAX) /* glyphp[14] */
639 OR_L (EBX,EDX) /* bits |= ..[14].. << 30 */
640 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[14][line] */
642 MOV_L (EDX,REGOFF(12,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
644 MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
648 OR_L (EBX,EDX) /* bits |= ..[14].. << 30 */
652 MOV_B (REGOFF(BYTE_REVERSED,EAX),DL)
653 MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
654 ROL_L (CONST(16),EDX)
657 MOV_B (REGOFF(BYTE_REVERSED,EAX),DL)
658 MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
659 MOV_L (REGOFF(56,ESI),EAX) /* glyphp[14] */
660 ROL_L (CONST(16),EDX)
661 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[14][line] */
663 MOV_L (EDX,REGOFF(12,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
665 MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
669 CMP_L (CONST(128),width_arg)
672 ADD_L (CONST(16),EDI) /* base+=4 */
676 /* Note that glyphp[14][line] is read again. */
677 /* EAX = bits = glyphp[14][line] >> 2 */
678 SHR_L (CONST(2),EAX) /* glyphp[14][line] >> 2 */
679 MOV_L (REGOFF(60,ESI),ECX) /* glyphp[15] */
680 MOV_L (REGOFF(64,ESI),EBX) /* glyphp[16] */
681 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[15][line] */
682 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[16][line] */
683 MOV_L (REGOFF(68,ESI),EDX) /* glyphp[17] */
684 SAL_L (CONST(7),ECX) /* glyphp[15][line] << 7 */
685 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[17][line] */
686 SAL_L (CONST(16),EBX) /* glyphp[16][line] << 16 */
687 OR_L (ECX,EAX) /* bits |= ..[15].. << 7 */
688 SAL_L (CONST(25),EDX) /* glyphp[17][line] << 25 */
689 OR_L (EBX,EAX) /* bits |= ..[16].. << 16 */
692 MOV_L (REGOFF(68,ESI),ECX) /* glyphp[17] */
693 OR_L (EDX,EAX) /* bits |= ..[17].. << 25 */
694 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[17][line] */
696 MOV_L (EAX,REGOFF(16,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
698 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
702 OR_L (EDX,EAX) /* bits |= ..[17].. << 25 */
706 MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
707 MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
708 ROL_L (CONST(16),EAX)
711 MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
712 MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
713 MOV_L (REGOFF(68,ESI),ECX) /* glyphp[17] */
714 ROL_L (CONST(16),EAX)
715 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[17][line] */
717 MOV_L (EAX,REGOFF(16,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
719 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
723 CMP_L (CONST(160),width_arg)
726 ADD_L (CONST(20),EDI) /* base+=5 */
730 /* Note that glyphp[17][line] is read again. */
731 /* ECX = bits = glyphp[17][line] >> 7 */
732 SHR_L (CONST(7),ECX) /* glyphp[17][line] >> 7 */
733 MOV_L (REGOFF(72,ESI),EBX) /* glyphp[18] */
734 MOV_L (REGOFF(76,ESI),EAX) /* glyphp[19] */
735 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[18][line] */
736 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[19][line] */
737 MOV_L (REGOFF(80,ESI),EDX) /* glyphp[20] */
738 SAL_L (CONST(2),EBX) /* glyphp[18][line] << 2 */
739 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[20][line] */
740 SAL_L (CONST(11),EAX) /* glyphp[19][line] << 11 */
741 OR_L (EBX,ECX) /* bits |= ..[18].. << 2 */
742 SAL_L (CONST(20),EDX) /* glyphp[20][line] << 20 */
743 MOV_L (REGOFF(84,ESI),EBX) /* glyphp[21] */
744 OR_L (EAX,ECX) /* bits |= ..[19].. << 11 */
745 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[21][line] */
746 OR_L (EDX,ECX) /* bits |= ..[20].. << 20 */
749 MOV_L (REGOFF(84,ESI),EAX) /* glyphp[21] */
750 SAL_L (CONST(29),EBX) /* glyphp[21][line] << 29 */
751 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[21][line] */
752 OR_L (EBX,ECX) /* bits |= ..[14].. << 30 */
753 MOV_L (REGOFF(88,ESI),EDX) /* glyphp[22] */
755 MOV_L (ECX,REGOFF(20,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
757 MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
761 SAL_L (CONST(29),EBX) /* glyphp[21][line] << 29 */
763 OR_L (EBX,ECX) /* bits |= ..[14].. << 30 */
766 MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
767 MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
768 ROL_L (CONST(16),ECX)
771 MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
772 MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
773 MOV_L (REGOFF(84,ESI),EAX) /* glyphp[21] */
774 ROL_L (CONST(16),ECX)
775 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[21][line] */
777 MOV_L (ECX,REGOFF(20,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
779 MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
781 MOV_L (REGOFF(88,ESI),EDX) /* glyphp[22] */
784 CMP_L (CONST(192),width_arg)
787 ADD_L (CONST(24),EDI) /* base+=6 */
791 /* Note that glyphp[21][line] is read again. */
792 /* EAX = bits = glyphp[21][line] >> 3 */
793 SHR_L (CONST(3),EAX) /* glyphp[21][line] >> 3 */
794 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[22][line] */
795 MOV_L (REGOFF(92,ESI),EBX) /* glyphp[23] */
796 MOV_L (REGOFF(96,ESI),ECX) /* glyphp[24] */
797 SAL_L (CONST(6),EDX) /* glyphp[22][line] << 6 */
798 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[23][line] */
799 OR_L (EDX,EAX) /* bits |= ..[22].. << 6 */
800 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[24][line] */
801 SAL_L (CONST(15),EBX) /* glyphp[23][line] << 15 */
802 OR_L (EBX,EAX) /* bits |= ..[23].. << 15 */
803 SAL_L (CONST(24),ECX) /* glyphp[24][line] << 24 */
806 MOV_L (REGOFF(96,ESI),EDX) /* glyphp[24] */
807 OR_L (ECX,EAX) /* bits |= ..[24].. << 24 */
808 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[24][line] */
810 MOV_L (EAX,REGOFF(24,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
812 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
816 OR_L (ECX,EAX) /* bits |= ..[24].. << 24 */
820 MOV_B (REGOFF(BYTE_REVERSED,EDX),AL)
821 MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
822 ROL_L (CONST(16),EAX)
825 MOV_B (REGOFF(BYTE_REVERSED,EDX),AL)
826 MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
827 MOV_L (REGOFF(96,ESI),EDX) /* glyphp[24] */
828 ROL_L (CONST(16),EAX)
829 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[24][line] */
831 MOV_L (EAX,REGOFF(24,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
833 MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
837 CMP_L (CONST(224),width_arg)
840 ADD_L (CONST(28),EDI) /* base+=7 */
844 /* Note that glyphp[24][line] is read again. */
845 /* EDX = bits = glyphp[24][line] >> 8 */
847 SHR_L (CONST(8),EDX) /* glyphp[24][line] >> 8 */
848 MOV_L (REGOFF(100,ESI),EAX) /* glyphp[25] */
849 MOV_L (REGOFF(104,ESI),EBX) /* glyphp[26] */
850 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[25][line] */
851 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[26][line] */
852 MOV_L (REGOFF(108,ESI),ECX) /* glyphp[27] */
853 SAL_L (CONST(1),EAX) /* glyphp[25][line] << 1 */
854 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[27][line] */
855 SAL_L (CONST(10),EBX) /* glyphp[26][line] << 10 */
856 OR_L (EAX,EDX) /* bits |= ..[25].. << 1 */
857 SAL_L (CONST(19),ECX) /* glyphp[27][line] << 19 */
858 OR_L (EBX,EDX) /* bits |= ..[26].. << 10 */
859 MOV_L (REGOFF(112,ESI),EAX) /* glyphp[28] */
860 OR_L (ECX,EDX) /* bits |= ..[27].. << 19 */
861 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[28][line] */
864 MOV_L (REGOFF(112,ESI),EBX) /* glyphp[28] */
865 SAL_L (CONST(28),EAX) /* glyphp[28][line] << 28 */
866 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[28][line] */
867 OR_L (EAX,EDX) /* bits |= ..[28].. << 28 */
868 MOV_L (REGOFF(116,ESI),ECX) /* glyphp[29] */
870 MOV_L (EDX,REGOFF(28,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
872 MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
876 SAL_L (CONST(28),EAX) /* glyphp[28][line] << 28 */
878 OR_L (EAX,EDX) /* bits |= ..[28].. << 28 */
881 MOV_B (REGOFF(BYTE_REVERSED,EBX),DL)
882 MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
883 ROL_L (CONST(16),EDX)
886 MOV_B (REGOFF(BYTE_REVERSED,EBX),DL)
887 MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
888 MOV_L (REGOFF(112,ESI),EBX) /* glyphp[28] */
889 ROL_L (CONST(16),EDX)
890 MOV_L (REGOFF(116,ESI),ECX) /* glyphp[29] */
892 MOV_L (EDX,REGOFF(28,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
894 MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
896 MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[28][line] */
899 CMP_L (CONST(256),width_arg)
902 ADD_L (CONST(32),EDI) /* base+=8 */
906 /* Note that glyphp[28][line] is read again. */
907 /* EBX = bits = glyphp[28][line] >> 4 */
908 SHR_L (CONST(4),EBX) /* glyphp[28][line] >> 4 */
909 MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[29][line] */
910 MOV_L (REGOFF(120,ESI),EAX) /* glyphp[30] */
911 MOV_L (REGOFF(124,ESI),EDX) /* glyphp[31] */
912 SAL_L (CONST(5),ECX) /* glyphp[29][line] << 5 */
913 MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[30][line] */
914 OR_L (ECX,EBX) /* bits |= ..[29].. << 5 */
915 MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[31][line] */
916 SAL_L (CONST(14),EAX) /* glyphp[30][line] << 14 */
917 ADD_L (CONST(128),ESI) /* glyphp+=32 */
918 SAL_L (CONST(23),EDX) /* glyphp[31][line] << 23 */
919 OR_L (EAX,EBX) /* bits |= ..[30].. << 14 */
920 SUB_L (CONST(288),width_arg) /* width-=288 */
921 OR_L (EDX,EBX) /* bits |= ..[31].. << 23 */
925 MOV_L (EBX,REGOFF(32,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
927 MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
934 MOV_B (REGOFF(BYTE_REVERSED,ECX),BL)
935 MOV_B (REGOFF(BYTE_REVERSED,EAX),BH)
936 ROL_L (CONST(16),EBX)
939 MOV_B (REGOFF(BYTE_REVERSED,ECX),BL)
940 MOV_B (REGOFF(BYTE_REVERSED,EAX),BH)
941 ROL_L (CONST(16),EBX)
943 MOV_L (EBX,REGOFF(32,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
945 MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
949 ADD_L (CONST(36),EDI) /* base+=9 */
950 CMP_L (CONST(0),width_arg)
955 MOV_L (EDI,EAX) /* return base */
957 MOV_L (base_arg,EAX) /* return base */
959 MOV_L (REGOFF(0,ESP),EDI) /* POPL EDI */
960 MOV_L (REGOFF(4,ESP),ESI) /* POPL ESI */
961 MOV_L (REGOFF(8,ESP),EBX) /* POPL EBX */
962 MOV_L (REGOFF(12,ESP),EBP) /* POPL EBP */
963 ADD_L (CONST(16),ESP)