summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/testmovd.pp
blob: 30a0e37e8900f30fdfb5748664fc4fffb7c996c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ %CPU=i386 }
{ %maxversion=1.0.99 }

{ This file tests the movd instruction has this
  instruction does convert 32 bit into 64 bit
  which is not handled by the normal assembler instruction
  suffixes Pierre Muller }

uses
  mmx;

{$asmmode intel}


procedure test_intel; { do not run }
begin
  asm
    SUB  ESP,4
    MOVD [ESP],MM7
    MOVD MM0,DWORD PTR [ESP]
    MOVD MM1,[ESP]
    MOVD DWORD PTR [ESP],MM3
    ADD  ESP,4
  end;
end;

procedure test_cvtsi2ss_intel;
begin
  asm
    cvtsi2ss xmm2,DWORD PTR [esp]
    cvtsi2ss xmm2, [esp]
  end;
end;

{$asmmode att}

procedure test_att; { do not run }
begin
  asm
    subl  $4,%esp
    movd  (%esp),%mm2
    movd  %mm6,(%esp)
    addl  $4,%esp
  end;
end;

procedure test_cvtsi2ss_att;
begin
  asm
    cvtsi2ss (%esp),%xmm2
  end;
end;

begin
   if is_mmx_cpu then
     begin
       emms;
       test_att;
       test_intel;
     end;
end.