OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [config/] [alpha/] [predicates.md] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
;; Predicate definitions for DEC Alpha.
2
;; Copyright (C) 2004, 2005 Free Software Foundation, Inc.
3
;;
4
;; This file is part of GCC.
5
;;
6
;; GCC is free software; you can redistribute it and/or modify
7
;; it under the terms of the GNU General Public License as published by
8
;; the Free Software Foundation; either version 2, or (at your option)
9
;; any later version.
10
;;
11
;; GCC is distributed in the hope that it will be useful,
12
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
;; GNU General Public License for more details.
15
;;
16
;; You should have received a copy of the GNU General Public License
17
;; along with GCC; see the file COPYING.  If not, write to
18
;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
19
;; Boston, MA 02110-1301, USA.
20
 
21
;; Return 1 if OP is the zero constant for MODE.
22
(define_predicate "const0_operand"
23
  (and (match_code "const_int,const_double,const_vector")
24
       (match_test "op == CONST0_RTX (mode)")))
25
 
26
;; Returns true if OP is either the constant zero or a register.
27
(define_predicate "reg_or_0_operand"
28
  (ior (match_operand 0 "register_operand")
29
       (match_operand 0 "const0_operand")))
30
 
31
;; Return 1 if OP is a constant in the range of 0-63 (for a shift) or
32
;; any register.
33
(define_predicate "reg_or_6bit_operand"
34
  (if_then_else (match_code "const_int")
35
    (match_test "INTVAL (op) >= 0 && INTVAL (op) < 64")
36
    (match_operand 0 "register_operand")))
37
 
38
;; Return 1 if OP is an 8-bit constant.
39
(define_predicate "cint8_operand"
40
  (and (match_code "const_int")
41
       (match_test "INTVAL (op) >= 0 && INTVAL (op) < 256")))
42
 
43
;; Return 1 if OP is an 8-bit constant or any register.
44
(define_predicate "reg_or_8bit_operand"
45
  (if_then_else (match_code "const_int")
46
    (match_test "INTVAL (op) >= 0 && INTVAL (op) < 256")
47
    (match_operand 0 "register_operand")))
48
 
49
;; Return 1 if OP is a constant or any register.
50
(define_predicate "reg_or_cint_operand"
51
  (ior (match_operand 0 "register_operand")
52
       (match_operand 0 "const_int_operand")))
53
 
