.text
|
.text
|
.global start
|
.global start
|
|
|
! Starting point
|
! Starting point
|
start:
|
start:
|
|
|
! test all ASRs
|
! test all ASRs
|
|
|
rd %asr0, %l0
|
rd %asr0, %l0
|
rd %asr1, %l0
|
rd %asr1, %l0
|
rd %asr15, %l0
|
rd %asr15, %l0
|
rd %asr17, %l0
|
rd %asr17, %l0
|
rd %asr18, %l0
|
rd %asr18, %l0
|
rd %asr19, %l0 ! should stop the processor
|
rd %asr19, %l0 ! should stop the processor
|
rd %asr20, %l0
|
rd %asr20, %l0
|
rd %asr21, %l0
|
rd %asr21, %l0
|
rd %asr22, %l0
|
rd %asr22, %l0
|
|
|
wr %l0, 0, %asr0
|
wr %l0, 0, %asr0
|
wr %l0, 0, %asr1
|
wr %l0, 0, %asr1
|
wr %l0, 0, %asr15
|
wr %l0, 0, %asr15
|
wr %l0, 0, %asr17
|
wr %l0, 0, %asr17
|
wr %l0, 0, %asr18
|
wr %l0, 0, %asr18
|
wr %l0, 0, %asr19
|
wr %l0, 0, %asr19
|
wr %l0, 0, %asr20
|
wr %l0, 0, %asr20
|
wr %l0, 0, %asr21
|
wr %l0, 0, %asr21
|
wr %l0, 0, %asr22
|
wr %l0, 0, %asr22
|
|
|
! test UMUL with no overflow inside Y
|
! test UMUL with no overflow inside Y
|
test_umul:
|
test_umul:
|
umul %g1, %g2, %g3
|
umul %g1, %g2, %g3
|
|
|
! test UMUL with an overflow inside Y
|
! test UMUL with an overflow inside Y
|
|
|
umul %g1, %g2, %g3 ! %g3 must be equal to 0
|
umul %g1, %g2, %g3 ! %g3 must be equal to 0
|
|
|
! test SMUL with negative result
|
! test SMUL with negative result
|
test_smul:
|
test_smul:
|
smul %g1, %g2, %g3
|
smul %g1, %g2, %g3
|
|
|
! test SMUL with positive result
|
! test SMUL with positive result
|
|
|
smul %g1, %g2, %g3
|
smul %g1, %g2, %g3
|
|
|
! test STBAR: there are two possible syntaxes
|
! test STBAR: there are two possible syntaxes
|
test_stbar:
|
test_stbar:
|
stbar ! is a valid V8 syntax, at least a synthetic
|
stbar ! is a valid V8 syntax, at least a synthetic
|
! instruction
|
! instruction
|
rd %asr15, %g0 ! other solution
|
rd %asr15, %g0 ! other solution
|
|
|
! test UNIMP
|
! test UNIMP
|
unimp 1
|
unimp 1
|
|
|
! test FLUSH
|
! test FLUSH
|
flush %l1 ! is the official V8 syntax
|
flush %l1 ! is the official V8 syntax
|
|
|
! test SCAN: find first 0
|
! test SCAN: find first 0
|
test_scan:
|
test_scan:
|
scan %l1, 0xffffffff, %l3
|
scan %l1, 0xffffffff, %l3
|
|
|
! test scan: find first 1
|
! test scan: find first 1
|
|
|
scan %l1, 0, %l3
|
scan %l1, 0, %l3
|
|
|
! test scan: find first bit != bit-0
|
! test scan: find first bit != bit-0
|
|
|
scan %l1, %l1, %l3
|
scan %l1, %l1, %l3
|
|
|
! test SHUFFLE
|
! test SHUFFLE
|
test_shuffle:
|
test_shuffle:
|
shuffle %l0, 0x1, %l1
|
shuffle %l0, 0x1, %l1
|
shuffle %l0, 0x2, %l1
|
shuffle %l0, 0x2, %l1
|
shuffle %l0, 0x4, %l1
|
shuffle %l0, 0x4, %l1
|
shuffle %l0, 0x8, %l1
|
shuffle %l0, 0x8, %l1
|
shuffle %l0, 0x10, %l1
|
shuffle %l0, 0x10, %l1
|
shuffle %l0, 0x18, %l1
|
shuffle %l0, 0x18, %l1
|
|
|
! test UMAC
|
! test UMAC
|
test_umac:
|
test_umac:
|
umac %l1, %l2, %l0
|
umac %l1, %l2, %l0
|
umac %l1, 2, %l0
|
umac %l1, 2, %l0
|
umac 2, %l1, %l0
|
umac 2, %l1, %l0
|
|
|
! test UMACD
|
! test UMACD
|
test_umacd:
|
test_umacd:
|
umacd %l2, %l4, %l0
|
umacd %l2, %l4, %l0
|
umacd %l2, 3, %l0
|
umacd %l2, 3, %l0
|
umacd 3, %l2, %l0
|
umacd 3, %l2, %l0
|
|
|
! test SMAC
|
! test SMAC
|
test_smac:
|
test_smac:
|
smac %l1, %l2, %l0
|
smac %l1, %l2, %l0
|
smac %l1, -42, %l0
|
smac %l1, -42, %l0
|
smac -42, %l1, %l0
|
smac -42, %l1, %l0
|
|
|
! test SMACD
|
! test SMACD
|
test_smacd:
|
test_smacd:
|
smacd %l2, %l4, %l0
|
smacd %l2, %l4, %l0
|
smacd %l2, 123, %l0
|
smacd %l2, 123, %l0
|
smacd 123, %l2, %l0
|
smacd 123, %l2, %l0
|
|
|
! test UMULD
|
! test UMULD
|
test_umuld:
|
test_umuld:
|
umuld %o2, %o4, %o0
|
umuld %o2, %o4, %o0
|
umuld %o2, 0x234, %o0
|
umuld %o2, 0x234, %o0
|
umuld 0x567, %o2, %o0
|
umuld 0x567, %o2, %o0
|
|
|
! test SMULD
|
! test SMULD
|
test_smuld:
|
test_smuld:
|
smuld %i2, %i4, %i0
|
smuld %i2, %i4, %i0
|
smuld %i2, -4096, %i0
|
smuld %i2, -4096, %i0
|
smuld 4095, %i4, %i0
|
smuld 4095, %i4, %i0
|
|
|
! Coprocessor instructions
|
! Coprocessor instructions
|
test_coprocessor:
|
test_coprocessor:
|
! %ccsr is register # 0
|
! %ccsr is register # 0
|
! %ccfr is register # 1
|
! %ccfr is register # 1
|
! %ccpr is register # 3
|
! %ccpr is register # 3
|
! %cccrcr is register # 2
|
! %cccrcr is register # 2
|
|
|
! test CPUSH: just syntax
|
! test CPUSH: just syntax
|
|
|
cpush %l0, %l1
|
cpush %l0, %l1
|
cpush %l0, 1
|
cpush %l0, 1
|
cpusha %l0, %l1
|
cpusha %l0, %l1
|
cpusha %l0, 1
|
cpusha %l0, 1
|
|
|
! test CPULL: just syntax
|
! test CPULL: just syntax
|
|
|
cpull %l0
|
cpull %l0
|
|
|
! test CPRDCXT: just syntax
|
! test CPRDCXT: just syntax
|
|
|
crdcxt %ccsr, %l0
|
crdcxt %ccsr, %l0
|
crdcxt %ccfr, %l0
|
crdcxt %ccfr, %l0
|
crdcxt %ccpr, %l0
|
crdcxt %ccpr, %l0
|
crdcxt %cccrcr, %l0
|
crdcxt %cccrcr, %l0
|
|
|
! test CPWRCXT: just syntax
|
! test CPWRCXT: just syntax
|
|
|
cwrcxt %l0, %ccsr
|
cwrcxt %l0, %ccsr
|
cwrcxt %l0, %ccfr
|
cwrcxt %l0, %ccfr
|
cwrcxt %l0, %ccpr
|
cwrcxt %l0, %ccpr
|
cwrcxt %l0, %cccrcr
|
cwrcxt %l0, %cccrcr
|
|
|
! test CBccc: just syntax
|
! test CBccc: just syntax
|
|
|
cbn stop
|
cbn stop
|
nop
|
nop
|
cbn,a stop
|
cbn,a stop
|
nop
|
nop
|
cbe stop
|
cbe stop
|
nop
|
nop
|
cbe,a stop
|
cbe,a stop
|
nop
|
nop
|
cbf stop
|
cbf stop
|
nop
|
nop
|
cbf,a stop
|
cbf,a stop
|
nop
|
nop
|
cbef stop
|
cbef stop
|
nop
|
nop
|
cbef,a stop
|
cbef,a stop
|
nop
|
nop
|
cbr stop
|
cbr stop
|
nop
|
nop
|
cbr,a stop
|
cbr,a stop
|
nop
|
nop
|
cber stop
|
cber stop
|
nop
|
nop
|
cber,a stop
|
cber,a stop
|
nop
|
nop
|
cbfr stop
|
cbfr stop
|
nop
|
nop
|
cbfr,a stop
|
cbfr,a stop
|
nop
|
nop
|
cbefr stop
|
cbefr stop
|
nop
|
nop
|
cbefr,a stop
|
cbefr,a stop
|
nop
|
nop
|
cba stop
|
cba stop
|
nop
|
nop
|
cba,a stop
|
cba,a stop
|
nop
|
nop
|
cbne stop
|
cbne stop
|
nop
|
nop
|
cbne,a stop
|
cbne,a stop
|
nop
|
nop
|
cbnf stop
|
cbnf stop
|
nop
|
nop
|
cbnf,a stop
|
cbnf,a stop
|
nop
|
nop
|
cbnef stop
|
cbnef stop
|
nop
|
nop
|
cbnef,a stop
|
cbnef,a stop
|
nop
|
nop
|
cbnr stop
|
cbnr stop
|
nop
|
nop
|
cbnr,a stop
|
cbnr,a stop
|
nop
|
nop
|
cbner stop
|
cbner stop
|
nop
|
nop
|
cbner,a stop
|
cbner,a stop
|
nop
|
nop
|
cbnfr stop
|
cbnfr stop
|
nop
|
nop
|
cbnfr,a stop
|
cbnfr,a stop
|
nop
|
nop
|
cbnefr stop
|
cbnefr stop
|
nop
|
nop
|
cbnefr,a stop
|
cbnefr,a stop
|
nop
|
nop
|
|
|