comparison cabac.h @ 4035:b7f31a32bb30 libavcodec

cosmetic (%%eax->%0)
author michael
date Tue, 17 Oct 2006 09:38:37 +0000
parents fbe263601152
children 53be304c7f54
comparison
equal deleted inserted replaced
4034:fbe263601152 4035:b7f31a32bb30
370 #define BYTESTART "12" 370 #define BYTESTART "12"
371 #define BYTE "16" 371 #define BYTE "16"
372 #define BYTEEND "20" 372 #define BYTEEND "20"
373 #ifndef BRANCHLESS_CABAC_DECODER 373 #ifndef BRANCHLESS_CABAC_DECODER
374 asm volatile( 374 asm volatile(
375 "movzbl (%1), %%eax \n\t" 375 "movzbl (%1), %0 \n\t"
376 "movl "RANGE "(%2), %%ebx \n\t" 376 "movl "RANGE "(%2), %%ebx \n\t"
377 "movl "RANGE "(%2), %%edx \n\t" 377 "movl "RANGE "(%2), %%edx \n\t"
378 "andl $0xC0, %%ebx \n\t" 378 "andl $0xC0, %%ebx \n\t"
379 "movzbl "MANGLE(ff_h264_lps_range)"(%%eax, %%ebx, 2), %%esi\n\t" 379 "movzbl "MANGLE(ff_h264_lps_range)"(%0, %%ebx, 2), %%esi\n\t"
380 "movl "LOW "(%2), %%ebx \n\t" 380 "movl "LOW "(%2), %%ebx \n\t"
381 //eax:state ebx:low, edx:range, esi:RangeLPS 381 //eax:state ebx:low, edx:range, esi:RangeLPS
382 "subl %%esi, %%edx \n\t" 382 "subl %%esi, %%edx \n\t"
383 "movl %%edx, %%ecx \n\t" 383 "movl %%edx, %%ecx \n\t"
384 "shll $17, %%ecx \n\t" 384 "shll $17, %%ecx \n\t"
396 "cmp $0x100, %%edx \n\t" //FIXME avoidable 396 "cmp $0x100, %%edx \n\t" //FIXME avoidable
397 "setb %%cl \n\t" 397 "setb %%cl \n\t"
398 "shl %%cl, %%edx \n\t" 398 "shl %%cl, %%edx \n\t"
399 "shl %%cl, %%ebx \n\t" 399 "shl %%cl, %%ebx \n\t"
400 #endif 400 #endif
401 "movzbl "MANGLE(ff_h264_mps_state)"(%%eax), %%ecx \n\t" 401 "movzbl "MANGLE(ff_h264_mps_state)"(%0), %%ecx \n\t"
402 "movb %%cl, (%1) \n\t" 402 "movb %%cl, (%1) \n\t"
403 //eax:state ebx:low, edx:range, esi:RangeLPS 403 //eax:state ebx:low, edx:range, esi:RangeLPS
404 "test %%bx, %%bx \n\t" 404 "test %%bx, %%bx \n\t"
405 " jnz 2f \n\t" 405 " jnz 2f \n\t"
406 "movl "BYTE "(%2), %%esi \n\t" 406 "movl "BYTE "(%2), %%esi \n\t"
417 "subl %%ecx, %%ebx \n\t" 417 "subl %%ecx, %%ebx \n\t"
418 "movl %%esi, %%edx \n\t" 418 "movl %%esi, %%edx \n\t"
419 "movzbl " MANGLE(ff_h264_norm_shift) "(%%esi), %%ecx \n\t" 419 "movzbl " MANGLE(ff_h264_norm_shift) "(%%esi), %%ecx \n\t"
420 "shll %%cl, %%ebx \n\t" 420 "shll %%cl, %%ebx \n\t"
421 "shll %%cl, %%edx \n\t" 421 "shll %%cl, %%edx \n\t"
422 "movzbl "MANGLE(ff_h264_lps_state)"(%%eax), %%ecx \n\t" 422 "movzbl "MANGLE(ff_h264_lps_state)"(%0), %%ecx \n\t"
423 "movb %%cl, (%1) \n\t" 423 "movb %%cl, (%1) \n\t"
424 "addl $1, %%eax \n\t" 424 "addl $1, %0 \n\t"
425 "test %%bx, %%bx \n\t" 425 "test %%bx, %%bx \n\t"
426 " jnz 2f \n\t" 426 " jnz 2f \n\t"
427 427
428 "movl "BYTE "(%2), %%ecx \n\t" 428 "movl "BYTE "(%2), %%ecx \n\t"
429 "movzwl (%%ecx), %%esi \n\t" 429 "movzwl (%%ecx), %%esi \n\t"
450 : "%ecx", "%ebx", "%edx", "%esi", "memory" 450 : "%ecx", "%ebx", "%edx", "%esi", "memory"
451 ); 451 );
452 bit&=1; 452 bit&=1;
453 #else /* BRANCHLESS_CABAC_DECODER */ 453 #else /* BRANCHLESS_CABAC_DECODER */
454 asm volatile( 454 asm volatile(
455 "movzbl (%1), %%eax \n\t" 455 "movzbl (%1), %0 \n\t"
456 "movl "RANGE "(%2), %%ebx \n\t" 456 "movl "RANGE "(%2), %%ebx \n\t"
457 "movl "RANGE "(%2), %%edx \n\t" 457 "movl "RANGE "(%2), %%edx \n\t"
458 "andl $0xC0, %%ebx \n\t" 458 "andl $0xC0, %%ebx \n\t"
459 "movzbl "MANGLE(ff_h264_lps_range)"(%%eax, %%ebx, 2), %%esi\n\t" 459 "movzbl "MANGLE(ff_h264_lps_range)"(%0, %%ebx, 2), %%esi\n\t"
460 "movl "LOW "(%2), %%ebx \n\t" 460 "movl "LOW "(%2), %%ebx \n\t"
461 //eax:state ebx:low, edx:range, esi:RangeLPS 461 //eax:state ebx:low, edx:range, esi:RangeLPS
462 "subl %%esi, %%edx \n\t" 462 "subl %%esi, %%edx \n\t"
463 #if (defined CMOV_IS_FAST && __CPU__ >= 686) 463 #if (defined CMOV_IS_FAST && __CPU__ >= 686)
464 "movl %%edx, %%ecx \n\t" 464 "movl %%edx, %%ecx \n\t"
466 "cmpl %%ebx, %%edx \n\t" 466 "cmpl %%ebx, %%edx \n\t"
467 "cmova %%ecx, %%esi \n\t" 467 "cmova %%ecx, %%esi \n\t"
468 "sbbl %%ecx, %%ecx \n\t" 468 "sbbl %%ecx, %%ecx \n\t"
469 "andl %%ecx, %%edx \n\t" 469 "andl %%ecx, %%edx \n\t"
470 "subl %%edx, %%ebx \n\t" 470 "subl %%edx, %%ebx \n\t"
471 "xorl %%ecx, %%eax \n\t" 471 "xorl %%ecx, %0 \n\t"
472 #else /* CMOV_IS_FAST */ 472 #else /* CMOV_IS_FAST */
473 "movl %%edx, %%ecx \n\t" 473 "movl %%edx, %%ecx \n\t"
474 "shl $17, %%edx \n\t" 474 "shl $17, %%edx \n\t"
475 "subl %%ebx, %%edx \n\t" 475 "subl %%ebx, %%edx \n\t"
476 "sarl $31, %%edx \n\t" //lps_mask 476 "sarl $31, %%edx \n\t" //lps_mask
478 "andl %%edx, %%esi \n\t" //(RangeLPS - range)&lps_mask 478 "andl %%edx, %%esi \n\t" //(RangeLPS - range)&lps_mask
479 "addl %%ecx, %%esi \n\t" //new range 479 "addl %%ecx, %%esi \n\t" //new range
480 "shl $17, %%ecx \n\t" 480 "shl $17, %%ecx \n\t"
481 "andl %%edx, %%ecx \n\t" 481 "andl %%edx, %%ecx \n\t"
482 "subl %%ecx, %%ebx \n\t" 482 "subl %%ecx, %%ebx \n\t"
483 "xorl %%edx, %%eax \n\t" 483 "xorl %%edx, %0 \n\t"
484 #endif /* CMOV_IS_FAST */ 484 #endif /* CMOV_IS_FAST */
485 485
486 //eax:state ebx:low edx:mask esi:range 486 //eax:state ebx:low edx:mask esi:range
487 487
488 //eax:bit ebx:low esi:range 488 //eax:bit ebx:low esi:range
489 489
490 "movzbl " MANGLE(ff_h264_norm_shift) "(%%esi), %%ecx \n\t" 490 "movzbl " MANGLE(ff_h264_norm_shift) "(%%esi), %%ecx \n\t"
491 "shll %%cl, %%esi \n\t" 491 "shll %%cl, %%esi \n\t"
492 "movzbl "MANGLE(ff_h264_mlps_state)"+128(%%eax), %%edx \n\t" 492 "movzbl "MANGLE(ff_h264_mlps_state)"+128(%0), %%edx \n\t"
493 "movb %%dl, (%1) \n\t" 493 "movb %%dl, (%1) \n\t"
494 "movl %%esi, "RANGE "(%2) \n\t" 494 "movl %%esi, "RANGE "(%2) \n\t"
495 "shll %%cl, %%ebx \n\t" 495 "shll %%cl, %%ebx \n\t"
496 "movl %%ebx, "LOW "(%2) \n\t" 496 "movl %%ebx, "LOW "(%2) \n\t"
497 "test %%bx, %%bx \n\t" 497 "test %%bx, %%bx \n\t"