comparison gcc/config/alpha/predicates.md @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
comparison
equal deleted inserted replaced
56:3c8a44c06a95 63:b7f97abdc517
1 ;; Predicate definitions for DEC Alpha. 1 ;; Predicate definitions for DEC Alpha.
2 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 2 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010
3 ;; Free Software Foundation, Inc.
3 ;; 4 ;;
4 ;; This file is part of GCC. 5 ;; This file is part of GCC.
5 ;; 6 ;;
6 ;; GCC is free software; you can redistribute it and/or modify 7 ;; 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 ;; it under the terms of the GNU General Public License as published by
437 (define_special_predicate "aligned_memory_operand" 438 (define_special_predicate "aligned_memory_operand"
438 (ior (match_test "op = resolve_reload_operand (op), 0") 439 (ior (match_test "op = resolve_reload_operand (op), 0")
439 (match_code "mem")) 440 (match_code "mem"))
440 { 441 {
441 rtx base; 442 rtx base;
443 int offset;
442 444
443 if (MEM_ALIGN (op) >= 32) 445 if (MEM_ALIGN (op) >= 32)
444 return 1; 446 return 1;
447
445 op = XEXP (op, 0); 448 op = XEXP (op, 0);
446 449
447 /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo) 450 /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
448 sorts of constructs. Dig for the real base register. */ 451 sorts of constructs. Dig for the real base register. */
449 if (reload_in_progress 452 if (reload_in_progress
450 && GET_CODE (op) == PLUS 453 && GET_CODE (op) == PLUS
451 && GET_CODE (XEXP (op, 0)) == PLUS) 454 && GET_CODE (XEXP (op, 0)) == PLUS)
452 base = XEXP (XEXP (op, 0), 0); 455 {
456 base = XEXP (XEXP (op, 0), 0);
457 offset = INTVAL (XEXP (op, 1));
458 }
453 else 459 else
454 { 460 {
455 if (! memory_address_p (mode, op)) 461 if (! memory_address_p (mode, op))
456 return 0; 462 return 0;
457 base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op); 463 if (GET_CODE (op) == PLUS)
458 } 464 {
465 base = XEXP (op, 0);
466 offset = INTVAL (XEXP (op, 1));
467 }
468 else
469 {
470 base = op;
471 offset = 0;
472 }
473 }
474
475 if (offset % GET_MODE_SIZE (mode))
476 return 0;
459 477
460 return (REG_P (base) && REGNO_POINTER_ALIGN (REGNO (base)) >= 32); 478 return (REG_P (base) && REGNO_POINTER_ALIGN (REGNO (base)) >= 32);
461 }) 479 })
462 480
463 ;; Similar, but return 1 if OP is a MEM which is not alignable. 481 ;; Similar, but return 1 if OP is a MEM which is not alignable.
465 (define_special_predicate "unaligned_memory_operand" 483 (define_special_predicate "unaligned_memory_operand"
466 (ior (match_test "op = resolve_reload_operand (op), 0") 484 (ior (match_test "op = resolve_reload_operand (op), 0")
467 (match_code "mem")) 485 (match_code "mem"))
468 { 486 {
469 rtx base; 487 rtx base;
488 int offset;
470 489
471 if (MEM_ALIGN (op) >= 32) 490 if (MEM_ALIGN (op) >= 32)
472 return 0; 491 return 0;
492
473 op = XEXP (op, 0); 493 op = XEXP (op, 0);
474 494
475 /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo) 495 /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
476 sorts of constructs. Dig for the real base register. */ 496 sorts of constructs. Dig for the real base register. */
477 if (reload_in_progress 497 if (reload_in_progress
478 && GET_CODE (op) == PLUS 498 && GET_CODE (op) == PLUS
479 && GET_CODE (XEXP (op, 0)) == PLUS) 499 && GET_CODE (XEXP (op, 0)) == PLUS)
480 base = XEXP (XEXP (op, 0), 0); 500 {
501 base = XEXP (XEXP (op, 0), 0);
502 offset = INTVAL (XEXP (op, 1));
503 }
481 else 504 else
482 { 505 {
483 if (! memory_address_p (mode, op)) 506 if (! memory_address_p (mode, op))
484 return 0; 507 return 0;
485 base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op); 508 if (GET_CODE (op) == PLUS)
486 } 509 {
510 base = XEXP (op, 0);
511 offset = INTVAL (XEXP (op, 1));
512 }
513 else
514 {
515 base = op;
516 offset = 0;
517 }
518 }
519
520 if (offset % GET_MODE_SIZE (mode))
521 return 1;
487 522
488 return (REG_P (base) && REGNO_POINTER_ALIGN (REGNO (base)) < 32); 523 return (REG_P (base) && REGNO_POINTER_ALIGN (REGNO (base)) < 32);
489 }) 524 })
490 525
491 ;; Return 1 if OP is any memory location. During reload a pseudo matches. 526 ;; Return 1 if OP is any memory location. During reload a pseudo matches.