;
; group a, test 1
;
; br.ltu
; br.geu
; br.gtu
; br.leu
;

m4_include(..\tmacros.h)

INIT_TEST(p,0x01)

; declare symbols here
SYM(failhop0)
SYM(failhop1)
SYM(failhop2)
SYM(failhop3)
SYM(failhop4)
SYM(failhop5)
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)
SYM(next14)

SUBTEST(1)
; br.ltu	<taken>
    ld.8    a,2
    cmp.8   a,5
    br.ltu   next5
    FAIL
next5:

SUBTEST(2)
; br.ltu <not taken>
    ld.8    a,5
    cmp.8   a,5
    br.ltu   failhop2
    br	next6
failhop2:
    FAIL
next6:

SUBTEST(3)
; br.geu	<taken>
    ld.8    a,12
    cmp.8   a,12
    br.geu   next7
    FAIL
next7:

SUBTEST(4)
; br.geu <taken, gtu>
    ld.8    a,0xff
    cmp.8   a,0xfe
    br.geu   next8
    FAIL
next8:

SUBTEST(5)
; br.geu <not taken>
    ld.8    a,4
    cmp.8   a,5
    br.geu   failhop3
    br	next9
failhop3:
    FAIL
next9:

SUBTEST(6)
; br.gtu	<taken>
    ld.8    a,0x80
    cmp.8   a,0x7f
    br.gtu   next10
    FAIL
next10:

SUBTEST(7)
; br.gtu <not taken>
    ld.8    a,2
    cmp.8   a,2
    br.gtu   failhop4
    br	next11
failhop4:
    FAIL
next11:

SUBTEST(8)
; br.leu	<taken>
    ld.8    a,12
    cmp.8   a,12
    br.leu   next12
    FAIL
next12:

SUBTEST(9)
; br.leu <taken, leu>
    ld.8    a,0x7f
    cmp.8   a,0xff
    br.leu   next13
    FAIL
next13:

SUBTEST(10)
; br.leu <not taken>
    ld.8    a,5
    cmp.8   a,4
    br.leu   failhop5
    br	next14
failhop5:
    FAIL
next14:


;   Finally, when done branch to pass
    END_TEST
