Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/arm/neon.md @ 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 | 3bfb6c00c1e0 |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
457 (define_insn "*neon_mov<mode>" | 457 (define_insn "*neon_mov<mode>" |
458 [(set (match_operand:VD 0 "nonimmediate_operand" | 458 [(set (match_operand:VD 0 "nonimmediate_operand" |
459 "=w,Uv,w, w, ?r,?w,?r,?r, ?Us") | 459 "=w,Uv,w, w, ?r,?w,?r,?r, ?Us") |
460 (match_operand:VD 1 "general_operand" | 460 (match_operand:VD 1 "general_operand" |
461 " w,w, Dn,Uvi, w, r, r, Usi,r"))] | 461 " w,w, Dn,Uvi, w, r, r, Usi,r"))] |
462 "TARGET_NEON" | 462 "TARGET_NEON |
463 && (register_operand (operands[0], <MODE>mode) | |
464 || register_operand (operands[1], <MODE>mode))" | |
463 { | 465 { |
464 if (which_alternative == 2) | 466 if (which_alternative == 2) |
465 { | 467 { |
466 int width, is_valid; | 468 int width, is_valid; |
467 static char templ[40]; | 469 static char templ[40]; |
479 return templ; | 481 return templ; |
480 } | 482 } |
481 | 483 |
482 /* FIXME: If the memory layout is changed in big-endian mode, output_move_vfp | 484 /* FIXME: If the memory layout is changed in big-endian mode, output_move_vfp |
483 below must be changed to output_move_neon (which will use the | 485 below must be changed to output_move_neon (which will use the |
484 element/structure loads/stores), and the constraint changed to 'Un' instead | 486 element/structure loads/stores), and the constraint changed to 'Um' instead |
485 of 'Uv'. */ | 487 of 'Uv'. */ |
486 | 488 |
487 switch (which_alternative) | 489 switch (which_alternative) |
488 { | 490 { |
489 case 0: return "vmov\t%P0, %P1 @ <mode>"; | 491 case 0: return "vmov\t%P0, %P1 @ <mode>"; |
504 (define_insn "*neon_mov<mode>" | 506 (define_insn "*neon_mov<mode>" |
505 [(set (match_operand:VQXMOV 0 "nonimmediate_operand" | 507 [(set (match_operand:VQXMOV 0 "nonimmediate_operand" |
506 "=w,Un,w, w, ?r,?w,?r,?r, ?Us") | 508 "=w,Un,w, w, ?r,?w,?r,?r, ?Us") |
507 (match_operand:VQXMOV 1 "general_operand" | 509 (match_operand:VQXMOV 1 "general_operand" |
508 " w,w, Dn,Uni, w, r, r, Usi, r"))] | 510 " w,w, Dn,Uni, w, r, r, Usi, r"))] |
509 "TARGET_NEON" | 511 "TARGET_NEON |
512 && (register_operand (operands[0], <MODE>mode) | |
513 || register_operand (operands[1], <MODE>mode))" | |
510 { | 514 { |
511 if (which_alternative == 2) | 515 if (which_alternative == 2) |
512 { | 516 { |
513 int width, is_valid; | 517 int width, is_valid; |
514 static char templ[40]; | 518 static char templ[40]; |
547 (define_expand "movti" | 551 (define_expand "movti" |
548 [(set (match_operand:TI 0 "nonimmediate_operand" "") | 552 [(set (match_operand:TI 0 "nonimmediate_operand" "") |
549 (match_operand:TI 1 "general_operand" ""))] | 553 (match_operand:TI 1 "general_operand" ""))] |
550 "TARGET_NEON" | 554 "TARGET_NEON" |
551 { | 555 { |
556 if (can_create_pseudo_p ()) | |
557 { | |
558 if (GET_CODE (operands[0]) != REG) | |
559 operands[1] = force_reg (TImode, operands[1]); | |
560 } | |
552 }) | 561 }) |
553 | 562 |
554 (define_expand "mov<mode>" | 563 (define_expand "mov<mode>" |
555 [(set (match_operand:VSTRUCT 0 "nonimmediate_operand" "") | 564 [(set (match_operand:VSTRUCT 0 "nonimmediate_operand" "") |
556 (match_operand:VSTRUCT 1 "general_operand" ""))] | 565 (match_operand:VSTRUCT 1 "general_operand" ""))] |
557 "TARGET_NEON" | 566 "TARGET_NEON" |
558 { | 567 { |
568 if (can_create_pseudo_p ()) | |
569 { | |
570 if (GET_CODE (operands[0]) != REG) | |
571 operands[1] = force_reg (<MODE>mode, operands[1]); | |
572 } | |
559 }) | 573 }) |
560 | 574 |
561 (define_insn "*neon_mov<mode>" | 575 (define_insn "*neon_mov<mode>" |
562 [(set (match_operand:VSTRUCT 0 "nonimmediate_operand" "=w,Ut,w") | 576 [(set (match_operand:VSTRUCT 0 "nonimmediate_operand" "=w,Ut,w") |
563 (match_operand:VSTRUCT 1 "general_operand" " w,w, Ut"))] | 577 (match_operand:VSTRUCT 1 "general_operand" " w,w, Ut"))] |
564 "TARGET_NEON" | 578 "TARGET_NEON |
579 && (register_operand (operands[0], <MODE>mode) | |
580 || register_operand (operands[1], <MODE>mode))" | |
565 { | 581 { |
566 switch (which_alternative) | 582 switch (which_alternative) |
567 { | 583 { |
568 case 0: return "#"; | 584 case 0: return "#"; |
569 case 1: case 2: return output_move_neon (operands); | 585 case 1: case 2: return output_move_neon (operands); |
860 (if_then_else (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0)) | 876 (if_then_else (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0)) |
861 (const_string "neon_mul_qqq_8_16_32_ddd_32") | 877 (const_string "neon_mul_qqq_8_16_32_ddd_32") |
862 (const_string "neon_mul_qqq_8_16_32_ddd_32")))))] | 878 (const_string "neon_mul_qqq_8_16_32_ddd_32")))))] |
863 ) | 879 ) |
864 | 880 |
881 (define_insn "*mul<mode>3add<mode>_neon" | |
882 [(set (match_operand:VDQ 0 "s_register_operand" "=w") | |
883 (plus:VDQ (mult:VDQ (match_operand:VDQ 2 "s_register_operand" "w") | |
884 (match_operand:VDQ 3 "s_register_operand" "w")) | |
885 (match_operand:VDQ 1 "s_register_operand" "0")))] | |
886 "TARGET_NEON" | |
887 "vmla.<V_if_elem>\t%<V_reg>0, %<V_reg>2, %<V_reg>3" | |
888 [(set (attr "neon_type") | |
889 (if_then_else (ne (symbol_ref "<Is_float_mode>") (const_int 0)) | |
890 (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0)) | |
891 (const_string "neon_fp_vmla_ddd") | |
892 (const_string "neon_fp_vmla_qqq")) | |
893 (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0)) | |
894 (if_then_else | |
895 (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0)) | |
896 (const_string "neon_mla_ddd_8_16_qdd_16_8_long_32_16_long") | |
897 (const_string "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long")) | |
898 (if_then_else (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0)) | |
899 (const_string "neon_mla_qqq_8_16") | |
900 (const_string "neon_mla_qqq_32_qqd_32_scalar")))))] | |
901 ) | |
902 | |
903 (define_insn "*mul<mode>3neg<mode>add<mode>_neon" | |
904 [(set (match_operand:VDQ 0 "s_register_operand" "=w") | |
905 (minus:VDQ (match_operand:VDQ 1 "s_register_operand" "0") | |
906 (mult:VDQ (match_operand:VDQ 2 "s_register_operand" "w") | |
907 (match_operand:VDQ 3 "s_register_operand" "w"))))] | |
908 "TARGET_NEON" | |
909 "vmls.<V_if_elem>\t%<V_reg>0, %<V_reg>2, %<V_reg>3" | |
910 [(set (attr "neon_type") | |
911 (if_then_else (ne (symbol_ref "<Is_float_mode>") (const_int 0)) | |
912 (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0)) | |
913 (const_string "neon_fp_vmla_ddd") | |
914 (const_string "neon_fp_vmla_qqq")) | |
915 (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0)) | |
916 (if_then_else | |
917 (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0)) | |
918 (const_string "neon_mla_ddd_8_16_qdd_16_8_long_32_16_long") | |
919 (const_string "neon_mla_ddd_32_qqd_16_ddd_32_scalar_qdd_64_32_long_scalar_qdd_64_32_long")) | |
920 (if_then_else (ne (symbol_ref "<Scalar_mul_8_16>") (const_int 0)) | |
921 (const_string "neon_mla_qqq_8_16") | |
922 (const_string "neon_mla_qqq_32_qqd_32_scalar")))))] | |
923 ) | |
924 | |
865 (define_insn "ior<mode>3" | 925 (define_insn "ior<mode>3" |
866 [(set (match_operand:VDQ 0 "s_register_operand" "=w,w") | 926 [(set (match_operand:VDQ 0 "s_register_operand" "=w,w") |
867 (ior:VDQ (match_operand:VDQ 1 "s_register_operand" "w,0") | 927 (ior:VDQ (match_operand:VDQ 1 "s_register_operand" "w,0") |
868 (match_operand:VDQ 2 "neon_logic_op2" "w,Dl")))] | 928 (match_operand:VDQ 2 "neon_logic_op2" "w,Dl")))] |
869 "TARGET_NEON" | 929 "TARGET_NEON" |
1072 | 1132 |
1073 ; TODO: V2DI shifts are current disabled because there are bugs in the | 1133 ; TODO: V2DI shifts are current disabled because there are bugs in the |
1074 ; generic vectorizer code. It ends up creating a V2DI constructor with | 1134 ; generic vectorizer code. It ends up creating a V2DI constructor with |
1075 ; SImode elements. | 1135 ; SImode elements. |
1076 | 1136 |
1077 (define_insn "ashl<mode>3" | 1137 (define_insn "vashl<mode>3" |
1078 [(set (match_operand:VDQIW 0 "s_register_operand" "=w") | 1138 [(set (match_operand:VDQIW 0 "s_register_operand" "=w") |
1079 (ashift:VDQIW (match_operand:VDQIW 1 "s_register_operand" "w") | 1139 (ashift:VDQIW (match_operand:VDQIW 1 "s_register_operand" "w") |
1080 (match_operand:VDQIW 2 "s_register_operand" "w")))] | 1140 (match_operand:VDQIW 2 "s_register_operand" "w")))] |
1081 "TARGET_NEON" | 1141 "TARGET_NEON" |
1082 "vshl.<V_s_elem>\t%<V_reg>0, %<V_reg>1, %<V_reg>2" | 1142 "vshl.<V_s_elem>\t%<V_reg>0, %<V_reg>1, %<V_reg>2" |
1118 (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0)) | 1178 (if_then_else (ne (symbol_ref "<Is_d_reg>") (const_int 0)) |
1119 (const_string "neon_vshl_ddd") | 1179 (const_string "neon_vshl_ddd") |
1120 (const_string "neon_shift_3")))] | 1180 (const_string "neon_shift_3")))] |
1121 ) | 1181 ) |
1122 | 1182 |
1123 (define_expand "ashr<mode>3" | 1183 (define_expand "vashr<mode>3" |
1124 [(set (match_operand:VDQIW 0 "s_register_operand" "") | 1184 [(set (match_operand:VDQIW 0 "s_register_operand" "") |
1125 (ashiftrt:VDQIW (match_operand:VDQIW 1 "s_register_operand" "") | 1185 (ashiftrt:VDQIW (match_operand:VDQIW 1 "s_register_operand" "") |
1126 (match_operand:VDQIW 2 "s_register_operand" "")))] | 1186 (match_operand:VDQIW 2 "s_register_operand" "")))] |
1127 "TARGET_NEON" | 1187 "TARGET_NEON" |
1128 { | 1188 { |
1132 emit_insn (gen_ashl<mode>3_signed (operands[0], operands[1], neg)); | 1192 emit_insn (gen_ashl<mode>3_signed (operands[0], operands[1], neg)); |
1133 | 1193 |
1134 DONE; | 1194 DONE; |
1135 }) | 1195 }) |
1136 | 1196 |
1137 (define_expand "lshr<mode>3" | 1197 (define_expand "vlshr<mode>3" |
1138 [(set (match_operand:VDQIW 0 "s_register_operand" "") | 1198 [(set (match_operand:VDQIW 0 "s_register_operand" "") |
1139 (lshiftrt:VDQIW (match_operand:VDQIW 1 "s_register_operand" "") | 1199 (lshiftrt:VDQIW (match_operand:VDQIW 1 "s_register_operand" "") |
1140 (match_operand:VDQIW 2 "s_register_operand" "")))] | 1200 (match_operand:VDQIW 2 "s_register_operand" "")))] |
1141 "TARGET_NEON" | 1201 "TARGET_NEON" |
1142 { | 1202 { |
2625 emit_move_insn (operands[0], src); | 2685 emit_move_insn (operands[0], src); |
2626 DONE; | 2686 DONE; |
2627 }) | 2687 }) |
2628 | 2688 |
2629 (define_insn "neon_vdup_n<mode>" | 2689 (define_insn "neon_vdup_n<mode>" |
2630 [(set (match_operand:VDQW 0 "s_register_operand" "=w") | 2690 [(set (match_operand:VX 0 "s_register_operand" "=w") |
2631 (unspec:VDQW [(match_operand:<V_elem> 1 "s_register_operand" "r")] | 2691 (unspec:VX [(match_operand:<V_elem> 1 "s_register_operand" "r")] |
2632 UNSPEC_VDUP_N))] | 2692 UNSPEC_VDUP_N))] |
2633 "TARGET_NEON" | 2693 "TARGET_NEON" |
2634 "vdup%?.<V_sz_elem>\t%<V_reg>0, %1" | 2694 "vdup%?.<V_sz_elem>\t%<V_reg>0, %1" |
2695 ;; Assume this schedules like vmov. | |
2696 [(set_attr "predicable" "yes") | |
2697 (set_attr "neon_type" "neon_bp_simple")] | |
2698 ) | |
2699 | |
2700 (define_insn "neon_vdup_n<mode>" | |
2701 [(set (match_operand:V32 0 "s_register_operand" "=w,w") | |
2702 (unspec:V32 [(match_operand:<V_elem> 1 "s_register_operand" "r,t")] | |
2703 UNSPEC_VDUP_N))] | |
2704 "TARGET_NEON" | |
2705 "@ | |
2706 vdup%?.<V_sz_elem>\t%<V_reg>0, %1 | |
2707 vdup%?.<V_sz_elem>\t%<V_reg>0, %y1" | |
2635 ;; Assume this schedules like vmov. | 2708 ;; Assume this schedules like vmov. |
2636 [(set_attr "predicable" "yes") | 2709 [(set_attr "predicable" "yes") |
2637 (set_attr "neon_type" "neon_bp_simple")] | 2710 (set_attr "neon_type" "neon_bp_simple")] |
2638 ) | 2711 ) |
2639 | 2712 |