OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [sim/] [testsuite/] [sim/] [mips/] [fpu64-ps.s] - Diff between revs 24 and 33

Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 33
# mips test sanity, expected to pass.
# mips test sanity, expected to pass.
# mach:  mips64 sb1
# mach:  mips64 sb1
# as:           -mabi=eabi
# as:           -mabi=eabi
# ld:           -N -Ttext=0x80010000
# ld:           -N -Ttext=0x80010000
# output:       *\\npass\\n
# output:       *\\npass\\n
 
 
        .include "testutils.inc"
        .include "testutils.inc"
 
 
        .macro check_ps psval, upperval, lowerval
        .macro check_ps psval, upperval, lowerval
        .set push
        .set push
        .set noreorder
        .set noreorder
        cvt.s.pu        $f0, \psval             # upper
        cvt.s.pu        $f0, \psval             # upper
        cvt.s.pl        $f2, \psval             # lower
        cvt.s.pl        $f2, \psval             # lower
        li.s            $f4, \upperval
        li.s            $f4, \upperval
        li.s            $f6, \lowerval
        li.s            $f6, \lowerval
        c.eq.s          $fcc0, $f0, $f4
        c.eq.s          $fcc0, $f0, $f4
        bc1f            $fcc0, _fail
        bc1f            $fcc0, _fail
         c.eq.s         $fcc0, $f2, $f6
         c.eq.s         $fcc0, $f2, $f6
        bc1f            $fcc0, _fail
        bc1f            $fcc0, _fail
         nop
         nop
        .set pop
        .set pop
        .endm
        .endm
 
 
        setup
        setup
 
 
        .set noreorder
        .set noreorder
 
 
        .ent DIAG
        .ent DIAG
DIAG:
DIAG:
 
 
        # make sure that Status.FR and .CU1 are set.
        # make sure that Status.FR and .CU1 are set.
        mfc0    $2, $12
        mfc0    $2, $12
        or      $2, $2, (1 << 26) | (1 << 29)
        or      $2, $2, (1 << 26) | (1 << 29)
        mtc0    $2, $12
        mtc0    $2, $12
 
 
 
 
        writemsg "ldc1"
        writemsg "ldc1"
 
 
        .data
        .data
1:      .dword  0xc1a8000042200000              # -21.0, 40.0
1:      .dword  0xc1a8000042200000              # -21.0, 40.0
        .text
        .text
        la      $2, 1b
        la      $2, 1b
        ldc1    $f8, 0($2)
        ldc1    $f8, 0($2)
        check_ps $f8, -21.0, 40.0
        check_ps $f8, -21.0, 40.0
 
 
 
 
        writemsg "cvt.ps.s"
        writemsg "cvt.ps.s"
 
 
        li.s    $f10, 1.0
        li.s    $f10, 1.0
        li.s    $f12, 3.0
        li.s    $f12, 3.0
        cvt.ps.s $f8, $f10, $f12                # upper, lower
        cvt.ps.s $f8, $f10, $f12                # upper, lower
        check_ps $f8, 1.0, 3.0
        check_ps $f8, 1.0, 3.0
 
 
 
 
        writemsg "cvt.ps.s, sdc1, copy, ldc1"
        writemsg "cvt.ps.s, sdc1, copy, ldc1"
 
 
        .data
        .data
