Upload Tizen:Base source
[external/binutils.git] / gas / testsuite / gas / bfin / flow2.s
1
2 .EXTERN MY_LABEL2;
3 .section .text;
4
5 //
6 //2 Program Flow Control
7 //
8
9
10 //JUMP ( Preg ) ; /* indirect to an absolute (not PC-relative)address (a) */
11 //Preg: P5-0, SP, FP
12
13 JUMP (P0);
14 JUMP (P1);
15 JUMP (P2);
16 JUMP (P3);
17 JUMP (P4);
18 JUMP (P5);
19 JUMP (SP);
20 JUMP (FP);
21
22 //JUMP ( PC + Preg ) ; /* PC-relative, indexed (a) */
23 JUMP (PC+P0);
24 JUMP (PC+P1);
25 JUMP (PC+P2);
26 JUMP (PC+P3);
27 JUMP (PC+P4);
28 JUMP (PC+P5);
29 JUMP (PC+SP);
30 JUMP (PC+FP);
31
32
33 //JUMP pcrelm2 ; /* PC-relative, immediate (a) or (b) */
34
35 JUMP 0X0;
36 JUMP 1234;
37 JUMP -1234;
38 JUMP 2;
39 JUMP -2;
40
41 MY_LABEL1:
42 //JUMP.S pcrel13m2 ; /* PC-relative, immediate, short (a) */
43 JUMP.S 0X0;
44 JUMP.S 1234;
45 JUMP.S -1234;
46 JUMP.S 2;
47 JUMP.S -2;
48
49 //JUMP.L pcrel25m2 ; /* PC-relative, immediate, long (b) */
50 JUMP.L 0XFF800000;
51 JUMP.L 0X007FFFFE;
52 JUMP.L 0X0;
53 JUMP.L 1234;
54 JUMP.L -1234;
55 JUMP.L 2;
56 JUMP.L -2;
57
58 //JUMP user_label ; /* user-defined absolute address label, */
59 JUMP MY_LABEL1;
60 JUMP MY_LABEL2;
61
62 JUMP MY_LABEL1-2;
63 JUMP MY_LABEL2-2;
64
65 //IF CC JUMP pcrel11m2 ; /* branch if CC=1, branch predicted as not taken (a) */
66 IF CC JUMP 0xFFFFFE08;
67 IF CC JUMP 0x0B4;
68 IF CC JUMP 0;
69
70 //IF CC JUMP pcrel11m2 (bp) ; /* branch if CC=1, branch predicted as taken (a) */
71 IF CC JUMP 0xFFFFFE08(bp);
72 IF CC JUMP 0x0B4(bp);
73
74 //IF !CC JUMP pcrel11m2 ; /* branch if CC=0, branch predicted as not taken (a) */
75 IF !CC JUMP 0xFFFFFF22;
76 IF !CC JUMP 0X120;
77
78 //IF !CC JUMP pcrel11m2 (bp) ; /* branch if CC=0, branch predicted as taken (a) */
79 IF !CC JUMP 0xFFFFFF22(bp);
80 IF !CC JUMP 0X120(bp);
81
82 //IF CC JUMP user_label ; /* user-defined absolute address label, resolved by the assembler/linker to the appropriate PC-relative instruction (a) */
83 IF CC JUMP MY_LABEL1;
84 IF CC JUMP MY_LABEL2;
85
86 //IF CC JUMP user_label (bp) ; /* user-defined absolute address label, resolved by the assembler/linker to the appropriate PC-relative instruction (a) */
87 IF CC JUMP MY_LABEL1(bp);
88 IF CC JUMP MY_LABEL2(bp);
89
90 //IF !CC JUMP user_label ; /* user-defined absolute address label, resolved by the assembler/linker to the appropriate PC-relative instruction (a) */
91 IF !CC JUMP MY_LABEL1;
92 IF !CC JUMP MY_LABEL2;
93
94 //IF !CC JUMP user_label (bp) ; /* user-defined absolute address label, resolved by the assembler/linker to the appropriate PC-relative instruction (a) */
95 IF !CC JUMP MY_LABEL1(bp);
96 IF !CC JUMP MY_LABEL2(bp);
97
98 //CALL ( Preg ) ; /* indirect to an absolute (not PC-relative) address (a) */
99 CALL(P0);
100 CALL(P1);
101 CALL(P2);
102 CALL(P3);
103 CALL(P4);
104 CALL(P5);
105
106
107 //CALL ( PC + Preg ) ; /* PC-relative, indexed (a) */
108 CALL(PC+P0);
109 CALL(PC+P1);
110 CALL(PC+P2);
111 CALL(PC+P3);
112 CALL(PC+P4);
113 CALL(PC+P5);
114
115 //CALL pcrel25m2 ; /* PC-relative, immediate (b) */
116 CALL 0x123456 ;
117 CALL -1234;
118
119 //CALL user_label ; /* user-defined absolute address label,resolved by the assembler/linker to the appropriate PC-relative instruction (a) or (b) */
120 CALL MY_LABEL1;
121 CALL MY_LABEL2;
122
123 RTS ; // Return from Subroutine (a)
124 RTI ; // Return from Interrupt (a)
125 RTX ; // Return from Exception (a)
126 RTN ; // Return from NMI (a)
127 RTE ; // Return from Emulation (a)
128
129 lsetup ( 4, 4 ) lc0 ;
130
131 lsetup ( beg_poll_bit, end_poll_bit ) lc0 ;
132 NOP;NOP;
133 beg_poll_bit: R0=1(Z);
134 end_poll_bit: R1=2(Z);
135
136 lsetup ( 4, 6 ) lc1 ;
137
138 lsetup ( FIR_filter, bottom_of_FIR_filter ) lc1 ;
139 NOP;
140 FIR_filter: R0=1(Z);
141 bottom_of_FIR_filter: R1=2(Z);
142
143 lsetup ( 4, 8 ) lc0 = p1 ;
144
145 lsetup ( 4, 8 ) lc0 = p1>>1 ;
146
147 loop DoItSome LC0 ; /* define loop DoItSome with Loop Counter 0 */
148 loop_begin DoItSome ; /* place before the first instruction in the loop */
149 R0=1;
150 R1=2;
151 loop_end DoItSome ; /* place after the last instruction in the loop */
152
153 loop DoItSomeMore LC1 ; /* define loop MyLoop with Loop Counter 1*/
154
155