Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: gdb/testsuite/gdb.arch/mips-octeon-bbit.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/testsuite/gdb.arch/iwmmxt-regs.exp ('k') | gdb/testsuite/gdb.arch/mips-octeon-bbit.exp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 typedef unsigned long long uint64_t;
2 void abort (void);
3
4 #define BASE 0x1234567812345678ull
5
6 #define DEF_BBIT_TAKEN(BRANCH_IF, BIT) \
7 int bbit_is_taken_##BRANCH_IF##_##BIT (volatile uint64_t *p) \
8 { \
9 int ret; \
10 asm (".set push \n\t" \
11 ".set noreorder \n\t" \
12 "bbit" #BRANCH_IF " %1, " #BIT ", 1f \n\t" \
13 "nop \n\t" \
14 "li %0, 0 \n\t" \
15 "b 2f \n\t" \
16 "nop \n\t" \
17 "1: \n\t" \
18 "li %0, 1 \n\t" \
19 "2: \n\t" \
20 ".set pop" \
21 : "=r"(ret) : "r"(*p)); \
22 return ret; \
23 } \
24 volatile uint64_t taken_##BRANCH_IF##_##BIT = \
25 BASE & (~(1ull << BIT)) | ((uint64_t) BRANCH_IF << BIT); \
26 volatile uint64_t not_taken_##BRANCH_IF##_##BIT = \
27 BASE & (~(1ull << BIT)) | (((uint64_t) !BRANCH_IF) << BIT);
28
29 DEF_BBIT_TAKEN (0, 10);
30 DEF_BBIT_TAKEN (0, 36);
31 DEF_BBIT_TAKEN (1, 20);
32 DEF_BBIT_TAKEN (1, 49);
33
34 #define EXPECT(X) if (!(X)) abort ();
35
36 main ()
37 {
38 EXPECT (bbit_is_taken_0_10 (&taken_0_10));
39 EXPECT (!bbit_is_taken_0_10 (&not_taken_0_10));
40
41 EXPECT (bbit_is_taken_0_36 (&taken_0_36));
42 EXPECT (!bbit_is_taken_0_36 (&not_taken_0_36));
43
44 EXPECT (bbit_is_taken_1_20 (&taken_1_20));
45 EXPECT (!bbit_is_taken_1_20 (&not_taken_1_20));
46
47 EXPECT (bbit_is_taken_1_49 (&taken_1_49));
48 EXPECT (!bbit_is_taken_1_49 (&not_taken_1_49));
49 }
OLDNEW
« no previous file with comments | « gdb/testsuite/gdb.arch/iwmmxt-regs.exp ('k') | gdb/testsuite/gdb.arch/mips-octeon-bbit.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698