1:      .dword  0
1:      .dword  0
        .dword  0
        .dword  0
        .text
        .text
        la      $2, 1b
        la      $2, 1b
        li.s    $f12, -4.0
        li.s    $f12, -4.0
        li.s    $f14, 32.0
        li.s    $f14, 32.0
        cvt.ps.s $f10, $f12, $f14               # upper, lower
        cvt.ps.s $f10, $f12, $f14               # upper, lower
        sdc1    $f10, 8($2)
        sdc1    $f10, 8($2)
        lw      $3, 8($2)
        lw      $3, 8($2)
        lw      $4, 12($2)
        lw      $4, 12($2)
        sw      $3, 0($2)
        sw      $3, 0($2)
        sw      $4, 4($2)
        sw      $4, 4($2)
        ldc1    $f8, 0($2)
        ldc1    $f8, 0($2)
        check_ps $f8, -4.0, 32.0
        check_ps $f8, -4.0, 32.0
 
 
 
 
        # Load some constants for later use
        # Load some constants for later use
 
 
        li.s    $f10, 4.0
        li.s    $f10, 4.0
        li.s    $f12, 16.0
        li.s    $f12, 16.0
        cvt.ps.s $f20, $f10, $f12               # $f20: u=4.0, l=16.0
        cvt.ps.s $f20, $f10, $f12               # $f20: u=4.0, l=16.0
 
 
        li.s    $f10, -1.0
        li.s    $f10, -1.0
        li.s    $f12, 2.0
        li.s    $f12, 2.0
        cvt.ps.s $f22, $f10, $f12               # $f22: u=-1.0, l=2.0
        cvt.ps.s $f22, $f10, $f12               # $f22: u=-1.0, l=2.0
 
 
        li.s    $f10, 17.0
        li.s    $f10, 17.0
        li.s    $f12, -8.0
        li.s    $f12, -8.0
        cvt.ps.s $f24, $f10, $f12               # $f24: u=17.0, l=-8.0
        cvt.ps.s $f24, $f10, $f12               # $f24: u=17.0, l=-8.0
 
 
 
 
        writemsg "pll.ps"
        writemsg "pll.ps"
 
 
        pll.ps  $f8, $f20, $f22
        pll.ps  $f8, $f20, $f22
        check_ps $f8, 16.0, 2.0
        check_ps $f8, 16.0, 2.0
 
 
 
 
        writemsg "plu.ps"
        writemsg "plu.ps"
 
 
        plu.ps  $f8, $f20, $f22
        plu.ps  $f8, $f20, $f22
        check_ps $f8, 16.0, -1.0
        check_ps $f8, 16.0, -1.0
 
 
 
 
        writemsg "pul.ps"
        writemsg "pul.ps"
 
 
        pul.ps  $f8, $f20, $f22
        pul.ps  $f8, $f20, $f22
        check_ps $f8, 4.0, 2.0
        check_ps $f8, 4.0, 2.0
 
 
 
 
        writemsg "puu.ps"
        writemsg "puu.ps"
 
 
        puu.ps  $f8, $f20, $f22
        puu.ps  $f8, $f20, $f22
        check_ps $f8, 4.0, -1.0
        check_ps $f8, 4.0, -1.0
 
 
 
 
        writemsg "abs.ps"
        writemsg "abs.ps"
 
 
        abs.ps  $f8, $f22
        abs.ps  $f8, $f22
        check_ps $f8, 1.0, 2.0
        check_ps $f8, 1.0, 2.0
 
 
 
 
        writemsg "mov.ps"
        writemsg "mov.ps"
 
 
        mov.ps  $f8, $f22
        mov.ps  $f8, $f22
        check_ps $f8, -1.0, 2.0
        check_ps $f8, -1.0, 2.0
 
 
 
 
        writemsg "neg.ps"
        writemsg "neg.ps"
 
 
        neg.ps  $f8, $f22
        neg.ps  $f8, $f22
        check_ps $f8, 1.0, -2.0
        check_ps $f8, 1.0, -2.0
 
 
 
 
        writemsg "add.ps"
        writemsg "add.ps"
 
 
        add.ps  $f8, $f20, $f22
        add.ps  $f8, $f20, $f22
        check_ps $f8, 3.0, 18.0
        check_ps $f8, 3.0, 18.0
 
 
 
 
        writemsg "mul.ps"
        writemsg "mul.ps"
 
 
        mul.ps  $f8, $f20, $f22
        mul.ps  $f8, $f20, $f22
        check_ps $f8, -4.0, 32.0
        check_ps $f8, -4.0, 32.0
 
 
 
 
        writemsg "sub.ps"
        writemsg "sub.ps"
 
 
        sub.ps  $f8, $f20, $f22
        sub.ps  $f8, $f20, $f22
        check_ps $f8, 5.0, 14.0
        check_ps $f8, 5.0, 14.0
 
 
 
 
        writemsg "madd.ps"
        writemsg "madd.ps"
 
 
        madd.ps $f8, $f24, $f20, $f22
        madd.ps $f8, $f24, $f20, $f22
        check_ps $f8, 13.0, 24.0
        check_ps $f8, 13.0, 24.0
 
 
 
 
        writemsg "msub.ps"
        writemsg "msub.ps"
 
 
        msub.ps $f8, $f24, $f20, $f22
        msub.ps $f8, $f24, $f20, $f22
        check_ps $f8, -21.0, 40.0
        check_ps $f8, -21.0, 40.0
 
 
 
 
        writemsg "nmadd.ps"
        writemsg "nmadd.ps"
 
 
        nmadd.ps $f8, $f24, $f20, $f22
        nmadd.ps $f8, $f24, $f20, $f22
        check_ps $f8, -13.0, -24.0
        check_ps $f8, -13.0, -24.0
 
 
 
 
        writemsg "nmsub.ps"
        writemsg "nmsub.ps"
 
 
        nmsub.ps $f8, $f24, $f20, $f22
        nmsub.ps $f8, $f24, $f20, $f22
        check_ps $f8, 21.0, -40.0
        check_ps $f8, 21.0, -40.0
 
 
 
 
        writemsg "movn.ps (n)"
        writemsg "movn.ps (n)"
 
 
        li      $2, 0
        li      $2, 0
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movn.ps $f8, $f22, $2           # doesn't move
        movn.ps $f8, $f22, $2           # doesn't move
        check_ps $f8, 4.0, 16.0
        check_ps $f8, 4.0, 16.0
 
 
 
 
        writemsg "movn.ps (y)"
        writemsg "movn.ps (y)"
 
 
        li      $2, 1
        li      $2, 1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movn.ps $f8, $f22, $2           # does move
        movn.ps $f8, $f22, $2           # does move
        check_ps $f8, -1.0, 2.0
        check_ps $f8, -1.0, 2.0
 
 
 
 
        writemsg "movz.ps (y)"
        writemsg "movz.ps (y)"
 
 
        li      $2, 0
        li      $2, 0
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movz.ps $f8, $f22, $2           # does move
        movz.ps $f8, $f22, $2           # does move
        check_ps $f8, -1.0, 2.0
        check_ps $f8, -1.0, 2.0
 
 
 
 
        writemsg "movz.ps (n)"
        writemsg "movz.ps (n)"
 
 
        li      $2, 1
        li      $2, 1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movz.ps $f8, $f22, $2           # doesn't move
        movz.ps $f8, $f22, $2           # doesn't move
        check_ps $f8, 4.0, 16.0
        check_ps $f8, 4.0, 16.0
 
 
 
 
        writemsg "movf.ps (y,y)"
        writemsg "movf.ps (y,y)"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (1 << 25)
        or      $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (1 << 23) | (1 << 25)
        ctc1    $2, $31                 # clear fcc0, clear fcc1
        ctc1    $2, $31                 # clear fcc0, clear fcc1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movf.ps $f8, $f22, $fcc0        # moves both halves
        movf.ps $f8, $f22, $fcc0        # moves both halves
        check_ps $f8, -1.0, 2.0
        check_ps $f8, -1.0, 2.0
 
 
 
 
        writemsg "movf.ps (y,n)"
        writemsg "movf.ps (y,n)"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (1 << 25)
        or      $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (0 << 23) | (1 << 25)
        xor     $2, $2, (0 << 23) | (1 << 25)
        ctc1    $2, $31                 # set fcc0, clear fcc1
        ctc1    $2, $31                 # set fcc0, clear fcc1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movf.ps $f8, $f22, $fcc0        # moves upper half only
        movf.ps $f8, $f22, $fcc0        # moves upper half only
        check_ps $f8, -1.0, 16.0
        check_ps $f8, -1.0, 16.0
 
 
 
 
        writemsg "movf.ps (n,y)"
        writemsg "movf.ps (n,y)"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (1 << 25)
        or      $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (1 << 23) | (0 << 25)
        xor     $2, $2, (1 << 23) | (0 << 25)
        ctc1    $2, $31                 # clear fcc0, set fcc1
        ctc1    $2, $31                 # clear fcc0, set fcc1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movf.ps $f8, $f22, $fcc0        # moves lower half only
        movf.ps $f8, $f22, $fcc0        # moves lower half only
        check_ps $f8, 4.0, 2.0
        check_ps $f8, 4.0, 2.0
 
 
 
 
        writemsg "movf.ps (n,n)"
        writemsg "movf.ps (n,n)"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (1 << 25)
        or      $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (0 << 23) | (0 << 25)
        xor     $2, $2, (0 << 23) | (0 << 25)
        ctc1    $2, $31                 # set fcc0, set fcc1
        ctc1    $2, $31                 # set fcc0, set fcc1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movf.ps $f8, $f22, $fcc0        # doesn't move either half
        movf.ps $f8, $f22, $fcc0        # doesn't move either half
        check_ps $f8, 4.0, 16.0
        check_ps $f8, 4.0, 16.0
 
 
 
 
        writemsg "movt.ps (n,n)"
        writemsg "movt.ps (n,n)"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (1 << 25)
        or      $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (1 << 23) | (1 << 25)
        ctc1    $2, $31                 # clear fcc0, clear fcc1
        ctc1    $2, $31                 # clear fcc0, clear fcc1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movt.ps $f8, $f22, $fcc0        # doesn't move either half
        movt.ps $f8, $f22, $fcc0        # doesn't move either half
        check_ps $f8, 4.0, 16.0
        check_ps $f8, 4.0, 16.0
 
 
 
 
        writemsg "movt.ps (n,y)"
        writemsg "movt.ps (n,y)"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (1 << 25)
        or      $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (0 << 23) | (1 << 25)
        xor     $2, $2, (0 << 23) | (1 << 25)
        ctc1    $2, $31                 # set fcc0, clear fcc1
        ctc1    $2, $31                 # set fcc0, clear fcc1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movt.ps $f8, $f22, $fcc0        # moves lower half only
        movt.ps $f8, $f22, $fcc0        # moves lower half only
        check_ps $f8, 4.0, 2.0
        check_ps $f8, 4.0, 2.0
 
 
 
 
        writemsg "movt.ps (y,n)"
        writemsg "movt.ps (y,n)"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (1 << 25)
        or      $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (1 << 23) | (0 << 25)
        xor     $2, $2, (1 << 23) | (0 << 25)
        ctc1    $2, $31                 # clear fcc0, set fcc1
        ctc1    $2, $31                 # clear fcc0, set fcc1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movt.ps $f8, $f22, $fcc0        # moves upper half only
        movt.ps $f8, $f22, $fcc0        # moves upper half only
        check_ps $f8, -1.0, 16.0
        check_ps $f8, -1.0, 16.0
 
 
 
 
        writemsg "movt.ps (y,y)"
        writemsg "movt.ps (y,y)"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (1 << 25)
        or      $2, $2, (1 << 23) | (1 << 25)
        xor     $2, $2, (0 << 23) | (0 << 25)
        xor     $2, $2, (0 << 23) | (0 << 25)
        ctc1    $2, $31                 # set fcc0, set fcc1
        ctc1    $2, $31                 # set fcc0, set fcc1
        mov.ps  $f8, $f20
        mov.ps  $f8, $f20
        movt.ps $f8, $f22, $fcc0        # moves both halves
        movt.ps $f8, $f22, $fcc0        # moves both halves
        check_ps $f8, -1.0, 2.0
        check_ps $f8, -1.0, 2.0
 
 
 
 
        writemsg "alnv.ps (aligned)"
        writemsg "alnv.ps (aligned)"
 
 
        .data
        .data
