Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree-vect-generic.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | 58ad6c70ea60 |
children | b7f97abdc517 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
1 /* Lower vector operations to scalar operations. | 1 /* Lower vector operations to scalar operations. |
2 Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 2 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 |
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 it | 7 GCC is free software; you can redistribute it and/or modify it |
7 under the terms of the GNU General Public License as published by the | 8 under the terms of the GNU General Public License as published by the |
8 Free Software Foundation; either version 3, or (at your option) any | 9 Free Software Foundation; either version 3, or (at your option) any |
9 later version. | 10 later version. |
10 | 11 |
11 GCC is distributed in the hope that it will be useful, but WITHOUT | 12 GCC is distributed in the hope that it will be useful, but WITHOUT |
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
14 for more details. | 15 for more details. |
15 | 16 |
16 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
17 along with GCC; see the file COPYING3. If not see | 18 along with GCC; see the file COPYING3. If not see |
18 <http://www.gnu.org/licenses/>. */ | 19 <http://www.gnu.org/licenses/>. */ |
19 | 20 |
20 #include "config.h" | 21 #include "config.h" |
414 rhs2 = gimple_assign_rhs2 (stmt); | 415 rhs2 = gimple_assign_rhs2 (stmt); |
415 | 416 |
416 if (TREE_CODE (type) != VECTOR_TYPE) | 417 if (TREE_CODE (type) != VECTOR_TYPE) |
417 return; | 418 return; |
418 | 419 |
419 if (code == NOP_EXPR | 420 if (code == NOP_EXPR |
420 || code == FLOAT_EXPR | 421 || code == FLOAT_EXPR |
421 || code == FIX_TRUNC_EXPR | 422 || code == FIX_TRUNC_EXPR |
422 || code == VIEW_CONVERT_EXPR) | 423 || code == VIEW_CONVERT_EXPR) |
423 return; | 424 return; |
424 | 425 |
425 gcc_assert (code != CONVERT_EXPR); | 426 gcc_assert (code != CONVERT_EXPR); |
426 | 427 |
427 /* The signedness is determined from input argument. */ | 428 /* The signedness is determined from input argument. */ |
428 if (code == VEC_UNPACK_FLOAT_HI_EXPR | 429 if (code == VEC_UNPACK_FLOAT_HI_EXPR |
429 || code == VEC_UNPACK_FLOAT_LO_EXPR) | 430 || code == VEC_UNPACK_FLOAT_LO_EXPR) |
430 type = TREE_TYPE (rhs1); | 431 type = TREE_TYPE (rhs1); |
431 | 432 |
432 /* Choose between vector shift/rotate by vector and vector shift/rotate by | 433 /* Choose between vector shift/rotate by vector and vector shift/rotate by |
433 scalar */ | 434 scalar */ |
434 if (code == LSHIFT_EXPR | 435 if (code == LSHIFT_EXPR |
435 || code == RSHIFT_EXPR | 436 || code == RSHIFT_EXPR |
436 || code == LROTATE_EXPR | 437 || code == LROTATE_EXPR |
437 || code == RROTATE_EXPR) | 438 || code == RROTATE_EXPR) |
438 { | 439 { |
439 /* If the 2nd argument is vector, we need a vector/vector shift */ | 440 /* If the 2nd argument is vector, we need a vector/vector shift */ |
440 if (VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (rhs2)))) | 441 if (VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (rhs2)))) |
451 } | 452 } |
452 } | 453 } |
453 else | 454 else |
454 op = optab_for_tree_code (code, type, optab_default); | 455 op = optab_for_tree_code (code, type, optab_default); |
455 | 456 |
456 /* For widening/narrowing vector operations, the relevant type is of the | 457 /* For widening/narrowing vector operations, the relevant type is of the |
457 arguments, not the widened result. VEC_UNPACK_FLOAT_*_EXPR is | 458 arguments, not the widened result. VEC_UNPACK_FLOAT_*_EXPR is |
458 calculated in the same way above. */ | 459 calculated in the same way above. */ |
459 if (code == WIDEN_SUM_EXPR | 460 if (code == WIDEN_SUM_EXPR |
460 || code == VEC_WIDEN_MULT_HI_EXPR | 461 || code == VEC_WIDEN_MULT_HI_EXPR |
461 || code == VEC_WIDEN_MULT_LO_EXPR | 462 || code == VEC_WIDEN_MULT_LO_EXPR |
545 } | 546 } |
546 } | 547 } |
547 return 0; | 548 return 0; |
548 } | 549 } |
549 | 550 |
550 struct gimple_opt_pass pass_lower_vector = | 551 struct gimple_opt_pass pass_lower_vector = |
551 { | 552 { |
552 { | 553 { |
553 GIMPLE_PASS, | 554 GIMPLE_PASS, |
554 "veclower", /* name */ | 555 "veclower", /* name */ |
555 0, /* gate */ | 556 0, /* gate */ |
556 expand_vector_operations, /* execute */ | 557 expand_vector_operations, /* execute */ |
557 NULL, /* sub */ | 558 NULL, /* sub */ |
558 NULL, /* next */ | 559 NULL, /* next */ |
559 0, /* static_pass_number */ | 560 0, /* static_pass_number */ |
560 0, /* tv_id */ | 561 TV_NONE, /* tv_id */ |
561 PROP_cfg, /* properties_required */ | 562 PROP_cfg, /* properties_required */ |
562 0, /* properties_provided */ | 563 0, /* properties_provided */ |
563 0, /* properties_destroyed */ | 564 0, /* properties_destroyed */ |
564 0, /* todo_flags_start */ | 565 0, /* todo_flags_start */ |
565 TODO_dump_func | TODO_ggc_collect | 566 TODO_dump_func | TODO_ggc_collect |
566 | TODO_verify_stmts /* todo_flags_finish */ | 567 | TODO_verify_stmts /* todo_flags_finish */ |
567 } | 568 } |
568 }; | 569 }; |
569 | 570 |
570 struct gimple_opt_pass pass_lower_vector_ssa = | 571 struct gimple_opt_pass pass_lower_vector_ssa = |
571 { | 572 { |
572 { | 573 { |
573 GIMPLE_PASS, | 574 GIMPLE_PASS, |
574 "veclower2", /* name */ | 575 "veclower2", /* name */ |
575 gate_expand_vector_operations, /* gate */ | 576 gate_expand_vector_operations, /* gate */ |
576 expand_vector_operations, /* execute */ | 577 expand_vector_operations, /* execute */ |
577 NULL, /* sub */ | 578 NULL, /* sub */ |
578 NULL, /* next */ | 579 NULL, /* next */ |
579 0, /* static_pass_number */ | 580 0, /* static_pass_number */ |
580 0, /* tv_id */ | 581 TV_NONE, /* tv_id */ |
581 PROP_cfg, /* properties_required */ | 582 PROP_cfg, /* properties_required */ |
582 0, /* properties_provided */ | 583 0, /* properties_provided */ |
583 0, /* properties_destroyed */ | 584 0, /* properties_destroyed */ |
584 0, /* todo_flags_start */ | 585 0, /* todo_flags_start */ |
585 TODO_dump_func | TODO_update_ssa /* todo_flags_finish */ | 586 TODO_dump_func | TODO_update_ssa /* todo_flags_finish */ |