testmovd.pp 893 B

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