1:      .dword  0xc1a8000042200000              # -21.0, 40.0
1:      .dword  0xc1a8000042200000              # -21.0, 40.0
        .dword  0xc228000041a00000              # -42.0, 20.0
        .dword  0xc228000041a00000              # -42.0, 20.0
        .text
        .text
        la      $2, 1b
        la      $2, 1b
        li      $3, 0
        li      $3, 0
        addu    $4, $3, 8
        addu    $4, $3, 8
        luxc1   $f10, $3($2)
        luxc1   $f10, $3($2)
        luxc1   $f12, $4($2)
        luxc1   $f12, $4($2)
        alnv.ps $f8, $f10, $f12, $3
        alnv.ps $f8, $f10, $f12, $3
        check_ps $f8, -21.0, 40.0
        check_ps $f8, -21.0, 40.0
 
 
 
 
        writemsg "alnv.ps (unaligned)"
        writemsg "alnv.ps (unaligned)"
 
 
        .data
        .data
1:      .dword  0xc1a8000042200000              # -21.0, 40.0
1:      .dword  0xc1a8000042200000              # -21.0, 40.0
        .dword  0xc228000041a00000              # -42.0, 20.0
        .dword  0xc228000041a00000              # -42.0, 20.0
        .hword  0x0001
        .hword  0x0001
        .text
        .text
        la      $2, 1b
        la      $2, 1b
        li      $3, 4
        li      $3, 4
        addu    $4, $3, 8
        addu    $4, $3, 8
        luxc1   $f10, $3($2)
        luxc1   $f10, $3($2)
        luxc1   $f12, $4($2)
        luxc1   $f12, $4($2)
        alnv.ps $f8, $f10, $f12, $3
        alnv.ps $f8, $f10, $f12, $3
 
 
        lb      $5, 16($2)
        lb      $5, 16($2)
        bnez    $5, 2f                          # little endian
        bnez    $5, 2f                          # little endian
         nop
         nop
 
 
        # big endian
        # big endian
        check_ps $f8, 40.0, -42.0
        check_ps $f8, 40.0, -42.0
        b       3f
        b       3f
         nop
         nop
