Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/microblaze/predicates.md @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | 561a7518be6b |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ;; Predicate definitions for Xilinx MicroBlaze | 1 ;; Predicate definitions for Xilinx MicroBlaze |
2 ;; Copyright 2009, 2010 Free Software Foundation, Inc. | 2 ;; Copyright (C) 2009-2017 Free Software Foundation, Inc. |
3 ;; | 3 ;; |
4 ;; Contributed by Michael Eager <eager@eagercon.com>. | 4 ;; Contributed by Michael Eager <eager@eagercon.com>. |
5 ;; | 5 ;; |
6 ;; This file is part of GCC. | 6 ;; This file is part of GCC. |
7 ;; | 7 ;; |
28 (define_predicate "arith_operand32" | 28 (define_predicate "arith_operand32" |
29 (ior (match_operand 0 "register_operand") | 29 (ior (match_operand 0 "register_operand") |
30 (and (match_code "const_int,const_double") | 30 (and (match_code "const_int,const_double") |
31 (match_test "LARGE_INT (op)")))) | 31 (match_test "LARGE_INT (op)")))) |
32 | 32 |
33 (define_predicate "arith_plus_operand" | |
34 (match_operand 0 "general_operand") | |
35 { | |
36 switch (GET_CODE (op)) | |
37 { | |
38 default: | |
39 return 0; | |
40 case CONST_INT: | |
41 case REG: | |
42 return 1; | |
43 case SYMBOL_REF: | |
44 case LABEL_REF: | |
45 if (flag_pic || microblaze_tls_referenced_p(op)) | |
46 return 0; | |
47 return 1; | |
48 case CONST: | |
49 { | |
50 rtx const0; | |
51 const0 = XEXP (op, 0); | |
52 | |
53 switch (GET_CODE(const0)) | |
54 { | |
55 default: | |
56 return 0; | |
57 case UNSPEC : | |
58 return 1; | |
59 | |
60 case PLUS : | |
61 { | |
62 rtx p0, p1; | |
63 p0 = XEXP (const0, 0); | |
64 p1 = XEXP (const0, 1); | |
65 | |
66 if ((GET_CODE(p0) == SYMBOL_REF | |
67 || GET_CODE (p0) == LABEL_REF) | |
68 && GET_CODE(p1) == CONST_INT) | |
69 { | |
70 return arith_plus_operand (p0, GET_MODE(p0)); | |
71 } | |
72 } | |
73 } | |
74 } | |
75 } | |
76 return 0; | |
77 }) | |
78 | |
33 (define_predicate "const_0_operand" | 79 (define_predicate "const_0_operand" |
34 (and (match_code "const_int,const_double") | 80 (and (match_code "const_int,const_double") |
35 (match_test "op == CONST0_RTX (GET_MODE (op))"))) | 81 (match_test "op == CONST0_RTX (GET_MODE (op))"))) |
36 | 82 |
37 ;; Return whether OP is a register or the constant 0. | 83 ;; Return whether OP is a register or the constant 0. |
38 (define_predicate "reg_or_0_operand" | 84 (define_predicate "reg_or_0_operand" |
39 (ior (match_operand 0 "const_0_operand") | 85 (ior (match_operand 0 "const_0_operand") |
86 (match_operand 0 "register_operand"))) | |
87 | |
88 (define_predicate "reg_or_mem_operand" | |
89 (ior (match_operand 0 "memory_operand") | |
40 (match_operand 0 "register_operand"))) | 90 (match_operand 0 "register_operand"))) |
41 | 91 |
42 ;; Return if the operand is either the PC or a label_ref. | 92 ;; Return if the operand is either the PC or a label_ref. |
43 (define_special_predicate "pc_or_label_operand" | 93 (define_special_predicate "pc_or_label_operand" |
44 (ior (match_code "pc,label_ref") | 94 (ior (match_code "pc,label_ref") |
47 | 97 |
48 ;; Test for valid call operand | 98 ;; Test for valid call operand |
49 (define_predicate "call_insn_operand" | 99 (define_predicate "call_insn_operand" |
50 (match_test "CALL_INSN_OP (op)")) | 100 (match_test "CALL_INSN_OP (op)")) |
51 | 101 |
102 (define_predicate "call_insn_simple_operand" | |
103 (and (match_test "CALL_INSN_OP (op)") | |
104 (match_test "GET_CODE (op) == REG || GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == CONST_INT"))) | |
105 | |
52 ;; Return if OPERAND is valid as a source operand for a move instruction. | 106 ;; Return if OPERAND is valid as a source operand for a move instruction. |
53 (define_predicate "move_operand" | 107 (define_predicate "move_src_operand" |
54 (and ( | 108 (and ( |
55 not ( | 109 not ( |
56 and (match_code "plus") | 110 and (match_code "plus") |
57 (not (match_test "(GET_CODE (XEXP (op, 0)) == REG) ^ (GET_CODE (XEXP (op,1)) == REG)")) | 111 (not (match_test "(GET_CODE (XEXP (op, 0)) == REG) ^ (GET_CODE (XEXP (op,1)) == REG)")) |
58 ) | 112 ) |
59 ) | 113 ) |
60 (match_operand 0 "general_operand"))) | 114 (match_operand 0 "general_operand")) |
115 { | |
116 if (microblaze_tls_referenced_p(op) | |
117 || (flag_pic && (symbol_mentioned_p(op) || label_mentioned_p(op)))) | |
118 return false; | |
119 | |
120 return true; | |
121 }) | |
61 | 122 |
62 ;; Test for valid PIC call operand | 123 ;; Test for valid PIC call operand |
63 (define_predicate "call_insn_plt_operand" | 124 (define_predicate "call_insn_plt_operand" |
64 (match_test "PLT_ADDR_P (op)")) | 125 (match_test "PLT_ADDR_P (op)")) |
126 | |
127 ;; Return if the code of this rtx pattern is a comparison. | |
128 (define_predicate "cmp_op" | |
129 (match_code "gt,ge,gtu,geu,lt,le,ltu,leu")) |