Posted to tcl by GPS at Mon Nov 12 13:54:51 GMT 2007view raw

  1. /* Predict that cond will be true and the body should be evaluated. */
  2. #define ptif(cond,body) do { \
  3. asm volatile ("cmpl $1,%0\n" \
  4. ".byte 0x2e\n" \
  5. "jne 1f\n" : : "r" (cond)); \
  6. body; \
  7. asm volatile ("1:"); \
  8. } while (0)
  9.  
  10.  
  11. ptif (i != 999999,
  12. i = 123435353;
  13. );
  14.  
  15. .L2:
  16. cmpl $999999, %ebx
  17. setne %al
  18. movzbl %al, %eax
  19. #APP
  20. cmpl $1,%eax
  21. .byte 0x2e
  22. jne 1f
  23.  
  24. 1:
  25. #NO_APP
  26. movl $123435353, 4(%esp)
  27. movl $.LC1, (%esp)
  28.  
  29. Therein lies the problem, the label is reordered...