testmovd.pp 869 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. { %CPU=i386 }
  2. { This file tests the movd instruction has this
  3. instruction does convert 32 bit into 64 bit
  4. which is not handled by the normal assembler instruction
  5. suffixes Pierre Muller }
  6. uses
  7. mmx;
  8. {$asmmode intel}
  9. procedure test_intel; { do not run }
  10. begin
  11. asm
  12. SUB ESP,4
  13. MOVD [ESP],MM7
  14. MOVD MM0,DWORD PTR [ESP]
  15. MOVD MM1,[ESP]
  16. MOVD DWORD PTR [ESP],MM3
  17. ADD ESP,4
  18. end;
  19. end;
  20. procedure test_cvtsi2ss_intel;
  21. begin
  22. asm
  23. cvtsi2ss xmm2,DWORD PTR [esp]
  24. cvtsi2ss xmm2, [esp]
  25. end;
  26. end;
  27. {$asmmode att}
  28. procedure test_att; { do not run }
  29. begin
  30. asm
  31. subl $4,%esp
  32. movd (%esp),%mm2
  33. movd %mm6,(%esp)
  34. addl $4,%esp
  35. end;
  36. end;
  37. procedure test_cvtsi2ss_att;
  38. begin
  39. asm
  40. cvtsi2ss (%esp),%xmm2
  41. end;
  42. end;
  43. begin
  44. if is_mmx_cpu then
  45. begin
  46. emms;
  47. test_att;
  48. test_intel;
  49. end;
  50. end.