Changeset 678


Ignore:
Timestamp:
Sep 9, 2003, 9:21:51 PM (22 years ago)
Author:
bird
Message:

Fixed testcase.

Location:
trunk/testcase/optlink
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/testcase/optlink/tst1.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r677 r678  
    1717
    1818/** in asm */
    19 extern int _Optlink asmfoo (int i1, int i2, int i3, float rf1, float rf2, float rf3, float rf4);
     19extern int _Optlink asmfoo (int i1, int i2, int i3, double rf1, double rf2, double rf3, double rf4);
    2020
    21 extern int _Optlink foo (int i1, int i2, int i3, float rf1, float rf2, float rf3, float rf4)
     21extern int _Optlink foo (int i1, int i2, int i3, double rf1, double rf2, double rf3, double rf4)
    2222{
    2323    if (i1 != 1)
  • trunk/testcase/optlink/tst1.gmk

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r677 r678  
    1515TESTCASE=tst1
    1616CFLAGS  = -Zomf
     17LFLAGS  = -Zmap
    1718O               = .obj
    1819A           = .lib
     
    5152                               
    5253$(TESTCASE).exe: $(EXEOBJS) $(TESTCASE).gmk
    53         if $(CC) -Zmap $(CFLAGS) -o "$@" $(EXEOBJS) -lstdc++; then true; \
     54        if $(CC) $(CFLAGS) $(LFLAGS) -o "$@" $(EXEOBJS) -lstdc++; then true; \
    5455        else    rm -f $@; false; \
    5556        fi
  • trunk/testcase/optlink/tst1asm.asm

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r677 r678  
    1212;
    1313
    14 
    15     .386
    16 
     14        .386
     15        .387
    1716CODE32  segment para use32 public 'CODE'
    1817CODE32  ends
     18DATA32  segment para use32 public 'DATA'
     19DATA32  ends
    1920CONST32_RO      segment para use32 public 'CONST'
    2021CONST32_RO      ends
    21 
     22BSS32   segment para use32 public 'BSS'
     23BSS32   ends
     24DGROUP  group BSS32, DATA32
     25        assume  cs:FLAT, ds:FLAT, ss:FLAT, es:FLAT
    2226CONST32_RO      segment
    2327@CBE1   dq 3ff199999999999ar    ; 1.1000000000000000e+00
     
    2731CONST32_RO      ends
    2832CODE32  segment
    29     ASSUME ds:FLAT, es:FLAT, ss:FLAT
    3033
    31 ; 2 extern int _Optlink foo (int i1, int i2, int i3, float rf1, float rf2, float rf3, float rf4)
     34; 15 extern int _Optlink asmfoo (int i1, int i2, int i3, double rf1, double rf2, double rf3, double rf4)
    3235        align 010h
    3336
    3437        public asmfoo
    3538asmfoo  proc
     39        push    ebp
     40        mov     ebp,esp
     41        mov     [ebp+08h],eax;  i1
     42        mov     [ebp+0ch],edx;  i2
     43        mov     [ebp+010h],ecx; i3
     44        fstp    qword ptr [ebp+014h];   rf1
     45        fstp    qword ptr [ebp+01ch];   rf2
     46        fstp    qword ptr [ebp+024h];   rf3
     47        fstp    qword ptr [ebp+02ch];   rf4
    3648
    37 ; 4     if (i1 != 1)
    38         cmp     eax,01h
     49; 17     if (i1 != 1)
     50        cmp     dword ptr [ebp+08h],01h;        i1
    3951        je      @BLBL1
    40         fstp    st(0)
    41         fstp    st(0)
    42         fstp    st(0)
    43         fstp    st(0)
    4452
    45 ; 5         return 1;
     53; 18         return 1;
    4654        mov     eax,01h
     55        pop     ebp
    4756        ret     
    4857        align 010h
    4958@BLBL1:
    5059
    51 ; 6     if (i2 != 2)
    52         cmp     edx,02h
     60; 19     if (i2 != 2)
     61        cmp     dword ptr [ebp+0ch],02h;        i2
    5362        je      @BLBL2
    54         fstp    st(0)
    55         fstp    st(0)
    56         fstp    st(0)
    57         fstp    st(0)
    5863
    59 ; 7         return 2;
    60         inc     eax
     64; 20         return 2;
     65        mov     eax,02h
     66        pop     ebp
    6167        ret     
    6268        align 010h
    6369@BLBL2:
    6470
    65 ; 8     if (i3 != 3)
    66         cmp     ecx,03h
     71; 21     if (i3 != 3)
     72        cmp     dword ptr [ebp+010h],03h;       i3
    6773        je      @BLBL3
    68         fstp    st(0)
    69         fstp    st(0)
    70         fstp    st(0)
    71         fstp    st(0)
    7274
    73 ; 9         return 3;
    74         lea     eax,[eax+02h]
     75; 22         return 3;
     76        mov     eax,03h
     77        pop     ebp
    7578        ret     
    7679        align 010h
    7780@BLBL3:
    7881
    79 ; 10     if (rf1 != 1.1)
     82; 23     if (rf1 != 1.1)
    8083        fld     qword ptr  @CBE1
     84        fld     qword ptr [ebp+014h];   rf1
    8185        fucompp
    8286        fnstsw  ax
     
    8488        cmp     ax,04000h
    8589        je      @BLBL4
    86         fstp    st(0)
    87         fstp    st(0)
    88         fstp    st(0)
    8990
    90 ; 11         return 4;
    91         lea     eax,[ecx+01h]
     91; 24         return 4;
     92        mov     eax,04h
     93        pop     ebp
    9294        ret     
    9395        align 010h
    9496@BLBL4:
    9597
    96 ; 12     if (rf2 != 1.2)
     98; 25     if (rf2 != 1.2)
    9799        fld     qword ptr  @CBE2
     100        fld     qword ptr [ebp+01ch];   rf2
    98101        fucompp
    99102        fnstsw  ax
     
    101104        cmp     ax,04000h
    102105        je      @BLBL5
    103         fstp    st(0)
    104         fstp    st(0)
    105106
    106 ; 13         return 5;
    107         lea     eax,[ecx+02h]
     107; 26         return 5;
     108        mov     eax,05h
     109        pop     ebp
    108110        ret     
    109111        align 010h
    110112@BLBL5:
    111113
    112 ; 14     if (rf3 != 1.3)
     114; 27     if (rf3 != 1.3)
    113115        fld     qword ptr  @CBE3
     116        fld     qword ptr [ebp+024h];   rf3
    114117        fucompp
    115118        fnstsw  ax
     
    117120        cmp     ax,04000h
    118121        je      @BLBL6
    119         fstp    st(0)
    120122
    121 ; 15         return 6;
    122         lea     eax,[ecx+03h]
     123; 28         return 6;
     124        mov     eax,06h
     125        pop     ebp
    123126        ret     
    124127        align 010h
    125128@BLBL6:
    126129
    127 ; 16     if (rf4 != 1.4)
    128 ; 17         return 7;
     130; 29     if (rf4 != 1.4)
    129131        fld     qword ptr  @CBE4
     132        fld     qword ptr [ebp+02ch];   rf4
    130133        fucompp
    131134        fnstsw  ax
    132135        and     ax,04500h
    133136        cmp     ax,04000h
    134         setne   al
    135         and     eax,01h
    136         neg     eax
    137         and     eax,07h
     137        je      @BLBL7
     138
     139; 30         return 7;
     140        mov     eax,07h
     141        pop     ebp
     142        ret     
     143        align 010h
     144@BLBL7:
     145
     146; 31     return 0;
     147        mov     eax,0h
     148        pop     ebp
    138149        ret     
    139150asmfoo  endp
    140151CODE32  ends
    141 
    142152end
  • trunk/testcase/optlink/tst1asmc.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r677 r678  
    1313 */
    1414
    15 extern int _Optlink asmfoo (int i1, int i2, int i3, float rf1, float rf2, float rf3, float rf4)
     15extern int _Optlink asmfoo (int i1, int i2, int i3, double rf1, double rf2, double rf3, double rf4)
    1616{
    1717    if (i1 != 1)
  • trunk/testcase/optlink/tst2.cpp

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r677 r678  
    3939    if (pv != (void*)4)
    4040        return 4;
    41     if (rf1 != 1.5)
     41    if (rf1 != (float)1.5)
    4242        return 5;
    4343    if (s2.a != 6)
  • trunk/testcase/optlink/tst2asm.asm

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r677 r678  
    1 ; $Id$
    2 ;
    3 ; Optlink testcase no. 2.
    4 ;
    5 ; InnoTek Systemberatung GmbH confidential
    6 ;
    7 ; Copyright (c) 2003 InnoTek Systemberatung GmbH
    8 ; Author: knut st. osmundsen <bird-srcspam@anduin.net>
    9 ;
    10 ; All Rights Reserved
    11 ;
    12 ;
    13 
    14 
    15     .386
    16 
     1        .386
     2        .387
    173CODE32  segment para use32 public 'CODE'
    184CODE32  ends
     5DATA32  segment para use32 public 'DATA'
     6DATA32  ends
    197CONST32_RO      segment para use32 public 'CONST'
    208CONST32_RO      ends
    21 
    22 
     9BSS32   segment para use32 public 'BSS'
     10BSS32   ends
     11DGROUP  group BSS32, DATA32
     12        assume  cs:FLAT, ds:FLAT, ss:FLAT, es:FLAT
    2313CONST32_RO      segment
    2414@CBE1   dq 3ff8000000000000r    ; 1.5000000000000000e+00
    2515CONST32_RO      ends
    26 
    2716CODE32  segment
    28     ASSUME ds:FLAT, es:FLAT, ss:FLAT
    2917
    3018; 21 int _Optlink asmfoo(int i1, struct sss s1, void *pv, float rf1, struct sss s2)
     
    3321        public asmfoo
    3422asmfoo  proc
     23        push    ebp
     24        mov     ebp,esp
     25        mov     [ebp+08h],eax;  i1
     26        mov     [ebp+014h],edx; pv
     27        fstp    dword ptr [ebp+018h];   rf1
    3528
    3629; 23     if (i1 != 1)
    37         cmp     eax,01h
     30        cmp     dword ptr [ebp+08h],01h;        i1
    3831        je      @BLBL1
    39         fstp    st(0)
    4032
    4133; 24         return 1;
    4234        mov     eax,01h
     35        pop     ebp
    4336        ret     
    4437        align 010h
     
    4639
    4740; 25     if (s1.a != 2)
    48         cmp     dword ptr [esp+08h],02h;        s1
     41        cmp     dword ptr [ebp+0ch],02h;        s1
    4942        je      @BLBL2
    50         fstp    st(0)
    5143
    5244; 26         return 2;
    53         inc     eax
     45        mov     eax,02h
     46        pop     ebp
    5447        ret     
    5548        align 010h
     
    5750
    5851; 27     if (s1.b != 3)
    59         cmp     dword ptr [esp+0ch],03h;        s1
     52        cmp     dword ptr [ebp+010h],03h;       s1
    6053        je      @BLBL3
    61         fstp    st(0)
    6254
    6355; 28         return 3;
    64         lea     eax,[eax+02h]
     56        mov     eax,03h
     57        pop     ebp
    6558        ret     
    6659        align 010h
     
    6861
    6962; 29     if (pv != (void*)4)
    70         cmp     edx,04h
     63        cmp     dword ptr [ebp+014h],04h;       pv
    7164        je      @BLBL4
    72         fstp    st(0)
    7365
    7466; 30         return 4;
    75         lea     eax,[eax+03h]
     67        mov     eax,04h
     68        pop     ebp
    7669        ret     
    7770        align 010h
    7871@BLBL4:
    7972
    80 ; 31     if (rf1 != 1.5)
     73; 31     if (rf1 != (float)1.5)
    8174        fld     dword ptr  @CBE2
     75        fld     dword ptr [ebp+018h];   rf1
    8276        fucompp
    8377        fnstsw  ax
     
    8781
    8882; 32         return 5;
    89         lea     eax,[edx+01h]
     83        mov     eax,05h
     84        pop     ebp
    9085        ret     
    9186        align 010h
     
    9388
    9489; 33     if (s2.a != 6)
    95         cmp     dword ptr [esp+018h],06h;       s2
     90        cmp     dword ptr [ebp+01ch],06h;       s2
    9691        je      @BLBL6
    9792
    9893; 34         return 6;
    99         lea     eax,[edx+02h]
     94        mov     eax,06h
     95        pop     ebp
    10096        ret     
    10197        align 010h
     
    10399
    104100; 35     if (s2.b != 7)
     101        cmp     dword ptr [ebp+020h],07h;       s2
     102        je      @BLBL7
     103
    105104; 36         return 7;
    106         xor     eax,eax
    107         cmp     dword ptr [esp+01ch],07h;       s2
    108         setne   al
    109         neg     eax
    110         and     eax,07h
     105        mov     eax,07h
     106        pop     ebp
     107        ret     
     108        align 010h
     109@BLBL7:
     110
     111; 37     return 0;
     112        mov     eax,0h
     113        pop     ebp
    111114        ret     
    112115asmfoo  endp
    113 
    114116CONST32_RO      segment
    115117        align 04h
    116118@CBE2   dd 3fc00000r    ; 1.5000000e+00
    117119CONST32_RO      ends
    118 
    119120CODE32  ends
    120 
    121121end
    122 
  • trunk/testcase/optlink/tst2asmc.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r677 r678  
    2929    if (pv != (void*)4)
    3030        return 4;
    31     if (rf1 != 1.5)
     31    if (rf1 != (float)1.5)
    3232        return 5;
    3333    if (s2.a != 6)
Note: See TracChangeset for help on using the changeset viewer.