|
Lines 45-50
Link Here
|
| 45 |
.type shade_ximage_16_mmx,@function |
45 |
.type shade_ximage_16_mmx,@function |
| 46 |
.global shade_ximage_32_mmx |
46 |
.global shade_ximage_32_mmx |
| 47 |
.type shade_ximage_32_mmx,@function |
47 |
.type shade_ximage_32_mmx,@function |
|
|
48 |
.global shade_ximage_24_mmx |
| 49 |
.type shade_ximage_24_mmx,@function |
| 48 |
|
50 |
|
| 49 |
.bss |
51 |
.bss |
| 50 |
.text |
52 |
.text |
|
Lines 483-486
Link Here
|
| 483 |
3: |
485 |
3: |
| 484 |
LEAVE |
486 |
LEAVE |
| 485 |
|
487 |
|
|
|
488 |
|
| 489 |
shade_ximage_24_mmx: |
| 490 |
ENTER |
| 491 |
|
| 492 |
leal (%esi, %ebx, 3), %esi |
| 493 |
negl %ebx |
| 494 |
jz 3f |
| 495 |
|
| 496 |
movd rm, %mm4 |
| 497 |
movd gm, %mm5 |
| 498 |
movd bm, %mm6 |
| 499 |
psllq $32, %mm4 |
| 500 |
psllq $16, %mm5 |
| 501 |
por %mm6, %mm4 |
| 502 |
por %mm5, %mm4 |
| 503 |
|
| 504 |
pcmpeqw %mm6, %mm6 |
| 505 |
psllw $15, %mm6 /* 80 00 80 00 80 00 80 00 */ |
| 506 |
movq %mm6, %mm5 |
| 507 |
pmulhw %mm4, %mm5 /* Get correction factor */ |
| 508 |
1: |
| 509 |
movl %ebx, %ecx |
| 510 |
2: |
| 511 |
movd (%esi, %ecx, 3), %mm1 /* 00 rr gg bb */ |
| 512 |
movd %mm1, %mm2 /* we need 8 bits of this later */ |
| 513 |
pxor %mm0, %mm0 |
| 514 |
punpcklbw %mm1, %mm0 /* 00 00 rr 00 gg 00 bb 00 */ |
| 515 |
pxor %mm6, %mm0 /* Flip sign */ |
| 516 |
|
| 517 |
pmulhw %mm4, %mm0 /* 00 00 xx rr xx gg xx bb */ |
| 518 |
psubw %mm5, %mm0 /* Correct range */ |
| 519 |
packuswb %mm0, %mm0 /* 00 rr gg bb 00 rr gg bb */ |
| 520 |
|
| 521 |
pand 0xFF000000, %mm2 /* FF 00 00 00 */ |
| 522 |
por %mm2, %mm0 /* 8 old bits + 24 new ones */ |
| 523 |
|
| 524 |
movd %mm0, (%esi, %ecx, 3) /* This will be fine as long as nothing jacks with the */ |
| 525 |
/* byte following the imagemap in memory between the */ |
| 526 |
/* time it was read and now (only for the last pixel) */ |
| 527 |
/* Eterm is not threaded so no problem */ |
| 528 |
incl %ecx |
| 529 |
jnz 2b |
| 530 |
|
| 531 |
addl bpl, %esi |
| 532 |
decl %edx |
| 533 |
jnz 1b |
| 534 |
3: |
| 535 |
LEAVE |
| 536 |
|
| 537 |
|
| 486 |
#endif /* HAVE_MMX */ |
538 |
#endif /* HAVE_MMX */ |