54
;; Return 1 if the operand is a valid second operand to an add insn.
55
(define_predicate "add_operand"
56
  (if_then_else (match_code "const_int")
57
    (match_test "CONST_OK_FOR_LETTER_P (INTVAL (op), 'K')
58
                 || CONST_OK_FOR_LETTER_P (INTVAL (op), 'L')")
59
    (match_operand 0 "register_operand")))
60
 
61
;; Return 1 if the operand is a valid second operand to a
62
;; sign-extending add insn.
63
(define_predicate "sext_add_operand"
64
  (if_then_else (match_code "const_int")
65
    (match_test "CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')
66
                 || CONST_OK_FOR_LETTER_P (INTVAL (op), 'O')")
67
    (match_operand 0 "register_operand")))
68
 
69
;; Return 1 if the operand is a non-symbolic constant operand that
70
;; does not satisfy add_operand.
71
(define_predicate "non_add_const_operand"
72
  (and (match_code "const_int,const_double,const_vector")
73
       (not (match_operand 0 "add_operand"))))
74
 
75
;; Return 1 if the operand is a non-symbolic, nonzero constant operand.
76
(define_predicate "non_zero_const_operand"
77
  (and (match_code "const_int,const_double,const_vector")
78
       (match_test "op != CONST0_RTX (mode)")))
79
 
80
;; Return 1 if OP is the constant 4 or 8.
81
(define_predicate "const48_operand"
82
  (and (match_code "const_int")
83
       (match_test "INTVAL (op) == 4 || INTVAL (op) == 8")))
84
 
85
;; Return 1 if OP is a valid first operand to an AND insn.
86
(define_predicate "and_operand"
87
  (if_then_else (match_code "const_int")
88
    (match_test "(unsigned HOST_WIDE_INT) INTVAL (op) < 0x100
89
                 || (unsigned HOST_WIDE_INT) ~ INTVAL (op) < 0x100
90
                 || zap_mask (INTVAL (op))")
91
    (if_then_else (match_code "const_double")
92
      (match_test "GET_MODE (op) == VOIDmode
93
                   && zap_mask (CONST_DOUBLE_LOW (op))
94
                   && zap_mask (CONST_DOUBLE_HIGH (op))")
95
      (match_operand 0 "register_operand"))))
96
 
97
;; Return 1 if OP is a valid first operand to an IOR or XOR insn.
98
(define_predicate "or_operand"
99
  (if_then_else (match_code "const_int")
100
    (match_test "(unsigned HOST_WIDE_INT) INTVAL (op) < 0x100
101
                 || (unsigned HOST_WIDE_INT) ~ INTVAL (op) < 0x100")
102
    (match_operand 0 "register_operand")))
103
 
104
;; Return 1 if OP is a constant that is the width, in bits, of an integral
105
;; mode not larger than DImode.
106
(define_predicate "mode_width_operand"
107
  (match_code "const_int")
108
{
109
  HOST_WIDE_INT i = INTVAL (op);
110
  return i == 8 || i == 16 || i == 32 || i == 64;
111
})
112
 
113
;; Return 1 if OP is a constant that is a mask of ones of width of an
114
;; integral machine mode not larger than DImode.
115
(define_predicate "mode_mask_operand"
116
  (match_code "const_int,const_double")
117
{
118
  if (GET_CODE (op) == CONST_INT)
119
    {
120
      HOST_WIDE_INT value = INTVAL (op);
121
 
122
      if (value == 0xff)
123
        return 1;
124
      if (value == 0xffff)
125
        return 1;
126
      if (value == 0xffffffff)
127
        return 1;
128
      if (value == -1)
129
        return 1;
130
    }
131
  else if (HOST_BITS_PER_WIDE_INT == 32 && GET_CODE (op) == CONST_DOUBLE)
132
    {
133
      if (CONST_DOUBLE_LOW (op) == 0xffffffff && CONST_DOUBLE_HIGH (op) == 0)
134
        return 1;
135
    }
136
  return 0;
137
})
138
 
139
;; Return 1 if OP is a multiple of 8 less than 64.
140
(define_predicate "mul8_operand"
141
  (match_code "const_int")
142
{
143
  unsigned HOST_WIDE_INT i = INTVAL (op);
144
  return i < 64 && i % 8 == 0;
145
})
146
 
147
;; Return 1 if OP is a hard floating-point register.
148
(define_predicate "hard_fp_register_operand"
149
  (match_operand 0 "register_operand")
150
{
151
  if (GET_CODE (op) == SUBREG)
152
    op = SUBREG_REG (op);
153
  return REGNO_REG_CLASS (REGNO (op)) == FLOAT_REGS;
154
})
155
 
156
;; Return 1 if OP is a hard general register.
157
(define_predicate "hard_int_register_operand"
158
  (match_operand 0 "register_operand")
159
{
160
  if (GET_CODE (op) == SUBREG)
161
    op = SUBREG_REG (op);
162
  return REGNO_REG_CLASS (REGNO (op)) == GENERAL_REGS;
163
})
164
 
165
;; Return 1 if OP is something that can be reloaded into a register;
166
;; if it is a MEM, it need not be valid.
167
(define_predicate "some_operand"
168
  (ior (match_code "reg,mem,const_int,const_double,const_vector,
169
                    label_ref,symbol_ref,const,high")
170
       (and (match_code "subreg")
171
            (match_test "some_operand (SUBREG_REG (op), VOIDmode)"))))
172
 
173
;; Likewise, but don't accept constants.
174
(define_predicate "some_ni_operand"
175
  (ior (match_code "reg,mem")
176
       (and (match_code "subreg")
177
            (match_test "some_ni_operand (SUBREG_REG (op), VOIDmode)"))))
178
 
179
;; Return 1 if OP is a valid operand for the source of a move insn.
180
(define_predicate "input_operand"
181
  (match_code "label_ref,symbol_ref,const,high,reg,subreg,mem,
182
               const_double,const_vector,const_int")
183
{
184
  switch (GET_CODE (op))
185
    {
186
    case LABEL_REF:
187
    case SYMBOL_REF:
188
    case CONST:
189
      if (TARGET_EXPLICIT_RELOCS)
190
        {
191
          /* We don't split symbolic operands into something unintelligable
192
             until after reload, but we do not wish non-small, non-global
193
             symbolic operands to be reconstructed from their high/lo_sum
194
             form.  */
195
          return (small_symbolic_operand (op, mode)
196
                  || global_symbolic_operand (op, mode)
197
                  || gotdtp_symbolic_operand (op, mode)
198
                  || gottp_symbolic_operand (op, mode));
199
        }
200
 
201
      /* This handles both the Windows/NT and OSF cases.  */
202
      return mode == ptr_mode || mode == DImode;
203
 
204
    case HIGH:
205
      return (TARGET_EXPLICIT_RELOCS
206
              && local_symbolic_operand (XEXP (op, 0), mode));
207
 
208
    case REG:
209
      return 1;
210
 
211
    case SUBREG:
212
      if (register_operand (op, mode))
213
        return 1;
214
      /* ... fall through ...  */
215
    case MEM:
216
      return ((TARGET_BWX || (mode != HImode && mode != QImode))
217
              && general_operand (op, mode));
218
 
219
    case CONST_DOUBLE:
220
      return op == CONST0_RTX (mode);
221
 
222
    case CONST_VECTOR:
223
      if (reload_in_progress || reload_completed)
224
        return alpha_legitimate_constant_p (op);
225
      return op == CONST0_RTX (mode);
226
 
227
    case CONST_INT:
228
      if (mode == QImode || mode == HImode)
229
        return true;
230
      if (reload_in_progress || reload_completed)
231
        return alpha_legitimate_constant_p (op);
232
      return add_operand (op, mode);
233
 
234
    default:
235
      gcc_unreachable ();
236
    }
237
  return 0;
238
})
239
 
240
;; Return 1 if OP is a SYMBOL_REF for a function known to be in this
241
;; file, and in the same section as the current function.
242
 
243
(define_predicate "samegp_function_operand"
244
  (match_code "symbol_ref")
245
{
246
  /* Easy test for recursion.  */
247
  if (op == XEXP (DECL_RTL (current_function_decl), 0))
248
    return true;
249
 
250
  /* Functions that are not local can be overridden, and thus may
251
     not share the same gp.  */
252
  if (! SYMBOL_REF_LOCAL_P (op))
253
    return false;
254
 
255
  /* If -msmall-data is in effect, assume that there is only one GP
256
     for the module, and so any local symbol has this property.  We
257
     need explicit relocations to be able to enforce this for symbols
258
     not defined in this unit of translation, however.  */
259
  if (TARGET_EXPLICIT_RELOCS && TARGET_SMALL_DATA)
260
    return true;
261
 
262
  /* Functions that are not external are defined in this UoT,
263
     and thus must share the same gp.  */
264
  return ! SYMBOL_REF_EXTERNAL_P (op);
265
})
266
 
267
;; Return 1 if OP is a SYMBOL_REF for which we can make a call via bsr.
268
(define_predicate "direct_call_operand"
269
  (match_operand 0 "samegp_function_operand")
270
{
271
  tree op_decl, cfun_sec, op_sec;
272
 
273
  /* If profiling is implemented via linker tricks, we can't jump
274
     to the nogp alternate entry point.  Note that current_function_profile
275
     would not be correct, since that doesn't indicate if the target
276
     function uses profiling.  */
277
  /* ??? TARGET_PROFILING_NEEDS_GP isn't really the right test,
278
     but is approximately correct for the OSF ABIs.  Don't know
279
     what to do for VMS, NT, or UMK.  */
280
  if (!TARGET_PROFILING_NEEDS_GP && profile_flag)
281
    return false;
282
 
283
  /* Must be a function.  In some cases folks create thunks in static
284
     data structures and then make calls to them.  If we allow the
285
     direct call, we'll get an error from the linker about !samegp reloc
286
     against a symbol without a .prologue directive.  */
287
  if (!SYMBOL_REF_FUNCTION_P (op))
288
    return false;
289
 
290
  /* Must be "near" so that the branch is assumed to reach.  With
291
     -msmall-text, this is assumed true of all local symbols.  Since
292
     we've already checked samegp, locality is already assured.  */
293
  if (TARGET_SMALL_TEXT)
294
    return true;
295
 
296
  /* Otherwise, a decl is "near" if it is defined in the same section.  */
297
  if (flag_function_sections)
298
    return false;
299
 
300
  op_decl = SYMBOL_REF_DECL (op);
301
  if (DECL_ONE_ONLY (current_function_decl)
302
      || (op_decl && DECL_ONE_ONLY (op_decl)))
303
    return false;
304
 
305
  cfun_sec = DECL_SECTION_NAME (current_function_decl);
306
  op_sec = op_decl ? DECL_SECTION_NAME (op_decl) : NULL;
307
  return ((!cfun_sec && !op_sec)
308
          || (cfun_sec && op_sec
309
              && strcmp (TREE_STRING_POINTER (cfun_sec),
310
                         TREE_STRING_POINTER (op_sec)) == 0));
311
})
312
 
313
;; Return 1 if OP is a valid operand for the MEM of a CALL insn.
314
;;
315
;; For TARGET_ABI_OSF, we want to restrict to R27 or a pseudo.
316
;; For TARGET_ABI_UNICOSMK, we want to restrict to registers.
317
 
318
(define_predicate "call_operand"
319
  (if_then_else (match_code "reg")
320
    (match_test "!TARGET_ABI_OSF
321
                 || REGNO (op) == 27 || REGNO (op) > LAST_VIRTUAL_REGISTER")
322
    (and (match_test "!TARGET_ABI_UNICOSMK")
323
         (match_code "symbol_ref"))))
324
 
325
;; Return true if OP is a LABEL_REF, or SYMBOL_REF or CONST referencing
326
;; a (non-tls) variable known to be defined in this file.
327
(define_predicate "local_symbolic_operand"
328
  (match_code "label_ref,const,symbol_ref")
329
{
330
  if (GET_CODE (op) == LABEL_REF)
331
    return 1;
332
 
333
  if (GET_CODE (op) == CONST
334
      && GET_CODE (XEXP (op, 0)) == PLUS
335
      && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT)
336
    op = XEXP (XEXP (op, 0), 0);
337
 
338
  if (GET_CODE (op) != SYMBOL_REF)
339
    return 0;
340
 
341
  return (SYMBOL_REF_LOCAL_P (op)
342
          && !SYMBOL_REF_WEAK (op)
343
          && !SYMBOL_REF_TLS_MODEL (op));
344
})
345
 
346
;; Return true if OP is a SYMBOL_REF or CONST referencing a variable
347
;; known to be defined in this file in the small data area.
348
(define_predicate "small_symbolic_operand"
349
  (match_code "const,symbol_ref")
350
{
351
  if (! TARGET_SMALL_DATA)
352
    return 0;
353
 
354
  if (GET_CODE (op) == CONST
355
      && GET_CODE (XEXP (op, 0)) == PLUS
356
      && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT)
357
    op = XEXP (XEXP (op, 0), 0);
358
 
359
  if (GET_CODE (op) != SYMBOL_REF)
360
    return 0;
361
 
362
  /* ??? There's no encode_section_info equivalent for the rtl
363
     constant pool, so SYMBOL_FLAG_SMALL never gets set.  */
364
  if (CONSTANT_POOL_ADDRESS_P (op))
365
    return GET_MODE_SIZE (get_pool_mode (op)) <= g_switch_value;
366
 
367
  return (SYMBOL_REF_LOCAL_P (op)
368
          && SYMBOL_REF_SMALL_P (op)
369
          && SYMBOL_REF_TLS_MODEL (op) == 0);
370
})
371
 
372
;; Return true if OP is a SYMBOL_REF or CONST referencing a variable
373
;; not known (or known not) to be defined in this file.
374
(define_predicate "global_symbolic_operand"
375
  (match_code "const,symbol_ref")
376
{
377
  if (GET_CODE (op) == CONST
378
      && GET_CODE (XEXP (op, 0)) == PLUS
379
      && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT)
380
    op = XEXP (XEXP (op, 0), 0);
381
 
382
  if (GET_CODE (op) != SYMBOL_REF)
383
    return 0;
384
 
385
  return !SYMBOL_REF_LOCAL_P (op) && !SYMBOL_REF_TLS_MODEL (op);
386
})
387
 
388
;; Returns 1 if OP is a symbolic operand, i.e. a symbol_ref or a label_ref,
389
;; possibly with an offset.
390
(define_predicate "symbolic_operand"
391
  (ior (match_code "symbol_ref,label_ref")
392
       (and (match_code "const")
393
            (match_test "GET_CODE (XEXP (op,0)) == PLUS
394
                         && GET_CODE (XEXP (XEXP (op,0), 0)) == SYMBOL_REF
395
                         && GET_CODE (XEXP (XEXP (op,0), 1)) == CONST_INT"))))
396
 
397
;; Return true if OP is valid for 16-bit DTP relative relocations.
398
(define_predicate "dtp16_symbolic_operand"
399
  (and (match_code "const")
400
       (match_test "tls_symbolic_operand_1 (op, 16, UNSPEC_DTPREL)")))
401
 
402
;; Return true if OP is valid for 32-bit DTP relative relocations.
403
(define_predicate "dtp32_symbolic_operand"
404
  (and (match_code "const")
405
       (match_test "tls_symbolic_operand_1 (op, 32, UNSPEC_DTPREL)")))
406
 
407
;; Return true if OP is valid for 64-bit DTP relative relocations.
408
(define_predicate "gotdtp_symbolic_operand"
409
  (and (match_code "const")
410
       (match_test "tls_symbolic_operand_1 (op, 64, UNSPEC_DTPREL)")))
411
 
412
;; Return true if OP is valid for 16-bit TP relative relocations.
413
(define_predicate "tp16_symbolic_operand"
414
  (and (match_code "const")
415
       (match_test "tls_symbolic_operand_1 (op, 16, UNSPEC_TPREL)")))
416
 
417
;; Return true if OP is valid for 32-bit TP relative relocations.
418
(define_predicate "tp32_symbolic_operand"
419
  (and (match_code "const")
420
       (match_test "tls_symbolic_operand_1 (op, 32, UNSPEC_TPREL)")))
421
 
422
;; Return true if OP is valid for 64-bit TP relative relocations.
423
(define_predicate "gottp_symbolic_operand"
424
  (and (match_code "const")
425
       (match_test "tls_symbolic_operand_1 (op, 64, UNSPEC_TPREL)")))
426
 
427
;; Return 1 if this memory address is a known aligned register plus
428
;; a constant.  It must be a valid address.  This means that we can do
429
;; this as an aligned reference plus some offset.
430
;;
431
;; Take into account what reload will do.  Oh god this is awful.
432
;; The horrible comma-operator construct below is to prevent genrecog
433
;; from thinking that this predicate accepts REG and SUBREG.  We don't
434
;; use recog during reload, so pretending these codes are accepted
435
;; pessimizes things a tad.
436
 
437
(define_predicate "aligned_memory_operand"
438
  (ior (match_test "op = resolve_reload_operand (op), 0")
439
       (match_code "mem"))
440
{
441
  rtx base;
442
 
443
  if (MEM_ALIGN (op) >= 32)
444
    return 1;
445
  op = XEXP (op, 0);
446
 
447
  /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
448
     sorts of constructs.  Dig for the real base register.  */
449
  if (reload_in_progress
450
      && GET_CODE (op) == PLUS
451
      && GET_CODE (XEXP (op, 0)) == PLUS)
452
    base = XEXP (XEXP (op, 0), 0);
453
  else
454
    {
455
      if (! memory_address_p (mode, op))
456
        return 0;
457
      base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op);
458
    }
459
 
460
  return (GET_CODE (base) == REG && REGNO_POINTER_ALIGN (REGNO (base)) >= 32);
461
})
462
 
463
;; Similar, but return 1 if OP is a MEM which is not alignable.
464
 
465
(define_predicate "unaligned_memory_operand"
466
  (ior (match_test "op = resolve_reload_operand (op), 0")
467
       (match_code "mem"))
468
{
469
  rtx base;
470
 
471
  if (MEM_ALIGN (op) >= 32)
472
    return 0;
473
  op = XEXP (op, 0);
474
 
475
  /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
476
     sorts of constructs.  Dig for the real base register.  */
477
  if (reload_in_progress
478
      && GET_CODE (op) == PLUS
479
      && GET_CODE (XEXP (op, 0)) == PLUS)
480
    base = XEXP (XEXP (op, 0), 0);
481
  else
482
    {
483
      if (! memory_address_p (mode, op))
484
        return 0;
485
      base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op);
486
    }
487
 
488
  return (GET_CODE (base) == REG && REGNO_POINTER_ALIGN (REGNO (base)) < 32);
489
})
490
 
491
;; Return 1 if OP is any memory location.  During reload a pseudo matches.
492
(define_predicate "any_memory_operand"
493
  (ior (match_code "mem,reg")
494
       (and (match_code "subreg")
495
            (match_test "GET_CODE (SUBREG_REG (op)) == REG"))))
496
 
497
;; Return 1 if OP is either a register or an unaligned memory location.
498
(define_predicate "reg_or_unaligned_mem_operand"
499
  (ior (match_operand 0 "register_operand")
500
       (match_operand 0 "unaligned_memory_operand")))
501
 
502
;; Return 1 is OP is a memory location that is not a reference
503
;; (using an AND) to an unaligned location.  Take into account
504
;; what reload will do.
505
(define_predicate "normal_memory_operand"
506
  (ior (match_test "op = resolve_reload_operand (op), 0")
507
       (and (match_code "mem")
508
            (match_test "GET_CODE (XEXP (op, 0)) != AND"))))
509
 
510
;; Returns 1 if OP is not an eliminable register.
511
;;
512
;; This exists to cure a pathological failure in the s8addq (et al) patterns,
513
;;
514
;;      long foo () { long t; bar(); return (long) &t * 26107; }
515
;;
516
;; which run afoul of a hack in reload to cure a (presumably) similar
517
;; problem with lea-type instructions on other targets.  But there is
518
;; one of us and many of them, so work around the problem by selectively
519
;; preventing combine from making the optimization.
520
 
521
(define_predicate "reg_not_elim_operand"
522
  (match_operand 0 "register_operand")
523
{
524
  if (GET_CODE (op) == SUBREG)
525
    op = SUBREG_REG (op);
526
  return op != frame_pointer_rtx && op != arg_pointer_rtx;
527
})
528
 
529
;; Accept a register, but not a subreg of any kind.  This allows us to
530
;; avoid pathological cases in reload wrt data movement common in
531
;; int->fp conversion.  */
532
(define_predicate "reg_no_subreg_operand"
533
  (and (match_code "reg")
534
       (match_operand 0 "register_operand")))
535
 
536
;; Return 1 if OP is a valid Alpha comparison operator for "cmp" style
537
;; instructions.
538
(define_predicate "alpha_comparison_operator"
539
  (match_code "eq,le,lt,leu,ltu"))
540
 
541
;; Similarly, but with swapped operands.
542
(define_predicate "alpha_swapped_comparison_operator"
543
  (match_code "eq,ge,gt,gtu,gtu"))
544
 
545
;; Return 1 if OP is a valid Alpha comparison operator against zero
546
;; for "bcc" style instructions.
547
(define_predicate "alpha_zero_comparison_operator"
548
  (match_code "eq,ne,le,lt,leu,ltu"))
549
 
550
;; Return 1 if OP is a signed comparison operation.
551
(define_predicate "signed_comparison_operator"
552
  (match_code "eq,ne,le,lt,ge,gt"))
553
 
554
;; Return 1 if OP is a valid Alpha floating point comparison operator.
555
(define_predicate "alpha_fp_comparison_operator"
556
  (match_code "eq,le,lt,unordered"))
557
 
558
;; Return 1 if this is a divide or modulus operator.
559
(define_predicate "divmod_operator"
560
  (match_code "div,mod,udiv,umod"))
561
 
562
;; Return 1 if this is a float->int conversion operator.
563
(define_predicate "fix_operator"
564
  (match_code "fix,unsigned_fix"))
565
 
566
;; Recognize an addition operation that includes a constant.  Used to
567
;; convince reload to canonize (plus (plus reg c1) c2) during register
568
;; elimination.
569
 
570
(define_predicate "addition_operation"
571
  (and (match_code "plus")
572
       (match_test "register_operand (XEXP (op, 0), mode)
573
                    && GET_CODE (XEXP (op, 1)) == CONST_INT
574
                    && CONST_OK_FOR_LETTER_P (INTVAL (XEXP (op, 1)), 'K')")))
575
 
576
;; For TARGET_EXPLICIT_RELOCS, we don't obfuscate a SYMBOL_REF to a
577
;; small symbolic operand until after reload.  At which point we need
578
;; to replace (mem (symbol_ref)) with (mem (lo_sum $29 symbol_ref))
579
;; so that sched2 has the proper dependency information.  */
580
(define_predicate "some_small_symbolic_operand"
581
  (match_code "set,parallel,prefetch,unspec,unspec_volatile")
582
{
583
  /* Avoid search unless necessary.  */
584
  if (!TARGET_EXPLICIT_RELOCS || !reload_completed)
585
    return false;
586
  return for_each_rtx (&op, some_small_symbolic_operand_int, NULL);
587
})

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.