testmovd.pp 855 B

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