;
; group l, test 1
;
; vvshl.16, vshr.16, sex
;

m4_include(..\tmacros.h)

INIT_TEST(l,0x01)

; declare symbols here
SYM(next0)
SYM(next1)
SYM(next2)
SYM(next3)
SYM(next4)
SYM(next5)
SYM(next6)
SYM(next7)
SYM(next8)
SYM(next9)
SYM(next10)
SYM(next11)
SYM(next12)
SYM(next13)

; Begin test here

SUBTEST(1)

;   vshl.16   a
    ld.16   a,0x5555
    ld.16	c,1
    vshl.16   a
    cmpb.eq.16	a,0xaaaa,next0
    FAIL
next0:
    ld.16	c,1
    vshr.16   a
    cmpb.eq.16	a,0x5555,next1
    FAIL
next1:

SUBTEST(2)
;   vshl.16   b
    ld.16   b,0x5555
    ld.16	c,1
    vshl.16   b
    copy    a,b
    cmpb.eq.16	a,0xaaaa,next2
    FAIL
next2:
    ld.16	c,1
    vshr.16   b
    copy    a,b
    cmpb.eq.16	a,0x5555,next3
    FAIL
next3:

SUBTEST(3)
;   sex	a
    ld.16   a,0x55ff
    sex	a
    cmpb.eq.16	a,0xffff,next4
    FAIL
next4:
    ld.16   a,0x557f
    sex	a
    cmpb.eq.16	a,0x007f,next5
    FAIL
next5:

SUBTEST(4)
;   sex	b
    ld.16   b,0x55ff
    sex	b
    copy    a,b
    cmpb.eq.16	a,0xffff,next6
    FAIL
next6:
    ld.16   b,0x557f
    sex	b
    copy    a,b
    cmpb.eq.16	a,0x007f,next7
    FAIL
next7:

SUBTEST(5)
;   vshl, 0 count
    ld.16   a,0x1234
    ld.16   c,0
    vshl.16	a
    cmpb.eq.16	a,0x1234,next8
    FAIL
next8:

SUBTEST(6)
;   vshl, zero source
    ld.16   a,0
    ld.16   c,0x1234
    vshl.16	a
    cmpb.eq.16	a,0,next9
    FAIL
next9:
    copy    a,c
    cmpb.eq.16	a,0x1234,next10
    FAIL
next10:

SUBTEST(7)
;   vshr, 0 count
    ld.16   a,0x1234
    ld.16   c,0
    vshr.16	a
    cmpb.eq.16	a,0x1234,next11
    FAIL
next11:

SUBTEST(8)
;   vshr, zero source
    ld.16   a,0
    ld.16   c,0x1234
    vshr.16	a
    cmpb.eq.16	a,0,next12
    FAIL
next12:
    copy    a,c
    cmpb.eq.16	a,0x1234,next13
    FAIL
next13:


;   Finally, when done branch to pass
    END_TEST