2:
2:
        # little endian
        # little endian
        check_ps $f8, 20.0, -21.0
        check_ps $f8, 20.0, -21.0
3:
3:
 
 
 
 
        # We test c.cond.ps only lightly, just to make sure it modifies
        # We test c.cond.ps only lightly, just to make sure it modifies
        # two bits and compares the halves separately.  Perhaps it should
        # two bits and compares the halves separately.  Perhaps it should
        # be tested more thoroughly.
        # be tested more thoroughly.
 
 
        writemsg "c.f.ps"
        writemsg "c.f.ps"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (0x7f << 25)
        or      $2, $2, (1 << 23) | (0x7f << 25)
        ctc1    $2, $31                 # set all fcc bits
        ctc1    $2, $31                 # set all fcc bits
        c.f.ps  $fcc0, $f8, $f8         # -> f, f
        c.f.ps  $fcc0, $f8, $f8         # -> f, f
        bc1t    $fcc0, _fail
        bc1t    $fcc0, _fail
         nop
         nop
        bc1t    $fcc1, _fail
        bc1t    $fcc1, _fail
         nop
         nop
 
 
 
 
        writemsg "c.olt.ps"
        writemsg "c.olt.ps"
 
 
        cfc1    $2, $31
        cfc1    $2, $31
        or      $2, $2, (1 << 23) | (0x7f << 25)
        or      $2, $2, (1 << 23) | (0x7f << 25)
        xor     $2, $2, (1 << 23) | (0x7f << 25)
        xor     $2, $2, (1 << 23) | (0x7f << 25)
        ctc1    $2, $31                 # clear all fcc bits
        ctc1    $2, $31                 # clear all fcc bits
        c.lt.ps $fcc0, $f22, $f24       # -> f, t
        c.lt.ps $fcc0, $f22, $f24       # -> f, t
        bc1t    $fcc0, _fail
        bc1t    $fcc0, _fail
         nop
         nop
        bc1f    $fcc1, _fail
        bc1f    $fcc1, _fail
         nop
         nop
 
 
 
 
        pass
        pass
 
 
        .end DIAG
        .end DIAG
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.