1 1.1 christos # frv testcase for mmachu $GRi,$GRj,$GRk 2 1.1 christos # mach: frv fr500 fr400 3 1.1 christos 4 1.1 christos .include "testutils.inc" 5 1.1 christos 6 1.1 christos start 7 1.1 christos 8 1.1 christos .global mmachu 9 1.1 christos mmachu: 10 1.1 christos set_fr_iimmed 3,2,fr7 ; multiply small numbers 11 1.1 christos set_fr_iimmed 2,3,fr8 12 1.1 christos mmachu fr7,fr8,acc0 13 1.1 christos test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear 14 1.1 christos test_spr_bits 2,1,0,msr0 ; msr0.ovf not set 15 1.1 christos test_spr_bits 1,0,0,msr0 ; msr0.aovf not set 16 1.1 christos test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set 17 1.1 christos test_accg_immed 0,accg0 18 1.1 christos test_acc_immed 6,acc0 19 1.1 christos test_accg_immed 0,accg1 20 1.1 christos test_acc_immed 6,acc1 21 1.1 christos 22 1.1 christos set_fr_iimmed 1,2,fr7 ; multiply by 1 23 1.1 christos set_fr_iimmed 2,1,fr8 24 1.1 christos mmachu fr7,fr8,acc0 25 1.1 christos test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear 26 1.1 christos test_spr_bits 2,1,0,msr0 ; msr0.ovf not set 27 1.1 christos test_spr_bits 1,0,0,msr0 ; msr0.aovf not set 28 1.1 christos test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set 29 1.1 christos test_accg_immed 0,accg0 30 1.1 christos test_acc_immed 8,acc0 31 1.1 christos test_accg_immed 0,accg1 32 1.1 christos test_acc_immed 8,acc1 33 1.1 christos 34 1.1 christos set_fr_iimmed 0,2,fr7 ; multiply by 0 35 1.1 christos set_fr_iimmed 2,0,fr8 36 1.1 christos mmachu fr7,fr8,acc0 37 1.1 christos test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear 38 1.1 christos test_spr_bits 2,1,0,msr0 ; msr0.ovf not set 39 1.1 christos test_spr_bits 1,0,0,msr0 ; msr0.aovf not set 40 1.1 christos test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set 41 1.1 christos test_accg_immed 0,accg0 42 1.1 christos test_acc_immed 8,acc0 43 1.1 christos test_accg_immed 0,accg1 44 1.1 christos test_acc_immed 8,acc1 45 1.1 christos 46 1.1 christos set_fr_iimmed 0x3fff,2,fr7 ; 15 bit result 47 1.1 christos set_fr_iimmed 2,0x3fff,fr8 48 1.1 christos mmachu fr7,fr8,acc0 49 1.1 christos test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear 50 1.1 christos test_spr_bits 2,1,0,msr0 ; msr0.ovf not set 51 1.1 christos test_spr_bits 1,0,0,msr0 ; msr0.aovf not set 52 1.1 christos test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set 53 1.1 christos test_accg_immed 0,accg0 54 1.1 christos test_acc_limmed 0x0000,0x8006,acc0 55 1.1 christos test_accg_immed 0,accg1 56 1.1 christos test_acc_limmed 0x0000,0x8006,acc1 57 1.1 christos 58 1.1 christos set_fr_iimmed 0x4000,2,fr7 ; 16 bit result 59 1.1 christos set_fr_iimmed 2,0x4000,fr8 60 1.1 christos mmachu fr7,fr8,acc0 61 1.1 christos test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear 62 1.1 christos test_spr_bits 2,1,0,msr0 ; msr0.ovf not set 63 1.1 christos test_spr_bits 1,0,0,msr0 ; msr0.aovf not set 64 1.1 christos test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set 65 1.1 christos test_accg_immed 0,accg0 66 1.1 christos test_acc_limmed 0x0001,0x0006,acc0 67 1.1 christos test_accg_immed 0,accg1 68 1.1 christos test_acc_limmed 0x0001,0x0006,acc1 69 1.1 christos 70 1.1 christos set_fr_iimmed 0x8000,2,fr7 ; 17 bit result 71 1.1 christos set_fr_iimmed 2,0x8000,fr8 72 1.1 christos mmachu fr7,fr8,acc0 73 1.1 christos test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear 74 1.1 christos test_spr_bits 2,1,0,msr0 ; msr0.ovf not set 75 1.1 christos test_spr_bits 1,0,0,msr0 ; msr0.aovf not set 76 1.1 christos test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set 77 1.1 christos test_accg_immed 0,accg0 78 1.1 christos test_acc_immed 0x00020006,acc0 79 1.1 christos test_accg_immed 0,accg1 80 1.1 christos test_acc_immed 0x00020006,acc1 81 1.1 christos 82 1.1 christos set_fr_iimmed 0x7fff,0x7fff,fr7 ; max positive result 83 1.1 christos set_fr_iimmed 0x7fff,0x7fff,fr8 84 1.1 christos mmachu fr7,fr8,acc0 85 1.1 christos test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear 86 1.1 christos test_spr_bits 2,1,0,msr0 ; msr0.ovf not set 87 1.1 christos test_spr_bits 1,0,0,msr0 ; msr0.aovf not set 88 1.1 christos test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set 89 1.1 christos test_accg_immed 0,accg0 90 1.1 christos test_acc_immed 0x40010007,acc0 91 1.1 christos test_accg_immed 0,accg1 92 1.1 christos test_acc_immed 0x40010007,acc1 93 1.1 christos 94 1.1 christos set_fr_iimmed 0x8000,0x8000,fr7 ; max positive result 95 1.1 christos set_fr_iimmed 0x8000,0x8000,fr8 96 1.1 christos mmachu fr7,fr8,acc0 97 1.1 christos test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear 98 1.1 christos test_spr_bits 2,1,0,msr0 ; msr0.ovf not set 99 1.1 christos test_spr_bits 1,0,0,msr0 ; msr0.aovf not set 100 1.1 christos test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set 101 1.1 christos test_accg_immed 0,accg0 102 1.1 christos test_acc_limmed 0x8001,0x0007,acc0 103 1.1 christos test_accg_immed 0,accg1 104 1.1 christos test_acc_limmed 0x8001,0x0007,acc1 105 1.1 christos 106 1.1 christos set_fr_iimmed 0xffff,0xffff,fr7 ; max positive result 107 1.1 christos set_fr_iimmed 0xffff,0xffff,fr8 108 1.1 christos mmachu fr7,fr8,acc0 109 1.1 christos test_spr_bits 0x3c,2,0,msr0 ; msr0.sie is clear 110 1.1 christos test_spr_bits 2,1,0,msr0 ; msr0.ovf not set 111 1.1 christos test_spr_bits 1,0,0,msr0 ; msr0.aovf not set 112 1.1 christos test_spr_bits 0x7000,12,0,msr0 ; msr0.mtt not set 113 1.1 christos test_accg_immed 1,accg0 114 1.1 christos test_acc_limmed 0x7fff,0x0008,acc0 115 1.1 christos test_accg_immed 1,accg1 116 1.1 christos test_acc_limmed 0x7fff,0x0008,acc1 117 1.1 christos 118 1.1 christos set_accg_immed 0xff,accg0 ; saturation 119 1.1 christos set_acc_immed 0xffffffff,acc0 120 1.1 christos set_accg_immed 0xff,accg1 121 1.1 christos set_acc_immed 0xffffffff,acc1 122 1.1 christos set_fr_iimmed 1,1,fr7 123 1.1 christos set_fr_iimmed 1,1,fr8 124 1.1 christos mmachu fr7,fr8,acc0 125 1.1 christos test_spr_bits 0x3c,2,0xc,msr0 ; msr0.sie is set 126 1.1 christos test_spr_bits 2,1,1,msr0 ; msr0.ovf is set 127 1.1 christos test_spr_bits 1,0,1,msr0 ; msr0.aovf is set 128 1.1 christos test_spr_bits 0x7000,12,1,msr0 ; msr0.mtt is set 129 1.1 christos test_accg_immed 0xff,accg0 130 1.1 christos test_acc_limmed 0xffff,0xffff,acc0 131 1.1 christos test_accg_immed 0xff,accg1 132 1.1 christos test_acc_limmed 0xffff,0xffff,acc1 133 1.1 christos 134 1.1 christos set_fr_iimmed 0xffff,0x0000,fr7 135 1.1 christos set_fr_iimmed 0xffff,0xffff,fr8 136 1.1 christos mmachu fr7,fr8,acc0 137 1.1 christos test_spr_bits 0x3c,2,0x8,msr0 ; msr0.sie is set 138 1.1 christos test_spr_bits 2,1,1,msr0 ; msr0.ovf is set 139 1.1 christos test_spr_bits 1,0,1,msr0 ; msr0.aovf is set 140 1.1 christos test_spr_bits 0x7000,12,1,msr0 ; msr0.mtt is set 141 1.1 christos test_accg_immed 0xff,accg0 142 1.1 christos test_acc_limmed 0xffff,0xffff,acc0 143 1.1 christos test_accg_immed 0xff,accg1 144 1.1 christos test_acc_limmed 0xffff,0xffff,acc1 145 1.1 christos 146 1.1 christos pass 147