1 1.1 christos # Blackfin testcase for branching out of the middle of a hardware loop 2 1.1 christos # mach: bfin 3 1.1 christos 4 1.1 christos .include "testutils.inc" 5 1.1 christos 6 1.1 christos .macro test_prep lc:req, sym:req 7 1.1 christos imm32 P0, \lc 8 1.1 christos loadsym P1, \sym 9 1.1 christos R5 = 0; 10 1.1 christos R6 = 0; 11 1.1 christos R7 = 0; 12 1.1 christos LSETUP (1f, 2f) LC0 = P0; 13 1.1 christos .endm 14 1.1 christos 15 1.1 christos .macro test_check exp5:req, exp6:req, exp7:req, expLC 16 1.1 christos imm32 R4, \exp5; 17 1.1 christos CC = R4 == R5; 18 1.1 christos IF !CC JUMP 2f; 19 1.1 christos imm32 R4, \exp6; 20 1.1 christos CC = R4 == R6; 21 1.1 christos IF !CC JUMP 2f; 22 1.1 christos imm32 R4, \exp7; 23 1.1 christos CC = R4 == R7; 24 1.1 christos IF !CC JUMP 2f; 25 1.1 christos R3 = LC0; 26 1.1 christos imm32 R4, \expLC; 27 1.1 christos CC = R4 == R3; 28 1.1 christos IF !CC JUMP 2f; 29 1.1 christos JUMP 3f; 30 1.1 christos 2: fail 31 1.1 christos 3: 32 1.1 christos .endm 33 1.1 christos 34 1.1 christos start 35 1.1 christos mnop; 36 1.1 christos 37 1.1 christos test_jump_s: 38 1.1 christos .macro test_jump_s lc:req 39 1.1 christos test_prep \lc, 3f 40 1.1 christos 1: JUMP (P1); 41 1.1 christos R5 += 1; 42 1.1 christos 2: R6 += 1; 43 1.1 christos fail 44 1.1 christos 3: R7 += 1; 45 1.1 christos test_check 0, 0, 1, \lc 46 1.1 christos .endm 47 1.1 christos test_jump_s 0 48 1.1 christos test_jump_s 1 49 1.1 christos test_jump_s 2 50 1.1 christos test_jump_s 10 51 1.1 christos 52 1.1 christos test_jump_m: 53 1.1 christos .macro test_jump_m lc:req 54 1.1 christos test_prep \lc, 3f 55 1.1 christos 1: R5 += 1; 56 1.1 christos JUMP (P1); 57 1.1 christos 2: R6 += 1; 58 1.1 christos fail 59 1.1 christos 3: R7 += 1; 60 1.1 christos test_check 1, 0, 1, \lc 61 1.1 christos .endm 62 1.1 christos test_jump_m 0 63 1.1 christos test_jump_m 1 64 1.1 christos test_jump_m 2 65 1.1 christos test_jump_m 10 66 1.1 christos 67 1.1 christos test_jump_e: 68 1.1 christos .macro test_jump_e lc:req, lcend:req 69 1.1 christos test_prep \lc, 3f 70 1.1 christos 1: R5 += 1; 71 1.1 christos R6 += 1; 72 1.1 christos 2: JUMP (P1); 73 1.1 christos fail 74 1.1 christos 3: R7 += 1; 75 1.1 christos test_check 1, 1, 1, \lcend 76 1.1 christos .endm 77 1.1 christos test_jump_e 0, 0 78 1.1 christos test_jump_e 1, 0 79 1.1 christos test_jump_e 2, 1 80 1.1 christos test_jump_e 10, 9 81 1.1 christos 82 1.1 christos test_call_s: 83 1.1 christos .macro test_call_s lc:req, exp5:req, exp6:req, exp7:req 84 1.1 christos test_prep \lc, __ret 85 1.1 christos 1: CALL (P1); 86 1.1 christos R5 += 1; 87 1.1 christos 2: R6 += 1; 88 1.1 christos 3: R7 += 1; 89 1.1 christos test_check \exp5, \exp6, \exp7, 0 90 1.1 christos .endm 91 1.1 christos test_call_s 0, 1, 1, 2 92 1.1 christos test_call_s 1, 1, 1, 2 93 1.1 christos test_call_s 2, 2, 2, 3 94 1.1 christos test_call_s 10, 10, 10, 11 95 1.1 christos 96 1.1 christos test_call_m: 97 1.1 christos .macro test_call_m lc:req, exp5:req, exp6:req, exp7:req 98 1.1 christos test_prep \lc, __ret 99 1.1 christos 1: R5 += 1; 100 1.1 christos CALL (P1); 101 1.1 christos 2: R6 += 1; 102 1.1 christos 3: R7 += 1; 103 1.1 christos test_check \exp5, \exp6, \exp7, 0 104 1.1 christos .endm 105 1.1 christos test_call_m 0, 1, 1, 2 106 1.1 christos test_call_m 1, 1, 1, 2 107 1.1 christos test_call_m 2, 2, 2, 3 108 1.1 christos test_call_m 10, 10, 10, 11 109 1.1 christos 110 1.1 christos test_call_e: 111 1.1 christos .macro test_call_e lc:req, exp5:req, exp6:req, exp7:req 112 1.1 christos test_prep \lc, __ret 113 1.1 christos 1: R5 += 1; 114 1.1 christos R6 += 1; 115 1.1 christos 2: CALL (P1); 116 1.1 christos 3: R7 += 1; 117 1.1 christos test_check \exp5, \exp6, \exp7, 0 118 1.1 christos .endm 119 1.1 christos test_call_e 0, 1, 1, 2 120 1.1 christos test_call_e 1, 1, 1, 2 121 1.1 christos test_call_e 2, 2, 2, 3 122 1.1 christos test_call_e 10, 10, 10, 11 123 1.1 christos 124 1.1 christos pass 125 1.1 christos 126 1.1 christos __ret: 127 1.1 christos nop;nop;nop; 128 1.1 christos R7 += 1; 129 1.1 christos rts; 130