Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 453294
Collapse All | Expand All

(-)gcc/config/arm/arm-arches.def (-2 / +2 lines)
Lines 1-6 Link Here
1
/* ARM CPU architectures.
1
/* ARM CPU architectures.
2
   Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2
   Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
3
   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
3
   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4
   Free Software Foundation, Inc.
4
   Free Software Foundation, Inc.
5
5
6
   This file is part of GCC.
6
   This file is part of GCC.
Lines 57-60 Link Here
57
ARM_ARCH("armv7e-m", cortexm4,  7EM, FL_CO_PROC |	      FL_FOR_ARCH7EM)
57
ARM_ARCH("armv7e-m", cortexm4,  7EM, FL_CO_PROC |	      FL_FOR_ARCH7EM)
58
ARM_ARCH("ep9312",  ep9312,     4T,  FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4)
58
ARM_ARCH("ep9312",  ep9312,     4T,  FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4)
59
ARM_ARCH("iwmmxt",  iwmmxt,     5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
59
ARM_ARCH("iwmmxt",  iwmmxt,     5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
60
ARM_ARCH("iwmmxt2", iwmmxt2,    5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT)
60
ARM_ARCH("iwmmxt2", iwmmxt2,    5TE, FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2)
(-)gcc/config/arm/arm.c (-70 / +666 lines)
Lines 685-690 Link Here
685
#define FL_ARM_DIV    (1 << 23)	      /* Hardware divide (ARM mode).  */
685
#define FL_ARM_DIV    (1 << 23)	      /* Hardware divide (ARM mode).  */
686
686
687
#define FL_IWMMXT     (1 << 29)	      /* XScale v2 or "Intel Wireless MMX technology".  */
687
#define FL_IWMMXT     (1 << 29)	      /* XScale v2 or "Intel Wireless MMX technology".  */
688
#define FL_IWMMXT2    (1 << 30)       /* "Intel Wireless MMX2 technology".  */
688
689
689
/* Flags that only effect tuning, not available instructions.  */
690
/* Flags that only effect tuning, not available instructions.  */
690
#define FL_TUNE		(FL_WBUF | FL_VFPV2 | FL_STRONG | FL_LDSCHED \
691
#define FL_TUNE		(FL_WBUF | FL_VFPV2 | FL_STRONG | FL_LDSCHED \
Lines 766-771 Link Here
766
/* Nonzero if this chip supports Intel Wireless MMX technology.  */
767
/* Nonzero if this chip supports Intel Wireless MMX technology.  */
767
int arm_arch_iwmmxt = 0;
768
int arm_arch_iwmmxt = 0;
768
769
770
/* Nonzero if this chip supports Intel Wireless MMX2 technology.  */
771
int arm_arch_iwmmxt2 = 0;
772
769
/* Nonzero if this chip is an XScale.  */
773
/* Nonzero if this chip is an XScale.  */
770
int arm_arch_xscale = 0;
774
int arm_arch_xscale = 0;
771
775
Lines 1717-1722 Link Here
1717
  arm_tune_wbuf = (tune_flags & FL_WBUF) != 0;
1721
  arm_tune_wbuf = (tune_flags & FL_WBUF) != 0;
1718
  arm_tune_xscale = (tune_flags & FL_XSCALE) != 0;
1722
  arm_tune_xscale = (tune_flags & FL_XSCALE) != 0;
1719
  arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
1723
  arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
1724
  arm_arch_iwmmxt2 = (insn_flags & FL_IWMMXT2) != 0;
1720
  arm_arch_thumb_hwdiv = (insn_flags & FL_THUMB_DIV) != 0;
1725
  arm_arch_thumb_hwdiv = (insn_flags & FL_THUMB_DIV) != 0;
1721
  arm_arch_arm_hwdiv = (insn_flags & FL_ARM_DIV) != 0;
1726
  arm_arch_arm_hwdiv = (insn_flags & FL_ARM_DIV) != 0;
1722
  arm_tune_cortex_a9 = (arm_tune == cortexa9) != 0;
1727
  arm_tune_cortex_a9 = (arm_tune == cortexa9) != 0;
Lines 1817-1830 Link Here
1817
    }
1822
    }
1818
1823
1819
  /* FPA and iWMMXt are incompatible because the insn encodings overlap.
1824
  /* FPA and iWMMXt are incompatible because the insn encodings overlap.
1820
     VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon
1825
     VFP and iWMMXt however can coexist.  */
1821
     will ever exist.  GCC makes no attempt to support this combination.  */
1826
  if (TARGET_IWMMXT && TARGET_HARD_FLOAT && !TARGET_VFP)
1822
  if (TARGET_IWMMXT && !TARGET_SOFT_FLOAT)
1827
    error ("iWMMXt and non-VFP floating point unit are incompatible");
1823
    sorry ("iWMMXt and hardware floating point");
1828
1824
1829
  /* iWMMXt and NEON are incompatible.  */
1825
  /* ??? iWMMXt insn patterns need auditing for Thumb-2.  */
1830
  if (TARGET_IWMMXT && TARGET_NEON)
1826
  if (TARGET_THUMB2 && TARGET_IWMMXT)
1831
    error ("iWMMXt and NEON are incompatible");
1827
    sorry ("Thumb-2 iWMMXt");
1832
1833
  /* iWMMXt unsupported under Thumb mode.  */
1834
  if (TARGET_THUMB && TARGET_IWMMXT)
1835
    error ("iWMMXt unsupported under Thumb mode");
1828
1836
1829
  /* __fp16 support currently assumes the core has ldrh.  */
1837
  /* __fp16 support currently assumes the core has ldrh.  */
1830
  if (!arm_arch4 && arm_fp16_format != ARM_FP16_FORMAT_NONE)
1838
  if (!arm_arch4 && arm_fp16_format != ARM_FP16_FORMAT_NONE)
Lines 19269-19276 Link Here
19269
   FIXME?  */
19277
   FIXME?  */
19270
enum arm_builtins
19278
enum arm_builtins
19271
{
19279
{
19272
  ARM_BUILTIN_GETWCX,
19280
  ARM_BUILTIN_GETWCGR0,
19273
  ARM_BUILTIN_SETWCX,
19281
  ARM_BUILTIN_GETWCGR1,
19282
  ARM_BUILTIN_GETWCGR2,
19283
  ARM_BUILTIN_GETWCGR3,
19284
19285
  ARM_BUILTIN_SETWCGR0,
19286
  ARM_BUILTIN_SETWCGR1,
19287
  ARM_BUILTIN_SETWCGR2,
19288
  ARM_BUILTIN_SETWCGR3,
19274
19289
19275
  ARM_BUILTIN_WZERO,
19290
  ARM_BUILTIN_WZERO,
19276
19291
Lines 19293-19299 Link Here
19293
  ARM_BUILTIN_WSADH,
19308
  ARM_BUILTIN_WSADH,
19294
  ARM_BUILTIN_WSADHZ,
19309
  ARM_BUILTIN_WSADHZ,
19295
19310
19296
  ARM_BUILTIN_WALIGN,
19311
  ARM_BUILTIN_WALIGNI,
19312
  ARM_BUILTIN_WALIGNR0,
19313
  ARM_BUILTIN_WALIGNR1,
19314
  ARM_BUILTIN_WALIGNR2,
19315
  ARM_BUILTIN_WALIGNR3,
19297
19316
19298
  ARM_BUILTIN_TMIA,
19317
  ARM_BUILTIN_TMIA,
19299
  ARM_BUILTIN_TMIAPH,
19318
  ARM_BUILTIN_TMIAPH,
Lines 19429-19434 Link Here
19429
  ARM_BUILTIN_WUNPCKELUH,
19448
  ARM_BUILTIN_WUNPCKELUH,
19430
  ARM_BUILTIN_WUNPCKELUW,
19449
  ARM_BUILTIN_WUNPCKELUW,
19431
19450
19451
  ARM_BUILTIN_WABSB,
19452
  ARM_BUILTIN_WABSH,
19453
  ARM_BUILTIN_WABSW,
19454
19455
  ARM_BUILTIN_WADDSUBHX,
19456
  ARM_BUILTIN_WSUBADDHX,
19457
19458
  ARM_BUILTIN_WABSDIFFB,
19459
  ARM_BUILTIN_WABSDIFFH,
19460
  ARM_BUILTIN_WABSDIFFW,
19461
19462
  ARM_BUILTIN_WADDCH,
19463
  ARM_BUILTIN_WADDCW,
19464
19465
  ARM_BUILTIN_WAVG4,
19466
  ARM_BUILTIN_WAVG4R,
19467
19468
  ARM_BUILTIN_WMADDSX,
19469
  ARM_BUILTIN_WMADDUX,
19470
19471
  ARM_BUILTIN_WMADDSN,
19472
  ARM_BUILTIN_WMADDUN,
19473
19474
  ARM_BUILTIN_WMULWSM,
19475
  ARM_BUILTIN_WMULWUM,
19476
19477
  ARM_BUILTIN_WMULWSMR,
19478
  ARM_BUILTIN_WMULWUMR,
19479
19480
  ARM_BUILTIN_WMULWL,
19481
19482
  ARM_BUILTIN_WMULSMR,
19483
  ARM_BUILTIN_WMULUMR,
19484
19485
  ARM_BUILTIN_WQMULM,
19486
  ARM_BUILTIN_WQMULMR,
19487
19488
  ARM_BUILTIN_WQMULWM,
19489
  ARM_BUILTIN_WQMULWMR,
19490
19491
  ARM_BUILTIN_WADDBHUSM,
19492
  ARM_BUILTIN_WADDBHUSL,
19493
19494
  ARM_BUILTIN_WQMIABB,
19495
  ARM_BUILTIN_WQMIABT,
19496
  ARM_BUILTIN_WQMIATB,
19497
  ARM_BUILTIN_WQMIATT,
19498
19499
  ARM_BUILTIN_WQMIABBN,
19500
  ARM_BUILTIN_WQMIABTN,
19501
  ARM_BUILTIN_WQMIATBN,
19502
  ARM_BUILTIN_WQMIATTN,
19503
19504
  ARM_BUILTIN_WMIABB,
19505
  ARM_BUILTIN_WMIABT,
19506
  ARM_BUILTIN_WMIATB,
19507
  ARM_BUILTIN_WMIATT,
19508
19509
  ARM_BUILTIN_WMIABBN,
19510
  ARM_BUILTIN_WMIABTN,
19511
  ARM_BUILTIN_WMIATBN,
19512
  ARM_BUILTIN_WMIATTN,
19513
19514
  ARM_BUILTIN_WMIAWBB,
19515
  ARM_BUILTIN_WMIAWBT,
19516
  ARM_BUILTIN_WMIAWTB,
19517
  ARM_BUILTIN_WMIAWTT,
19518
19519
  ARM_BUILTIN_WMIAWBBN,
19520
  ARM_BUILTIN_WMIAWBTN,
19521
  ARM_BUILTIN_WMIAWTBN,
19522
  ARM_BUILTIN_WMIAWTTN,
19523
19524
  ARM_BUILTIN_WMERGE,
19525
19432
  ARM_BUILTIN_THREAD_POINTER,
19526
  ARM_BUILTIN_THREAD_POINTER,
19433
19527
19434
  ARM_BUILTIN_NEON_BASE,
19528
  ARM_BUILTIN_NEON_BASE,
Lines 19961-19966 Link Here
19961
  { FL_IWMMXT, CODE_FOR_##code, "__builtin_arm_" string, \
20055
  { FL_IWMMXT, CODE_FOR_##code, "__builtin_arm_" string, \
19962
    ARM_BUILTIN_##builtin, UNKNOWN, 0 },
20056
    ARM_BUILTIN_##builtin, UNKNOWN, 0 },
19963
20057
20058
#define IWMMXT2_BUILTIN(code, string, builtin) \
20059
  { FL_IWMMXT2, CODE_FOR_##code, "__builtin_arm_" string, \
20060
    ARM_BUILTIN_##builtin, UNKNOWN, 0 },
20061
19964
  IWMMXT_BUILTIN (addv8qi3, "waddb", WADDB)
20062
  IWMMXT_BUILTIN (addv8qi3, "waddb", WADDB)
19965
  IWMMXT_BUILTIN (addv4hi3, "waddh", WADDH)
20063
  IWMMXT_BUILTIN (addv4hi3, "waddh", WADDH)
19966
  IWMMXT_BUILTIN (addv2si3, "waddw", WADDW)
20064
  IWMMXT_BUILTIN (addv2si3, "waddw", WADDW)
Lines 20017-20060 Link Here
20017
  IWMMXT_BUILTIN (iwmmxt_wunpckihb, "wunpckihb", WUNPCKIHB)
20115
  IWMMXT_BUILTIN (iwmmxt_wunpckihb, "wunpckihb", WUNPCKIHB)
20018
  IWMMXT_BUILTIN (iwmmxt_wunpckihh, "wunpckihh", WUNPCKIHH)
20116
  IWMMXT_BUILTIN (iwmmxt_wunpckihh, "wunpckihh", WUNPCKIHH)
20019
  IWMMXT_BUILTIN (iwmmxt_wunpckihw, "wunpckihw", WUNPCKIHW)
20117
  IWMMXT_BUILTIN (iwmmxt_wunpckihw, "wunpckihw", WUNPCKIHW)
20020
  IWMMXT_BUILTIN (iwmmxt_wmadds, "wmadds", WMADDS)
20118
  IWMMXT2_BUILTIN (iwmmxt_waddsubhx, "waddsubhx", WADDSUBHX)
20021
  IWMMXT_BUILTIN (iwmmxt_wmaddu, "wmaddu", WMADDU)
20119
  IWMMXT2_BUILTIN (iwmmxt_wsubaddhx, "wsubaddhx", WSUBADDHX)
20120
  IWMMXT2_BUILTIN (iwmmxt_wabsdiffb, "wabsdiffb", WABSDIFFB)
20121
  IWMMXT2_BUILTIN (iwmmxt_wabsdiffh, "wabsdiffh", WABSDIFFH)
20122
  IWMMXT2_BUILTIN (iwmmxt_wabsdiffw, "wabsdiffw", WABSDIFFW)
20123
  IWMMXT2_BUILTIN (iwmmxt_avg4, "wavg4", WAVG4)
20124
  IWMMXT2_BUILTIN (iwmmxt_avg4r, "wavg4r", WAVG4R)
20125
  IWMMXT2_BUILTIN (iwmmxt_wmulwsm, "wmulwsm", WMULWSM)
20126
  IWMMXT2_BUILTIN (iwmmxt_wmulwum, "wmulwum", WMULWUM)
20127
  IWMMXT2_BUILTIN (iwmmxt_wmulwsmr, "wmulwsmr", WMULWSMR)
20128
  IWMMXT2_BUILTIN (iwmmxt_wmulwumr, "wmulwumr", WMULWUMR)
20129
  IWMMXT2_BUILTIN (iwmmxt_wmulwl, "wmulwl", WMULWL)
20130
  IWMMXT2_BUILTIN (iwmmxt_wmulsmr, "wmulsmr", WMULSMR)
20131
  IWMMXT2_BUILTIN (iwmmxt_wmulumr, "wmulumr", WMULUMR)
20132
  IWMMXT2_BUILTIN (iwmmxt_wqmulm, "wqmulm", WQMULM)
20133
  IWMMXT2_BUILTIN (iwmmxt_wqmulmr, "wqmulmr", WQMULMR)
20134
  IWMMXT2_BUILTIN (iwmmxt_wqmulwm, "wqmulwm", WQMULWM)
20135
  IWMMXT2_BUILTIN (iwmmxt_wqmulwmr, "wqmulwmr", WQMULWMR)
20136
  IWMMXT_BUILTIN (iwmmxt_walignr0, "walignr0", WALIGNR0)
20137
  IWMMXT_BUILTIN (iwmmxt_walignr1, "walignr1", WALIGNR1)
20138
  IWMMXT_BUILTIN (iwmmxt_walignr2, "walignr2", WALIGNR2)
20139
  IWMMXT_BUILTIN (iwmmxt_walignr3, "walignr3", WALIGNR3)
20022
20140
20023
#define IWMMXT_BUILTIN2(code, builtin) \
20141
#define IWMMXT_BUILTIN2(code, builtin) \
20024
  { FL_IWMMXT, CODE_FOR_##code, NULL, ARM_BUILTIN_##builtin, UNKNOWN, 0 },
20142
  { FL_IWMMXT, CODE_FOR_##code, NULL, ARM_BUILTIN_##builtin, UNKNOWN, 0 },
20025
20143
20144
#define IWMMXT2_BUILTIN2(code, builtin) \
20145
  { FL_IWMMXT2, CODE_FOR_##code, NULL, ARM_BUILTIN_##builtin, UNKNOWN, 0 },
20146
20147
  IWMMXT2_BUILTIN2 (iwmmxt_waddbhusm, WADDBHUSM)
20148
  IWMMXT2_BUILTIN2 (iwmmxt_waddbhusl, WADDBHUSL)
20026
  IWMMXT_BUILTIN2 (iwmmxt_wpackhss, WPACKHSS)
20149
  IWMMXT_BUILTIN2 (iwmmxt_wpackhss, WPACKHSS)
20027
  IWMMXT_BUILTIN2 (iwmmxt_wpackwss, WPACKWSS)
20150
  IWMMXT_BUILTIN2 (iwmmxt_wpackwss, WPACKWSS)
20028
  IWMMXT_BUILTIN2 (iwmmxt_wpackdss, WPACKDSS)
20151
  IWMMXT_BUILTIN2 (iwmmxt_wpackdss, WPACKDSS)
20029
  IWMMXT_BUILTIN2 (iwmmxt_wpackhus, WPACKHUS)
20152
  IWMMXT_BUILTIN2 (iwmmxt_wpackhus, WPACKHUS)
20030
  IWMMXT_BUILTIN2 (iwmmxt_wpackwus, WPACKWUS)
20153
  IWMMXT_BUILTIN2 (iwmmxt_wpackwus, WPACKWUS)
20031
  IWMMXT_BUILTIN2 (iwmmxt_wpackdus, WPACKDUS)
20154
  IWMMXT_BUILTIN2 (iwmmxt_wpackdus, WPACKDUS)
20032
  IWMMXT_BUILTIN2 (ashlv4hi3_di,    WSLLH)
20155
  IWMMXT_BUILTIN2 (iwmmxt_wmacuz, WMACUZ)
20033
  IWMMXT_BUILTIN2 (ashlv4hi3_iwmmxt, WSLLHI)
20156
  IWMMXT_BUILTIN2 (iwmmxt_wmacsz, WMACSZ)
20034
  IWMMXT_BUILTIN2 (ashlv2si3_di,    WSLLW)
20035
  IWMMXT_BUILTIN2 (ashlv2si3_iwmmxt, WSLLWI)
20036
  IWMMXT_BUILTIN2 (ashldi3_di,      WSLLD)
20037
  IWMMXT_BUILTIN2 (ashldi3_iwmmxt,  WSLLDI)
20038
  IWMMXT_BUILTIN2 (lshrv4hi3_di,    WSRLH)
20039
  IWMMXT_BUILTIN2 (lshrv4hi3_iwmmxt, WSRLHI)
20040
  IWMMXT_BUILTIN2 (lshrv2si3_di,    WSRLW)
20041
  IWMMXT_BUILTIN2 (lshrv2si3_iwmmxt, WSRLWI)
20042
  IWMMXT_BUILTIN2 (lshrdi3_di,      WSRLD)
20043
  IWMMXT_BUILTIN2 (lshrdi3_iwmmxt,  WSRLDI)
20044
  IWMMXT_BUILTIN2 (ashrv4hi3_di,    WSRAH)
20045
  IWMMXT_BUILTIN2 (ashrv4hi3_iwmmxt, WSRAHI)
20046
  IWMMXT_BUILTIN2 (ashrv2si3_di,    WSRAW)
20047
  IWMMXT_BUILTIN2 (ashrv2si3_iwmmxt, WSRAWI)
20048
  IWMMXT_BUILTIN2 (ashrdi3_di,      WSRAD)
20049
  IWMMXT_BUILTIN2 (ashrdi3_iwmmxt,  WSRADI)
20050
  IWMMXT_BUILTIN2 (rorv4hi3_di,     WRORH)
20051
  IWMMXT_BUILTIN2 (rorv4hi3,        WRORHI)
20052
  IWMMXT_BUILTIN2 (rorv2si3_di,     WRORW)
20053
  IWMMXT_BUILTIN2 (rorv2si3,        WRORWI)
20054
  IWMMXT_BUILTIN2 (rordi3_di,       WRORD)
20055
  IWMMXT_BUILTIN2 (rordi3,          WRORDI)
20056
  IWMMXT_BUILTIN2 (iwmmxt_wmacuz,   WMACUZ)
20057
  IWMMXT_BUILTIN2 (iwmmxt_wmacsz,   WMACSZ)
20058
};
20157
};
20059
20158
20060
static const struct builtin_description bdesc_1arg[] =
20159
static const struct builtin_description bdesc_1arg[] =
Lines 20077-20082 Link Here
20077
  IWMMXT_BUILTIN (iwmmxt_wunpckelsb, "wunpckelsb", WUNPCKELSB)
20176
  IWMMXT_BUILTIN (iwmmxt_wunpckelsb, "wunpckelsb", WUNPCKELSB)
20078
  IWMMXT_BUILTIN (iwmmxt_wunpckelsh, "wunpckelsh", WUNPCKELSH)
20177
  IWMMXT_BUILTIN (iwmmxt_wunpckelsh, "wunpckelsh", WUNPCKELSH)
20079
  IWMMXT_BUILTIN (iwmmxt_wunpckelsw, "wunpckelsw", WUNPCKELSW)
20178
  IWMMXT_BUILTIN (iwmmxt_wunpckelsw, "wunpckelsw", WUNPCKELSW)
20179
  IWMMXT2_BUILTIN (iwmmxt_wabsv8qi3, "wabsb", WABSB)
20180
  IWMMXT2_BUILTIN (iwmmxt_wabsv4hi3, "wabsh", WABSH)
20181
  IWMMXT2_BUILTIN (iwmmxt_wabsv2si3, "wabsw", WABSW)
20182
  IWMMXT_BUILTIN (tbcstv8qi, "tbcstb", TBCSTB)
20183
  IWMMXT_BUILTIN (tbcstv4hi, "tbcsth", TBCSTH)
20184
  IWMMXT_BUILTIN (tbcstv2si, "tbcstw", TBCSTW)
20080
};
20185
};
20081
20186
20082
/* Set up all the iWMMXt builtins.  This is not called if
20187
/* Set up all the iWMMXt builtins.  This is not called if
Lines 20092-20100 Link Here
20092
  tree V4HI_type_node = build_vector_type_for_mode (intHI_type_node, V4HImode);
20197
  tree V4HI_type_node = build_vector_type_for_mode (intHI_type_node, V4HImode);
20093
  tree V8QI_type_node = build_vector_type_for_mode (intQI_type_node, V8QImode);
20198
  tree V8QI_type_node = build_vector_type_for_mode (intQI_type_node, V8QImode);
20094
20199
20095
  tree int_ftype_int
20096
    = build_function_type_list (integer_type_node,
20097
				integer_type_node, NULL_TREE);
20098
  tree v8qi_ftype_v8qi_v8qi_int
20200
  tree v8qi_ftype_v8qi_v8qi_int
20099
    = build_function_type_list (V8QI_type_node,
20201
    = build_function_type_list (V8QI_type_node,
20100
				V8QI_type_node, V8QI_type_node,
20202
				V8QI_type_node, V8QI_type_node,
Lines 20156-20161 Link Here
20156
  tree v4hi_ftype_v2si_v2si
20258
  tree v4hi_ftype_v2si_v2si
20157
    = build_function_type_list (V4HI_type_node,
20259
    = build_function_type_list (V4HI_type_node,
20158
				V2SI_type_node, V2SI_type_node, NULL_TREE);
20260
				V2SI_type_node, V2SI_type_node, NULL_TREE);
20261
  tree v8qi_ftype_v4hi_v8qi
20262
    = build_function_type_list (V8QI_type_node,
20263
	                        V4HI_type_node, V8QI_type_node, NULL_TREE);
20159
  tree v2si_ftype_v4hi_v4hi
20264
  tree v2si_ftype_v4hi_v4hi
20160
    = build_function_type_list (V2SI_type_node,
20265
    = build_function_type_list (V2SI_type_node,
20161
				V4HI_type_node, V4HI_type_node, NULL_TREE);
20266
				V4HI_type_node, V4HI_type_node, NULL_TREE);
Lines 20170-20181 Link Here
20170
    = build_function_type_list (V2SI_type_node,
20275
    = build_function_type_list (V2SI_type_node,
20171
				V2SI_type_node, long_long_integer_type_node,
20276
				V2SI_type_node, long_long_integer_type_node,
20172
				NULL_TREE);
20277
				NULL_TREE);
20173
  tree void_ftype_int_int
20174
    = build_function_type_list (void_type_node,
20175
				integer_type_node, integer_type_node,
20176
				NULL_TREE);
20177
  tree di_ftype_void
20278
  tree di_ftype_void
20178
    = build_function_type_list (long_long_unsigned_type_node, NULL_TREE);
20279
    = build_function_type_list (long_long_unsigned_type_node, NULL_TREE);
20280
  tree int_ftype_void
20281
    = build_function_type_list (integer_type_node, NULL_TREE);
20179
  tree di_ftype_v8qi
20282
  tree di_ftype_v8qi
20180
    = build_function_type_list (long_long_integer_type_node,
20283
    = build_function_type_list (long_long_integer_type_node,
20181
				V8QI_type_node, NULL_TREE);
20284
				V8QI_type_node, NULL_TREE);
Lines 20191-20196 Link Here
20191
  tree v4hi_ftype_v8qi
20294
  tree v4hi_ftype_v8qi
20192
    = build_function_type_list (V4HI_type_node,
20295
    = build_function_type_list (V4HI_type_node,
20193
				V8QI_type_node, NULL_TREE);
20296
				V8QI_type_node, NULL_TREE);
20297
  tree v8qi_ftype_v8qi
20298
    = build_function_type_list (V8QI_type_node,
20299
	                        V8QI_type_node, NULL_TREE);
20300
  tree v4hi_ftype_v4hi
20301
    = build_function_type_list (V4HI_type_node,
20302
	                        V4HI_type_node, NULL_TREE);
20303
  tree v2si_ftype_v2si
20304
    = build_function_type_list (V2SI_type_node,
20305
	                        V2SI_type_node, NULL_TREE);
20194
20306
20195
  tree di_ftype_di_v4hi_v4hi
20307
  tree di_ftype_di_v4hi_v4hi
20196
    = build_function_type_list (long_long_unsigned_type_node,
20308
    = build_function_type_list (long_long_unsigned_type_node,
Lines 20203-20208 Link Here
20203
				V4HI_type_node,V4HI_type_node,
20315
				V4HI_type_node,V4HI_type_node,
20204
				NULL_TREE);
20316
				NULL_TREE);
20205
20317
20318
  tree v2si_ftype_v2si_v4hi_v4hi
20319
    = build_function_type_list (V2SI_type_node,
20320
                                V2SI_type_node, V4HI_type_node,
20321
                                V4HI_type_node, NULL_TREE);
20322
20323
  tree v2si_ftype_v2si_v8qi_v8qi
20324
    = build_function_type_list (V2SI_type_node,
20325
                                V2SI_type_node, V8QI_type_node,
20326
                                V8QI_type_node, NULL_TREE);
20327
20328
  tree di_ftype_di_v2si_v2si
20329
     = build_function_type_list (long_long_unsigned_type_node,
20330
                                 long_long_unsigned_type_node,
20331
                                 V2SI_type_node, V2SI_type_node,
20332
                                 NULL_TREE);
20333
20334
   tree di_ftype_di_di_int
20335
     = build_function_type_list (long_long_unsigned_type_node,
20336
                                 long_long_unsigned_type_node,
20337
                                 long_long_unsigned_type_node,
20338
                                 integer_type_node, NULL_TREE);
20339
20340
   tree void_ftype_void
20341
     = build_function_type_list (void_type_node,
20342
                                 NULL_TREE);
20343
20344
   tree void_ftype_int
20345
     = build_function_type_list (void_type_node,
20346
                                 integer_type_node, NULL_TREE);
20347
20348
   tree v8qi_ftype_char
20349
     = build_function_type_list (V8QI_type_node,
20350
                                 signed_char_type_node, NULL_TREE);
20351
20352
   tree v4hi_ftype_short
20353
     = build_function_type_list (V4HI_type_node,
20354
                                 short_integer_type_node, NULL_TREE);
20355
20356
   tree v2si_ftype_int
20357
     = build_function_type_list (V2SI_type_node,
20358
                                 integer_type_node, NULL_TREE);
20359
20206
  /* Normal vector binops.  */
20360
  /* Normal vector binops.  */
20207
  tree v8qi_ftype_v8qi_v8qi
20361
  tree v8qi_ftype_v8qi_v8qi
20208
    = build_function_type_list (V8QI_type_node,
20362
    = build_function_type_list (V8QI_type_node,
Lines 20260-20268 Link Here
20260
  def_mbuiltin (FL_IWMMXT, "__builtin_arm_" NAME, (TYPE),	\
20414
  def_mbuiltin (FL_IWMMXT, "__builtin_arm_" NAME, (TYPE),	\
20261
		ARM_BUILTIN_ ## CODE)
20415
		ARM_BUILTIN_ ## CODE)
20262
20416
20417
#define iwmmx2_mbuiltin(NAME, TYPE, CODE)                      \
20418
  def_mbuiltin (FL_IWMMXT2, "__builtin_arm_" NAME, (TYPE),     \
20419
               ARM_BUILTIN_ ## CODE)
20420
20263
  iwmmx_mbuiltin ("wzero", di_ftype_void, WZERO);
20421
  iwmmx_mbuiltin ("wzero", di_ftype_void, WZERO);
20264
  iwmmx_mbuiltin ("setwcx", void_ftype_int_int, SETWCX);
20422
  iwmmx_mbuiltin ("setwcgr0", void_ftype_int, SETWCGR0);
20265
  iwmmx_mbuiltin ("getwcx", int_ftype_int, GETWCX);
20423
  iwmmx_mbuiltin ("setwcgr1", void_ftype_int, SETWCGR1);
20424
  iwmmx_mbuiltin ("setwcgr2", void_ftype_int, SETWCGR2);
20425
  iwmmx_mbuiltin ("setwcgr3", void_ftype_int, SETWCGR3);
20426
  iwmmx_mbuiltin ("getwcgr0", int_ftype_void, GETWCGR0);
20427
  iwmmx_mbuiltin ("getwcgr1", int_ftype_void, GETWCGR1);
20428
  iwmmx_mbuiltin ("getwcgr2", int_ftype_void, GETWCGR2);
20429
  iwmmx_mbuiltin ("getwcgr3", int_ftype_void, GETWCGR3);
20266
20430
20267
  iwmmx_mbuiltin ("wsllh", v4hi_ftype_v4hi_di, WSLLH);
20431
  iwmmx_mbuiltin ("wsllh", v4hi_ftype_v4hi_di, WSLLH);
20268
  iwmmx_mbuiltin ("wsllw", v2si_ftype_v2si_di, WSLLW);
20432
  iwmmx_mbuiltin ("wsllw", v2si_ftype_v2si_di, WSLLW);
Lines 20294-20301 Link Here
20294
20458
20295
  iwmmx_mbuiltin ("wshufh", v4hi_ftype_v4hi_int, WSHUFH);
20459
  iwmmx_mbuiltin ("wshufh", v4hi_ftype_v4hi_int, WSHUFH);
20296
20460
20297
  iwmmx_mbuiltin ("wsadb", v2si_ftype_v8qi_v8qi, WSADB);
20461
  iwmmx_mbuiltin ("wsadb", v2si_ftype_v2si_v8qi_v8qi, WSADB);
20298
  iwmmx_mbuiltin ("wsadh", v2si_ftype_v4hi_v4hi, WSADH);
20462
  iwmmx_mbuiltin ("wsadh", v2si_ftype_v2si_v4hi_v4hi, WSADH);
20463
  iwmmx_mbuiltin ("wmadds", v2si_ftype_v4hi_v4hi, WMADDS);
20464
  iwmmx2_mbuiltin ("wmaddsx", v2si_ftype_v4hi_v4hi, WMADDSX);
20465
  iwmmx2_mbuiltin ("wmaddsn", v2si_ftype_v4hi_v4hi, WMADDSN);
20466
  iwmmx_mbuiltin ("wmaddu", v2si_ftype_v4hi_v4hi, WMADDU);
20467
  iwmmx2_mbuiltin ("wmaddux", v2si_ftype_v4hi_v4hi, WMADDUX);
20468
  iwmmx2_mbuiltin ("wmaddun", v2si_ftype_v4hi_v4hi, WMADDUN);
20299
  iwmmx_mbuiltin ("wsadbz", v2si_ftype_v8qi_v8qi, WSADBZ);
20469
  iwmmx_mbuiltin ("wsadbz", v2si_ftype_v8qi_v8qi, WSADBZ);
20300
  iwmmx_mbuiltin ("wsadhz", v2si_ftype_v4hi_v4hi, WSADHZ);
20470
  iwmmx_mbuiltin ("wsadhz", v2si_ftype_v4hi_v4hi, WSADHZ);
20301
20471
Lines 20317-20322 Link Here
20317
  iwmmx_mbuiltin ("tmovmskh", int_ftype_v4hi, TMOVMSKH);
20487
  iwmmx_mbuiltin ("tmovmskh", int_ftype_v4hi, TMOVMSKH);
20318
  iwmmx_mbuiltin ("tmovmskw", int_ftype_v2si, TMOVMSKW);
20488
  iwmmx_mbuiltin ("tmovmskw", int_ftype_v2si, TMOVMSKW);
20319
20489
20490
  iwmmx2_mbuiltin ("waddbhusm", v8qi_ftype_v4hi_v8qi, WADDBHUSM);
20491
  iwmmx2_mbuiltin ("waddbhusl", v8qi_ftype_v4hi_v8qi, WADDBHUSL);
20492
20320
  iwmmx_mbuiltin ("wpackhss", v8qi_ftype_v4hi_v4hi, WPACKHSS);
20493
  iwmmx_mbuiltin ("wpackhss", v8qi_ftype_v4hi_v4hi, WPACKHSS);
20321
  iwmmx_mbuiltin ("wpackhus", v8qi_ftype_v4hi_v4hi, WPACKHUS);
20494
  iwmmx_mbuiltin ("wpackhus", v8qi_ftype_v4hi_v4hi, WPACKHUS);
20322
  iwmmx_mbuiltin ("wpackwus", v4hi_ftype_v2si_v2si, WPACKWUS);
20495
  iwmmx_mbuiltin ("wpackwus", v4hi_ftype_v2si_v2si, WPACKWUS);
Lines 20342-20348 Link Here
20342
  iwmmx_mbuiltin ("wmacu", di_ftype_di_v4hi_v4hi, WMACU);
20515
  iwmmx_mbuiltin ("wmacu", di_ftype_di_v4hi_v4hi, WMACU);
20343
  iwmmx_mbuiltin ("wmacuz", di_ftype_v4hi_v4hi, WMACUZ);
20516
  iwmmx_mbuiltin ("wmacuz", di_ftype_v4hi_v4hi, WMACUZ);
20344
20517
20345
  iwmmx_mbuiltin ("walign", v8qi_ftype_v8qi_v8qi_int, WALIGN);
20518
  iwmmx_mbuiltin ("walign", v8qi_ftype_v8qi_v8qi_int, WALIGNI);
20346
  iwmmx_mbuiltin ("tmia", di_ftype_di_int_int, TMIA);
20519
  iwmmx_mbuiltin ("tmia", di_ftype_di_int_int, TMIA);
20347
  iwmmx_mbuiltin ("tmiaph", di_ftype_di_int_int, TMIAPH);
20520
  iwmmx_mbuiltin ("tmiaph", di_ftype_di_int_int, TMIAPH);
20348
  iwmmx_mbuiltin ("tmiabb", di_ftype_di_int_int, TMIABB);
20521
  iwmmx_mbuiltin ("tmiabb", di_ftype_di_int_int, TMIABB);
Lines 20350-20356 Link Here
20350
  iwmmx_mbuiltin ("tmiatb", di_ftype_di_int_int, TMIATB);
20523
  iwmmx_mbuiltin ("tmiatb", di_ftype_di_int_int, TMIATB);
20351
  iwmmx_mbuiltin ("tmiatt", di_ftype_di_int_int, TMIATT);
20524
  iwmmx_mbuiltin ("tmiatt", di_ftype_di_int_int, TMIATT);
20352
20525
20526
  iwmmx2_mbuiltin ("wabsb", v8qi_ftype_v8qi, WABSB);
20527
  iwmmx2_mbuiltin ("wabsh", v4hi_ftype_v4hi, WABSH);
20528
  iwmmx2_mbuiltin ("wabsw", v2si_ftype_v2si, WABSW);
20529
20530
  iwmmx2_mbuiltin ("wqmiabb", v2si_ftype_v2si_v4hi_v4hi, WQMIABB);
20531
  iwmmx2_mbuiltin ("wqmiabt", v2si_ftype_v2si_v4hi_v4hi, WQMIABT);
20532
  iwmmx2_mbuiltin ("wqmiatb", v2si_ftype_v2si_v4hi_v4hi, WQMIATB);
20533
  iwmmx2_mbuiltin ("wqmiatt", v2si_ftype_v2si_v4hi_v4hi, WQMIATT);
20534
20535
  iwmmx2_mbuiltin ("wqmiabbn", v2si_ftype_v2si_v4hi_v4hi, WQMIABBN);
20536
  iwmmx2_mbuiltin ("wqmiabtn", v2si_ftype_v2si_v4hi_v4hi, WQMIABTN);
20537
  iwmmx2_mbuiltin ("wqmiatbn", v2si_ftype_v2si_v4hi_v4hi, WQMIATBN);
20538
  iwmmx2_mbuiltin ("wqmiattn", v2si_ftype_v2si_v4hi_v4hi, WQMIATTN);
20539
20540
  iwmmx2_mbuiltin ("wmiabb", di_ftype_di_v4hi_v4hi, WMIABB);
20541
  iwmmx2_mbuiltin ("wmiabt", di_ftype_di_v4hi_v4hi, WMIABT);
20542
  iwmmx2_mbuiltin ("wmiatb", di_ftype_di_v4hi_v4hi, WMIATB);
20543
  iwmmx2_mbuiltin ("wmiatt", di_ftype_di_v4hi_v4hi, WMIATT);
20544
20545
  iwmmx2_mbuiltin ("wmiabbn", di_ftype_di_v4hi_v4hi, WMIABBN);
20546
  iwmmx2_mbuiltin ("wmiabtn", di_ftype_di_v4hi_v4hi, WMIABTN);
20547
  iwmmx2_mbuiltin ("wmiatbn", di_ftype_di_v4hi_v4hi, WMIATBN);
20548
  iwmmx2_mbuiltin ("wmiattn", di_ftype_di_v4hi_v4hi, WMIATTN);
20549
20550
  iwmmx2_mbuiltin ("wmiawbb", di_ftype_di_v2si_v2si, WMIAWBB);
20551
  iwmmx2_mbuiltin ("wmiawbt", di_ftype_di_v2si_v2si, WMIAWBT);
20552
  iwmmx2_mbuiltin ("wmiawtb", di_ftype_di_v2si_v2si, WMIAWTB);
20553
  iwmmx2_mbuiltin ("wmiawtt", di_ftype_di_v2si_v2si, WMIAWTT);
20554
20555
  iwmmx2_mbuiltin ("wmiawbbn", di_ftype_di_v2si_v2si, WMIAWBBN);
20556
  iwmmx2_mbuiltin ("wmiawbtn", di_ftype_di_v2si_v2si, WMIAWBTN);
20557
  iwmmx2_mbuiltin ("wmiawtbn", di_ftype_di_v2si_v2si, WMIAWTBN);
20558
  iwmmx2_mbuiltin ("wmiawttn", di_ftype_di_v2si_v2si, WMIAWTTN);
20559
20560
  iwmmx2_mbuiltin ("wmerge", di_ftype_di_di_int, WMERGE);
20561
20562
  iwmmx_mbuiltin ("tbcstb", v8qi_ftype_char, TBCSTB);
20563
  iwmmx_mbuiltin ("tbcsth", v4hi_ftype_short, TBCSTH);
20564
  iwmmx_mbuiltin ("tbcstw", v2si_ftype_int, TBCSTW);
20565
20353
#undef iwmmx_mbuiltin
20566
#undef iwmmx_mbuiltin
20567
#undef iwmmx2_mbuiltin
20354
}
20568
}
20355
20569
20356
static void
20570
static void
Lines 20507-20513 Link Here
20507
      || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
20721
      || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
20508
    target = gen_reg_rtx (tmode);
20722
    target = gen_reg_rtx (tmode);
20509
20723
20510
  gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1);
20724
  gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode)
20725
	      && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode));
20511
20726
20512
  if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
20727
  if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
20513
    op0 = copy_to_mode_reg (mode0, op0);
20728
    op0 = copy_to_mode_reg (mode0, op0);
Lines 21015-21020 Link Here
21015
  enum machine_mode mode0;
21230
  enum machine_mode mode0;
21016
  enum machine_mode mode1;
21231
  enum machine_mode mode1;
21017
  enum machine_mode mode2;
21232
  enum machine_mode mode2;
21233
  int opint;
21234
  int selector;
21235
  int mask;
21236
  int imm;
21018
21237
21019
  if (fcode >= ARM_BUILTIN_NEON_BASE)
21238
  if (fcode >= ARM_BUILTIN_NEON_BASE)
21020
    return arm_expand_neon_builtin (fcode, exp, target);
21239
    return arm_expand_neon_builtin (fcode, exp, target);
Lines 21049-21054 Link Here
21049
	  error ("selector must be an immediate");
21268
	  error ("selector must be an immediate");
21050
	  return gen_reg_rtx (tmode);
21269
	  return gen_reg_rtx (tmode);
21051
	}
21270
	}
21271
21272
      opint = INTVAL (op1);
21273
      if (fcode == ARM_BUILTIN_TEXTRMSB || fcode == ARM_BUILTIN_TEXTRMUB)
21274
	{
21275
	  if (opint > 7 || opint < 0)
21276
	    error ("the range of selector should be in 0 to 7");
21277
	}
21278
      else if (fcode == ARM_BUILTIN_TEXTRMSH || fcode == ARM_BUILTIN_TEXTRMUH)
21279
	{
21280
	  if (opint > 3 || opint < 0)
21281
	    error ("the range of selector should be in 0 to 3");
21282
	}
21283
      else /* ARM_BUILTIN_TEXTRMSW || ARM_BUILTIN_TEXTRMUW.  */
21284
	{
21285
	  if (opint > 1 || opint < 0)
21286
	    error ("the range of selector should be in 0 to 1");
21287
	}
21288
21052
      if (target == 0
21289
      if (target == 0
21053
	  || GET_MODE (target) != tmode
21290
	  || GET_MODE (target) != tmode
21054
	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
21291
	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
Lines 21059-21069 Link Here
21059
      emit_insn (pat);
21296
      emit_insn (pat);
21060
      return target;
21297
      return target;
21061
21298
21299
    case ARM_BUILTIN_WALIGNI:
21300
      /* If op2 is immediate, call walighi, else call walighr.  */
21301
      arg0 = CALL_EXPR_ARG (exp, 0);
21302
      arg1 = CALL_EXPR_ARG (exp, 1);
21303
      arg2 = CALL_EXPR_ARG (exp, 2);
21304
      op0 = expand_normal (arg0);
21305
      op1 = expand_normal (arg1);
21306
      op2 = expand_normal (arg2);
21307
      if (GET_CODE (op2) == CONST_INT)
21308
        {
21309
	  icode = CODE_FOR_iwmmxt_waligni;
21310
          tmode = insn_data[icode].operand[0].mode;
21311
	  mode0 = insn_data[icode].operand[1].mode;
21312
	  mode1 = insn_data[icode].operand[2].mode;
21313
	  mode2 = insn_data[icode].operand[3].mode;
21314
          if (!(*insn_data[icode].operand[1].predicate) (op0, mode0))
21315
	    op0 = copy_to_mode_reg (mode0, op0);
21316
          if (!(*insn_data[icode].operand[2].predicate) (op1, mode1))
21317
	    op1 = copy_to_mode_reg (mode1, op1);
21318
          gcc_assert ((*insn_data[icode].operand[3].predicate) (op2, mode2));
21319
	  selector = INTVAL (op2);
21320
	  if (selector > 7 || selector < 0)
21321
	    error ("the range of selector should be in 0 to 7");
21322
	}
21323
      else
21324
        {
21325
	  icode = CODE_FOR_iwmmxt_walignr;
21326
          tmode = insn_data[icode].operand[0].mode;
21327
	  mode0 = insn_data[icode].operand[1].mode;
21328
	  mode1 = insn_data[icode].operand[2].mode;
21329
	  mode2 = insn_data[icode].operand[3].mode;
21330
          if (!(*insn_data[icode].operand[1].predicate) (op0, mode0))
21331
	    op0 = copy_to_mode_reg (mode0, op0);
21332
          if (!(*insn_data[icode].operand[2].predicate) (op1, mode1))
21333
	    op1 = copy_to_mode_reg (mode1, op1);
21334
          if (!(*insn_data[icode].operand[3].predicate) (op2, mode2))
21335
	    op2 = copy_to_mode_reg (mode2, op2);
21336
	}
21337
      if (target == 0
21338
	  || GET_MODE (target) != tmode
21339
	  || !(*insn_data[icode].operand[0].predicate) (target, tmode))
21340
	target = gen_reg_rtx (tmode);
21341
      pat = GEN_FCN (icode) (target, op0, op1, op2);
21342
      if (!pat)
21343
	return 0;
21344
      emit_insn (pat);
21345
      return target;
21346
21062
    case ARM_BUILTIN_TINSRB:
21347
    case ARM_BUILTIN_TINSRB:
21063
    case ARM_BUILTIN_TINSRH:
21348
    case ARM_BUILTIN_TINSRH:
21064
    case ARM_BUILTIN_TINSRW:
21349
    case ARM_BUILTIN_TINSRW:
21350
    case ARM_BUILTIN_WMERGE:
21065
      icode = (fcode == ARM_BUILTIN_TINSRB ? CODE_FOR_iwmmxt_tinsrb
21351
      icode = (fcode == ARM_BUILTIN_TINSRB ? CODE_FOR_iwmmxt_tinsrb
21066
	       : fcode == ARM_BUILTIN_TINSRH ? CODE_FOR_iwmmxt_tinsrh
21352
	       : fcode == ARM_BUILTIN_TINSRH ? CODE_FOR_iwmmxt_tinsrh
21353
	       : fcode == ARM_BUILTIN_WMERGE ? CODE_FOR_iwmmxt_wmerge
21067
	       : CODE_FOR_iwmmxt_tinsrw);
21354
	       : CODE_FOR_iwmmxt_tinsrw);
21068
      arg0 = CALL_EXPR_ARG (exp, 0);
21355
      arg0 = CALL_EXPR_ARG (exp, 0);
21069
      arg1 = CALL_EXPR_ARG (exp, 1);
21356
      arg1 = CALL_EXPR_ARG (exp, 1);
Lines 21082-21091 Link Here
21082
	op1 = copy_to_mode_reg (mode1, op1);
21369
	op1 = copy_to_mode_reg (mode1, op1);
21083
      if (! (*insn_data[icode].operand[3].predicate) (op2, mode2))
21370
      if (! (*insn_data[icode].operand[3].predicate) (op2, mode2))
21084
	{
21371
	{
21085
	  /* @@@ better error message */
21086
	  error ("selector must be an immediate");
21372
	  error ("selector must be an immediate");
21087
	  return const0_rtx;
21373
	  return const0_rtx;
21088
	}
21374
	}
21375
      if (icode == CODE_FOR_iwmmxt_wmerge)
21376
	{
21377
	  selector = INTVAL (op2);
21378
	  if (selector > 7 || selector < 0)
21379
	    error ("the range of selector should be in 0 to 7");
21380
	}
21381
      if ((icode == CODE_FOR_iwmmxt_tinsrb)
21382
	  || (icode == CODE_FOR_iwmmxt_tinsrh)
21383
	  || (icode == CODE_FOR_iwmmxt_tinsrw))
21384
        {
21385
	  mask = 0x01;
21386
	  selector= INTVAL (op2);
21387
	  if (icode == CODE_FOR_iwmmxt_tinsrb && (selector < 0 || selector > 7))
21388
	    error ("the range of selector should be in 0 to 7");
21389
	  else if (icode == CODE_FOR_iwmmxt_tinsrh && (selector < 0 ||selector > 3))
21390
	    error ("the range of selector should be in 0 to 3");
21391
	  else if (icode == CODE_FOR_iwmmxt_tinsrw && (selector < 0 ||selector > 1))
21392
	    error ("the range of selector should be in 0 to 1");
21393
	  mask <<= selector;
21394
	  op2 = gen_rtx_CONST_INT (SImode, mask);
21395
	}
21089
      if (target == 0
21396
      if (target == 0
21090
	  || GET_MODE (target) != tmode
21397
	  || GET_MODE (target) != tmode
21091
	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
21398
	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
Lines 21096-21114 Link Here
21096
      emit_insn (pat);
21403
      emit_insn (pat);
21097
      return target;
21404
      return target;
21098
21405
21099
    case ARM_BUILTIN_SETWCX:
21406
    case ARM_BUILTIN_SETWCGR0:
21407
    case ARM_BUILTIN_SETWCGR1:
21408
    case ARM_BUILTIN_SETWCGR2:
21409
    case ARM_BUILTIN_SETWCGR3:
21410
      icode = (fcode == ARM_BUILTIN_SETWCGR0 ? CODE_FOR_iwmmxt_setwcgr0
21411
	       : fcode == ARM_BUILTIN_SETWCGR1 ? CODE_FOR_iwmmxt_setwcgr1
21412
	       : fcode == ARM_BUILTIN_SETWCGR2 ? CODE_FOR_iwmmxt_setwcgr2
21413
	       : CODE_FOR_iwmmxt_setwcgr3);
21100
      arg0 = CALL_EXPR_ARG (exp, 0);
21414
      arg0 = CALL_EXPR_ARG (exp, 0);
21101
      arg1 = CALL_EXPR_ARG (exp, 1);
21415
      op0 = expand_normal (arg0);
21102
      op0 = force_reg (SImode, expand_normal (arg0));
21416
      mode0 = insn_data[icode].operand[0].mode;
21103
      op1 = expand_normal (arg1);
21417
      if (!(*insn_data[icode].operand[0].predicate) (op0, mode0))
21104
      emit_insn (gen_iwmmxt_tmcr (op1, op0));
21418
        op0 = copy_to_mode_reg (mode0, op0);
21419
      pat = GEN_FCN (icode) (op0);
21420
      if (!pat)
21421
	return 0;
21422
      emit_insn (pat);
21105
      return 0;
21423
      return 0;
21106
21424
21107
    case ARM_BUILTIN_GETWCX:
21425
    case ARM_BUILTIN_GETWCGR0:
21108
      arg0 = CALL_EXPR_ARG (exp, 0);
21426
    case ARM_BUILTIN_GETWCGR1:
21109
      op0 = expand_normal (arg0);
21427
    case ARM_BUILTIN_GETWCGR2:
21110
      target = gen_reg_rtx (SImode);
21428
    case ARM_BUILTIN_GETWCGR3:
21111
      emit_insn (gen_iwmmxt_tmrc (target, op0));
21429
      icode = (fcode == ARM_BUILTIN_GETWCGR0 ? CODE_FOR_iwmmxt_getwcgr0
21430
	       : fcode == ARM_BUILTIN_GETWCGR1 ? CODE_FOR_iwmmxt_getwcgr1
21431
	       : fcode == ARM_BUILTIN_GETWCGR2 ? CODE_FOR_iwmmxt_getwcgr2
21432
	       : CODE_FOR_iwmmxt_getwcgr3);
21433
      tmode = insn_data[icode].operand[0].mode;
21434
      if (target == 0
21435
	  || GET_MODE (target) != tmode
21436
	  || !(*insn_data[icode].operand[0].predicate) (target, tmode))
21437
        target = gen_reg_rtx (tmode);
21438
      pat = GEN_FCN (icode) (target);
21439
      if (!pat)
21440
        return 0;
21441
      emit_insn (pat);
21112
      return target;
21442
      return target;
21113
21443
21114
    case ARM_BUILTIN_WSHUFH:
21444
    case ARM_BUILTIN_WSHUFH:
Lines 21125-21134 Link Here
21125
	op0 = copy_to_mode_reg (mode1, op0);
21455
	op0 = copy_to_mode_reg (mode1, op0);
21126
      if (! (*insn_data[icode].operand[2].predicate) (op1, mode2))
21456
      if (! (*insn_data[icode].operand[2].predicate) (op1, mode2))
21127
	{
21457
	{
21128
	  /* @@@ better error message */
21129
	  error ("mask must be an immediate");
21458
	  error ("mask must be an immediate");
21130
	  return const0_rtx;
21459
	  return const0_rtx;
21131
	}
21460
	}
21461
      selector = INTVAL (op1);
21462
      if (selector < 0 || selector > 255)
21463
	error ("the range of mask should be in 0 to 255");
21132
      if (target == 0
21464
      if (target == 0
21133
	  || GET_MODE (target) != tmode
21465
	  || GET_MODE (target) != tmode
21134
	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
21466
	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
Lines 21139-21148 Link Here
21139
      emit_insn (pat);
21471
      emit_insn (pat);
21140
      return target;
21472
      return target;
21141
21473
21142
    case ARM_BUILTIN_WSADB:
21474
    case ARM_BUILTIN_WMADDS:
21143
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadb, exp, target);
21475
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmadds, exp, target);
21144
    case ARM_BUILTIN_WSADH:
21476
    case ARM_BUILTIN_WMADDSX:
21145
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadh, exp, target);
21477
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddsx, exp, target);
21478
    case ARM_BUILTIN_WMADDSN:
21479
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddsn, exp, target);
21480
    case ARM_BUILTIN_WMADDU:
21481
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddu, exp, target);
21482
    case ARM_BUILTIN_WMADDUX:
21483
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddux, exp, target);
21484
    case ARM_BUILTIN_WMADDUN:
21485
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddun, exp, target);
21146
    case ARM_BUILTIN_WSADBZ:
21486
    case ARM_BUILTIN_WSADBZ:
21147
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadbz, exp, target);
21487
      return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadbz, exp, target);
21148
    case ARM_BUILTIN_WSADHZ:
21488
    case ARM_BUILTIN_WSADHZ:
Lines 21151-21163 Link Here
21151
      /* Several three-argument builtins.  */
21491
      /* Several three-argument builtins.  */
21152
    case ARM_BUILTIN_WMACS:
21492
    case ARM_BUILTIN_WMACS:
21153
    case ARM_BUILTIN_WMACU:
21493
    case ARM_BUILTIN_WMACU:
21154
    case ARM_BUILTIN_WALIGN:
21155
    case ARM_BUILTIN_TMIA:
21494
    case ARM_BUILTIN_TMIA:
21156
    case ARM_BUILTIN_TMIAPH:
21495
    case ARM_BUILTIN_TMIAPH:
21157
    case ARM_BUILTIN_TMIATT:
21496
    case ARM_BUILTIN_TMIATT:
21158
    case ARM_BUILTIN_TMIATB:
21497
    case ARM_BUILTIN_TMIATB:
21159
    case ARM_BUILTIN_TMIABT:
21498
    case ARM_BUILTIN_TMIABT:
21160
    case ARM_BUILTIN_TMIABB:
21499
    case ARM_BUILTIN_TMIABB:
21500
    case ARM_BUILTIN_WQMIABB:
21501
    case ARM_BUILTIN_WQMIABT:
21502
    case ARM_BUILTIN_WQMIATB:
21503
    case ARM_BUILTIN_WQMIATT:
21504
    case ARM_BUILTIN_WQMIABBN:
21505
    case ARM_BUILTIN_WQMIABTN:
21506
    case ARM_BUILTIN_WQMIATBN:
21507
    case ARM_BUILTIN_WQMIATTN:
21508
    case ARM_BUILTIN_WMIABB:
21509
    case ARM_BUILTIN_WMIABT:
21510
    case ARM_BUILTIN_WMIATB:
21511
    case ARM_BUILTIN_WMIATT:
21512
    case ARM_BUILTIN_WMIABBN:
21513
    case ARM_BUILTIN_WMIABTN:
21514
    case ARM_BUILTIN_WMIATBN:
21515
    case ARM_BUILTIN_WMIATTN:
21516
    case ARM_BUILTIN_WMIAWBB:
21517
    case ARM_BUILTIN_WMIAWBT:
21518
    case ARM_BUILTIN_WMIAWTB:
21519
    case ARM_BUILTIN_WMIAWTT:
21520
    case ARM_BUILTIN_WMIAWBBN:
21521
    case ARM_BUILTIN_WMIAWBTN:
21522
    case ARM_BUILTIN_WMIAWTBN:
21523
    case ARM_BUILTIN_WMIAWTTN:
21524
    case ARM_BUILTIN_WSADB:
21525
    case ARM_BUILTIN_WSADH:
21161
      icode = (fcode == ARM_BUILTIN_WMACS ? CODE_FOR_iwmmxt_wmacs
21526
      icode = (fcode == ARM_BUILTIN_WMACS ? CODE_FOR_iwmmxt_wmacs
21162
	       : fcode == ARM_BUILTIN_WMACU ? CODE_FOR_iwmmxt_wmacu
21527
	       : fcode == ARM_BUILTIN_WMACU ? CODE_FOR_iwmmxt_wmacu
21163
	       : fcode == ARM_BUILTIN_TMIA ? CODE_FOR_iwmmxt_tmia
21528
	       : fcode == ARM_BUILTIN_TMIA ? CODE_FOR_iwmmxt_tmia
Lines 21166-21172 Link Here
21166
	       : fcode == ARM_BUILTIN_TMIABT ? CODE_FOR_iwmmxt_tmiabt
21531
	       : fcode == ARM_BUILTIN_TMIABT ? CODE_FOR_iwmmxt_tmiabt
21167
	       : fcode == ARM_BUILTIN_TMIATB ? CODE_FOR_iwmmxt_tmiatb
21532
	       : fcode == ARM_BUILTIN_TMIATB ? CODE_FOR_iwmmxt_tmiatb
21168
	       : fcode == ARM_BUILTIN_TMIATT ? CODE_FOR_iwmmxt_tmiatt
21533
	       : fcode == ARM_BUILTIN_TMIATT ? CODE_FOR_iwmmxt_tmiatt
21169
	       : CODE_FOR_iwmmxt_walign);
21534
	       : fcode == ARM_BUILTIN_WQMIABB ? CODE_FOR_iwmmxt_wqmiabb
21535
	       : fcode == ARM_BUILTIN_WQMIABT ? CODE_FOR_iwmmxt_wqmiabt
21536
	       : fcode == ARM_BUILTIN_WQMIATB ? CODE_FOR_iwmmxt_wqmiatb
21537
	       : fcode == ARM_BUILTIN_WQMIATT ? CODE_FOR_iwmmxt_wqmiatt
21538
	       : fcode == ARM_BUILTIN_WQMIABBN ? CODE_FOR_iwmmxt_wqmiabbn
21539
	       : fcode == ARM_BUILTIN_WQMIABTN ? CODE_FOR_iwmmxt_wqmiabtn
21540
	       : fcode == ARM_BUILTIN_WQMIATBN ? CODE_FOR_iwmmxt_wqmiatbn
21541
	       : fcode == ARM_BUILTIN_WQMIATTN ? CODE_FOR_iwmmxt_wqmiattn
21542
	       : fcode == ARM_BUILTIN_WMIABB ? CODE_FOR_iwmmxt_wmiabb
21543
	       : fcode == ARM_BUILTIN_WMIABT ? CODE_FOR_iwmmxt_wmiabt
21544
	       : fcode == ARM_BUILTIN_WMIATB ? CODE_FOR_iwmmxt_wmiatb
21545
	       : fcode == ARM_BUILTIN_WMIATT ? CODE_FOR_iwmmxt_wmiatt
21546
	       : fcode == ARM_BUILTIN_WMIABBN ? CODE_FOR_iwmmxt_wmiabbn
21547
	       : fcode == ARM_BUILTIN_WMIABTN ? CODE_FOR_iwmmxt_wmiabtn
21548
	       : fcode == ARM_BUILTIN_WMIATBN ? CODE_FOR_iwmmxt_wmiatbn
21549
	       : fcode == ARM_BUILTIN_WMIATTN ? CODE_FOR_iwmmxt_wmiattn
21550
	       : fcode == ARM_BUILTIN_WMIAWBB ? CODE_FOR_iwmmxt_wmiawbb
21551
	       : fcode == ARM_BUILTIN_WMIAWBT ? CODE_FOR_iwmmxt_wmiawbt
21552
	       : fcode == ARM_BUILTIN_WMIAWTB ? CODE_FOR_iwmmxt_wmiawtb
21553
	       : fcode == ARM_BUILTIN_WMIAWTT ? CODE_FOR_iwmmxt_wmiawtt
21554
	       : fcode == ARM_BUILTIN_WMIAWBBN ? CODE_FOR_iwmmxt_wmiawbbn
21555
	       : fcode == ARM_BUILTIN_WMIAWBTN ? CODE_FOR_iwmmxt_wmiawbtn
21556
	       : fcode == ARM_BUILTIN_WMIAWTBN ? CODE_FOR_iwmmxt_wmiawtbn
21557
	       : fcode == ARM_BUILTIN_WMIAWTTN ? CODE_FOR_iwmmxt_wmiawttn
21558
	       : fcode == ARM_BUILTIN_WSADB ? CODE_FOR_iwmmxt_wsadb
21559
	       : CODE_FOR_iwmmxt_wsadh);
21170
      arg0 = CALL_EXPR_ARG (exp, 0);
21560
      arg0 = CALL_EXPR_ARG (exp, 0);
21171
      arg1 = CALL_EXPR_ARG (exp, 1);
21561
      arg1 = CALL_EXPR_ARG (exp, 1);
21172
      arg2 = CALL_EXPR_ARG (exp, 2);
21562
      arg2 = CALL_EXPR_ARG (exp, 2);
Lines 21199-21204 Link Here
21199
      emit_insn (gen_iwmmxt_clrdi (target));
21589
      emit_insn (gen_iwmmxt_clrdi (target));
21200
      return target;
21590
      return target;
21201
21591
21592
    case ARM_BUILTIN_WSRLHI:
21593
    case ARM_BUILTIN_WSRLWI:
21594
    case ARM_BUILTIN_WSRLDI:
21595
    case ARM_BUILTIN_WSLLHI:
21596
    case ARM_BUILTIN_WSLLWI:
21597
    case ARM_BUILTIN_WSLLDI:
21598
    case ARM_BUILTIN_WSRAHI:
21599
    case ARM_BUILTIN_WSRAWI:
21600
    case ARM_BUILTIN_WSRADI:
21601
    case ARM_BUILTIN_WRORHI:
21602
    case ARM_BUILTIN_WRORWI:
21603
    case ARM_BUILTIN_WRORDI:
21604
    case ARM_BUILTIN_WSRLH:
21605
    case ARM_BUILTIN_WSRLW:
21606
    case ARM_BUILTIN_WSRLD:
21607
    case ARM_BUILTIN_WSLLH:
21608
    case ARM_BUILTIN_WSLLW:
21609
    case ARM_BUILTIN_WSLLD:
21610
    case ARM_BUILTIN_WSRAH:
21611
    case ARM_BUILTIN_WSRAW:
21612
    case ARM_BUILTIN_WSRAD:
21613
    case ARM_BUILTIN_WRORH:
21614
    case ARM_BUILTIN_WRORW:
21615
    case ARM_BUILTIN_WRORD:
21616
      icode = (fcode == ARM_BUILTIN_WSRLHI ? CODE_FOR_lshrv4hi3_iwmmxt
21617
	       : fcode == ARM_BUILTIN_WSRLWI ? CODE_FOR_lshrv2si3_iwmmxt
21618
	       : fcode == ARM_BUILTIN_WSRLDI ? CODE_FOR_lshrdi3_iwmmxt
21619
	       : fcode == ARM_BUILTIN_WSLLHI ? CODE_FOR_ashlv4hi3_iwmmxt
21620
	       : fcode == ARM_BUILTIN_WSLLWI ? CODE_FOR_ashlv2si3_iwmmxt
21621
	       : fcode == ARM_BUILTIN_WSLLDI ? CODE_FOR_ashldi3_iwmmxt
21622
	       : fcode == ARM_BUILTIN_WSRAHI ? CODE_FOR_ashrv4hi3_iwmmxt
21623
	       : fcode == ARM_BUILTIN_WSRAWI ? CODE_FOR_ashrv2si3_iwmmxt
21624
	       : fcode == ARM_BUILTIN_WSRADI ? CODE_FOR_ashrdi3_iwmmxt
21625
	       : fcode == ARM_BUILTIN_WRORHI ? CODE_FOR_rorv4hi3
21626
	       : fcode == ARM_BUILTIN_WRORWI ? CODE_FOR_rorv2si3
21627
	       : fcode == ARM_BUILTIN_WRORDI ? CODE_FOR_rordi3
21628
	       : fcode == ARM_BUILTIN_WSRLH  ? CODE_FOR_lshrv4hi3_di
21629
	       : fcode == ARM_BUILTIN_WSRLW  ? CODE_FOR_lshrv2si3_di
21630
	       : fcode == ARM_BUILTIN_WSRLD  ? CODE_FOR_lshrdi3_di
21631
	       : fcode == ARM_BUILTIN_WSLLH  ? CODE_FOR_ashlv4hi3_di
21632
	       : fcode == ARM_BUILTIN_WSLLW  ? CODE_FOR_ashlv2si3_di
21633
	       : fcode == ARM_BUILTIN_WSLLD  ? CODE_FOR_ashldi3_di
21634
	       : fcode == ARM_BUILTIN_WSRAH  ? CODE_FOR_ashrv4hi3_di
21635
	       : fcode == ARM_BUILTIN_WSRAW  ? CODE_FOR_ashrv2si3_di
21636
	       : fcode == ARM_BUILTIN_WSRAD  ? CODE_FOR_ashrdi3_di
21637
	       : fcode == ARM_BUILTIN_WRORH  ? CODE_FOR_rorv4hi3_di
21638
	       : fcode == ARM_BUILTIN_WRORW  ? CODE_FOR_rorv2si3_di
21639
	       : fcode == ARM_BUILTIN_WRORD  ? CODE_FOR_rordi3_di
21640
	       : CODE_FOR_nothing);
21641
      arg1 = CALL_EXPR_ARG (exp, 1);
21642
      op1 = expand_normal (arg1);
21643
      if (GET_MODE (op1) == VOIDmode)
21644
	{
21645
	  imm = INTVAL (op1);
21646
	  if ((fcode == ARM_BUILTIN_WRORHI || fcode == ARM_BUILTIN_WRORWI
21647
	       || fcode == ARM_BUILTIN_WRORH || fcode == ARM_BUILTIN_WRORW)
21648
	      && (imm < 0 || imm > 32))
21649
	    {
21650
	      if (fcode == ARM_BUILTIN_WRORHI)
21651
		error ("the range of count should be in 0 to 32.  please check the intrinsic _mm_rori_pi16 in code.");
21652
	      else if (fcode == ARM_BUILTIN_WRORWI)
21653
		error ("the range of count should be in 0 to 32.  please check the intrinsic _mm_rori_pi32 in code.");
21654
	      else if (fcode == ARM_BUILTIN_WRORH)
21655
		error ("the range of count should be in 0 to 32.  please check the intrinsic _mm_ror_pi16 in code.");
21656
	      else
21657
		error ("the range of count should be in 0 to 32.  please check the intrinsic _mm_ror_pi32 in code.");
21658
	    }
21659
	  else if ((fcode == ARM_BUILTIN_WRORDI || fcode == ARM_BUILTIN_WRORD)
21660
		   && (imm < 0 || imm > 64))
21661
	    {
21662
	      if (fcode == ARM_BUILTIN_WRORDI)
21663
		error ("the range of count should be in 0 to 64.  please check the intrinsic _mm_rori_si64 in code.");
21664
	      else
21665
		error ("the range of count should be in 0 to 64.  please check the intrinsic _mm_ror_si64 in code.");
21666
	    }
21667
	  else if (imm < 0)
21668
	    {
21669
	      if (fcode == ARM_BUILTIN_WSRLHI)
21670
		error ("the count should be no less than 0.  please check the intrinsic _mm_srli_pi16 in code.");
21671
	      else if (fcode == ARM_BUILTIN_WSRLWI)
21672
		error ("the count should be no less than 0.  please check the intrinsic _mm_srli_pi32 in code.");
21673
	      else if (fcode == ARM_BUILTIN_WSRLDI)
21674
		error ("the count should be no less than 0.  please check the intrinsic _mm_srli_si64 in code.");
21675
	      else if (fcode == ARM_BUILTIN_WSLLHI)
21676
		error ("the count should be no less than 0.  please check the intrinsic _mm_slli_pi16 in code.");
21677
	      else if (fcode == ARM_BUILTIN_WSLLWI)
21678
		error ("the count should be no less than 0.  please check the intrinsic _mm_slli_pi32 in code.");
21679
	      else if (fcode == ARM_BUILTIN_WSLLDI)
21680
		error ("the count should be no less than 0.  please check the intrinsic _mm_slli_si64 in code.");
21681
	      else if (fcode == ARM_BUILTIN_WSRAHI)
21682
		error ("the count should be no less than 0.  please check the intrinsic _mm_srai_pi16 in code.");
21683
	      else if (fcode == ARM_BUILTIN_WSRAWI)
21684
		error ("the count should be no less than 0.  please check the intrinsic _mm_srai_pi32 in code.");
21685
	      else if (fcode == ARM_BUILTIN_WSRADI)
21686
		error ("the count should be no less than 0.  please check the intrinsic _mm_srai_si64 in code.");
21687
	      else if (fcode == ARM_BUILTIN_WSRLH)
21688
		error ("the count should be no less than 0.  please check the intrinsic _mm_srl_pi16 in code.");
21689
	      else if (fcode == ARM_BUILTIN_WSRLW)
21690
		error ("the count should be no less than 0.  please check the intrinsic _mm_srl_pi32 in code.");
21691
	      else if (fcode == ARM_BUILTIN_WSRLD)
21692
		error ("the count should be no less than 0.  please check the intrinsic _mm_srl_si64 in code.");
21693
	      else if (fcode == ARM_BUILTIN_WSLLH)
21694
		error ("the count should be no less than 0.  please check the intrinsic _mm_sll_pi16 in code.");
21695
	      else if (fcode == ARM_BUILTIN_WSLLW)
21696
		error ("the count should be no less than 0.  please check the intrinsic _mm_sll_pi32 in code.");
21697
	      else if (fcode == ARM_BUILTIN_WSLLD)
21698
		error ("the count should be no less than 0.  please check the intrinsic _mm_sll_si64 in code.");
21699
	      else if (fcode == ARM_BUILTIN_WSRAH)
21700
		error ("the count should be no less than 0.  please check the intrinsic _mm_sra_pi16 in code.");
21701
	      else if (fcode == ARM_BUILTIN_WSRAW)
21702
		error ("the count should be no less than 0.  please check the intrinsic _mm_sra_pi32 in code.");
21703
	      else
21704
		error ("the count should be no less than 0.  please check the intrinsic _mm_sra_si64 in code.");
21705
	    }
21706
	}
21707
      return arm_expand_binop_builtin (icode, exp, target);
21708
21202
    case ARM_BUILTIN_THREAD_POINTER:
21709
    case ARM_BUILTIN_THREAD_POINTER:
21203
      return arm_load_tp (target);
21710
      return arm_load_tp (target);
21204
21711
Lines 24287-24292 Link Here
24287
  return "";
24794
  return "";
24288
}
24795
}
24289
24796
24797
/* Output assembly for a WMMX immediate shift instruction.  */
24798
const char *
24799
arm_output_iwmmxt_shift_immediate (const char *insn_name, rtx *operands, bool wror_or_wsra)
24800
{
24801
  int shift = INTVAL (operands[2]);
24802
  char templ[50];
24803
  enum machine_mode opmode = GET_MODE (operands[0]);
24804
24805
  gcc_assert (shift >= 0);
24806
24807
  /* If the shift value in the register versions is > 63 (for D qualifier),
24808
     31 (for W qualifier) or 15 (for H qualifier).  */
24809
  if (((opmode == V4HImode) && (shift > 15))
24810
	|| ((opmode == V2SImode) && (shift > 31))
24811
	|| ((opmode == DImode) && (shift > 63)))
24812
  {
24813
    if (wror_or_wsra)
24814
      {
24815
        sprintf (templ, "%s\t%%0, %%1, #%d", insn_name, 32);
24816
        output_asm_insn (templ, operands);
24817
        if (opmode == DImode)
24818
          {
24819
	    sprintf (templ, "%s\t%%0, %%0, #%d", insn_name, 32);
24820
	    output_asm_insn (templ, operands);
24821
          }
24822
      }
24823
    else
24824
      {
24825
        /* The destination register will contain all zeros.  */
24826
        sprintf (templ, "wzero\t%%0");
24827
        output_asm_insn (templ, operands);
24828
      }
24829
    return "";
24830
  }
24831
24832
  if ((opmode == DImode) && (shift > 32))
24833
    {
24834
      sprintf (templ, "%s\t%%0, %%1, #%d", insn_name, 32);
24835
      output_asm_insn (templ, operands);
24836
      sprintf (templ, "%s\t%%0, %%0, #%d", insn_name, shift - 32);
24837
      output_asm_insn (templ, operands);
24838
    }
24839
  else
24840
    {
24841
      sprintf (templ, "%s\t%%0, %%1, #%d", insn_name, shift);
24842
      output_asm_insn (templ, operands);
24843
    }
24844
  return "";
24845
}
24846
24847
/* Output assembly for a WMMX tinsr instruction.  */
24848
const char *
24849
arm_output_iwmmxt_tinsr (rtx *operands)
24850
{
24851
  int mask = INTVAL (operands[3]);
24852
  int i;
24853
  char templ[50];
24854
  int units = mode_nunits[GET_MODE (operands[0])];
24855
  gcc_assert ((mask & (mask - 1)) == 0);
24856
  for (i = 0; i < units; ++i)
24857
    {
24858
      if ((mask & 0x01) == 1)
24859
        {
24860
          break;
24861
        }
24862
      mask >>= 1;
24863
    }
24864
  gcc_assert (i < units);
24865
  {
24866
    switch (GET_MODE (operands[0]))
24867
      {
24868
      case V8QImode:
24869
	sprintf (templ, "tinsrb%%?\t%%0, %%2, #%d", i);
24870
	break;
24871
      case V4HImode:
24872
	sprintf (templ, "tinsrh%%?\t%%0, %%2, #%d", i);
24873
	break;
24874
      case V2SImode:
24875
	sprintf (templ, "tinsrw%%?\t%%0, %%2, #%d", i);
24876
	break;
24877
      default:
24878
	gcc_unreachable ();
24879
	break;
24880
      }
24881
    output_asm_insn (templ, operands);
24882
  }
24883
  return "";
24884
}
24885
24290
/* Output a Thumb-1 casesi dispatch sequence.  */
24886
/* Output a Thumb-1 casesi dispatch sequence.  */
24291
const char *
24887
const char *
24292
thumb1_output_casesi (rtx *operands)
24888
thumb1_output_casesi (rtx *operands)
(-)gcc/config/arm/arm-cores.def (-2 / +2 lines)
Lines 1-5 Link Here
1
/* ARM CPU Cores
1
/* ARM CPU Cores
2
   Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010
2
   Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2012
3
   Free Software Foundation, Inc.
3
   Free Software Foundation, Inc.
4
   Written by CodeSourcery, LLC
4
   Written by CodeSourcery, LLC
5
5
Lines 105-111 Link Here
105
ARM_CORE("arm1022e",      arm1022e,	5TE,				 FL_LDSCHED, fastmul)
105
ARM_CORE("arm1022e",      arm1022e,	5TE,				 FL_LDSCHED, fastmul)
106
ARM_CORE("xscale",        xscale,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE, xscale)
106
ARM_CORE("xscale",        xscale,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE, xscale)
107
ARM_CORE("iwmmxt",        iwmmxt,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
107
ARM_CORE("iwmmxt",        iwmmxt,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
108
ARM_CORE("iwmmxt2",       iwmmxt2,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
108
ARM_CORE("iwmmxt2",       iwmmxt2,	5TE,	                         FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2, xscale)
109
ARM_CORE("fa606te",       fa606te,      5TE,                             FL_LDSCHED, 9e)
109
ARM_CORE("fa606te",       fa606te,      5TE,                             FL_LDSCHED, 9e)
110
ARM_CORE("fa626te",       fa626te,      5TE,                             FL_LDSCHED, 9e)
110
ARM_CORE("fa626te",       fa626te,      5TE,                             FL_LDSCHED, 9e)
111
ARM_CORE("fmp626",        fmp626,       5TE,                             FL_LDSCHED, 9e)
111
ARM_CORE("fmp626",        fmp626,       5TE,                             FL_LDSCHED, 9e)
(-)gcc/config/arm/arm.h (+7 lines)
Lines 97-102 Link Here
97
	  builtin_define ("__XSCALE__");		\
97
	  builtin_define ("__XSCALE__");		\
98
	if (arm_arch_iwmmxt)				\
98
	if (arm_arch_iwmmxt)				\
99
	  builtin_define ("__IWMMXT__");		\
99
	  builtin_define ("__IWMMXT__");		\
100
	if (arm_arch_iwmmxt2)				\
101
	  builtin_define ("__IWMMXT2__");		\
100
	if (TARGET_AAPCS_BASED)				\
102
	if (TARGET_AAPCS_BASED)				\
101
	  {						\
103
	  {						\
102
	    if (arm_pcs_default == ARM_PCS_AAPCS_VFP)	\
104
	    if (arm_pcs_default == ARM_PCS_AAPCS_VFP)	\
Lines 194-200 Link Here
194
#define TARGET_MAVERICK		(arm_fpu_desc->model == ARM_FP_MODEL_MAVERICK)
196
#define TARGET_MAVERICK		(arm_fpu_desc->model == ARM_FP_MODEL_MAVERICK)
195
#define TARGET_VFP		(arm_fpu_desc->model == ARM_FP_MODEL_VFP)
197
#define TARGET_VFP		(arm_fpu_desc->model == ARM_FP_MODEL_VFP)
196
#define TARGET_IWMMXT			(arm_arch_iwmmxt)
198
#define TARGET_IWMMXT			(arm_arch_iwmmxt)
199
#define TARGET_IWMMXT2			(arm_arch_iwmmxt2)
197
#define TARGET_REALLY_IWMMXT		(TARGET_IWMMXT && TARGET_32BIT)
200
#define TARGET_REALLY_IWMMXT		(TARGET_IWMMXT && TARGET_32BIT)
201
#define TARGET_REALLY_IWMMXT2		(TARGET_IWMMXT2 && TARGET_32BIT)
198
#define TARGET_IWMMXT_ABI (TARGET_32BIT && arm_abi == ARM_ABI_IWMMXT)
202
#define TARGET_IWMMXT_ABI (TARGET_32BIT && arm_abi == ARM_ABI_IWMMXT)
199
#define TARGET_ARM                      (! TARGET_THUMB)
203
#define TARGET_ARM                      (! TARGET_THUMB)
200
#define TARGET_EITHER			1 /* (TARGET_ARM | TARGET_THUMB) */
204
#define TARGET_EITHER			1 /* (TARGET_ARM | TARGET_THUMB) */
Lines 410-415 Link Here
410
/* Nonzero if this chip supports Intel XScale with Wireless MMX technology.  */
414
/* Nonzero if this chip supports Intel XScale with Wireless MMX technology.  */
411
extern int arm_arch_iwmmxt;
415
extern int arm_arch_iwmmxt;
412
416
417
/* Nonzero if this chip supports Intel Wireless MMX2 technology.  */
418
extern int arm_arch_iwmmxt2;
419
413
/* Nonzero if this chip is an XScale.  */
420
/* Nonzero if this chip is an XScale.  */
414
extern int arm_arch_xscale;
421
extern int arm_arch_xscale;
415
422
(-)gcc/config/arm/arm.md (-3 / +12 lines)
Lines 62-67 Link Here
62
;; UNSPEC Usage:
62
;; UNSPEC Usage:
63
;; Note: sin and cos are no-longer used.
63
;; Note: sin and cos are no-longer used.
64
;; Unspec enumerators for Neon are defined in neon.md.
64
;; Unspec enumerators for Neon are defined in neon.md.
65
;; Unspec enumerators for iwmmxt2 are defined in iwmmxt2.md
65
66
66
(define_c_enum "unspec" [
67
(define_c_enum "unspec" [
67
  UNSPEC_SIN            ; `sin' operation (MODE_FLOAT):
68
  UNSPEC_SIN            ; `sin' operation (MODE_FLOAT):
Lines 98-105 Link Here
98
  UNSPEC_WMACSZ         ; Used by the intrinsic form of the iWMMXt WMACSZ instruction.
99
  UNSPEC_WMACSZ         ; Used by the intrinsic form of the iWMMXt WMACSZ instruction.
99
  UNSPEC_WMACUZ         ; Used by the intrinsic form of the iWMMXt WMACUZ instruction.
100
  UNSPEC_WMACUZ         ; Used by the intrinsic form of the iWMMXt WMACUZ instruction.
100
  UNSPEC_CLRDI          ; Used by the intrinsic form of the iWMMXt CLRDI instruction.
101
  UNSPEC_CLRDI          ; Used by the intrinsic form of the iWMMXt CLRDI instruction.
101
  UNSPEC_WMADDS         ; Used by the intrinsic form of the iWMMXt WMADDS instruction.
102
  UNSPEC_WALIGNI        ; Used by the intrinsic form of the iWMMXt WALIGN instruction.
102
  UNSPEC_WMADDU         ; Used by the intrinsic form of the iWMMXt WMADDU instruction.
103
  UNSPEC_TLS            ; A symbol that has been treated properly for TLS usage.
103
  UNSPEC_TLS            ; A symbol that has been treated properly for TLS usage.
104
  UNSPEC_PIC_LABEL      ; A label used for PIC access that does not appear in the
104
  UNSPEC_PIC_LABEL      ; A label used for PIC access that does not appear in the
105
                        ; instruction stream.
105
                        ; instruction stream.
Lines 196-202 Link Here
196
; for ARM or Thumb-2 with arm_arch6, and nov6 for ARM without
196
; for ARM or Thumb-2 with arm_arch6, and nov6 for ARM without
197
; arm_arch6.  This attribute is used to compute attribute "enabled",
197
; arm_arch6.  This attribute is used to compute attribute "enabled",
198
; use type "any" to enable an alternative in all cases.
198
; use type "any" to enable an alternative in all cases.
199
(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,onlya8,nota8"
199
(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,onlya8,nota8,iwmmxt,iwmmxt2"
200
  (const_string "any"))
200
  (const_string "any"))
201
201
202
(define_attr "arch_enabled" "no,yes"
202
(define_attr "arch_enabled" "no,yes"
Lines 237-242 Link Here
237
237
238
	 (and (eq_attr "arch" "nota8")
238
	 (and (eq_attr "arch" "nota8")
239
	      (not (eq_attr "tune" "cortexa8")))
239
	      (not (eq_attr "tune" "cortexa8")))
240
	 (const_string "yes")
241
242
	 (and (eq_attr "arch" "iwmmxt2")
243
	      (match_test "TARGET_REALLY_IWMMXT2"))
240
	 (const_string "yes")]
244
	 (const_string "yes")]
241
	(const_string "no")))
245
	(const_string "no")))
242
246
Lines 351-356 Link Here
351
	       (const_string "yes")
355
	       (const_string "yes")
352
	       (const_string "no")))
356
	       (const_string "no")))
353
357
358
; wtype for WMMX insn scheduling purposes.
359
(define_attr "wtype"
360
        "none,wor,wxor,wand,wandn,wmov,tmcrr,tmrrc,wldr,wstr,tmcr,tmrc,wadd,wsub,wmul,wmac,wavg2,tinsr,textrm,wshufh,wcmpeq,wcmpgt,wmax,wmin,wpack,wunpckih,wunpckil,wunpckeh,wunpckel,wror,wsra,wsrl,wsll,wmadd,tmia,tmiaph,tmiaxy,tbcst,tmovmsk,wacc,waligni,walignr,tandc,textrc,torc,torvsc,wsad,wabs,wabsdiff,waddsubhx,wsubaddhx,wavg4,wmulw,wqmulm,wqmulwm,waddbhus,wqmiaxy,wmiaxy,wmiawxy,wmerge" (const_string "none"))
361
354
; Load scheduling, set from the arm_ld_sched variable
362
; Load scheduling, set from the arm_ld_sched variable
355
; initialized by arm_option_override()
363
; initialized by arm_option_override()
356
(define_attr "ldsched" "no,yes" (const (symbol_ref "arm_ld_sched")))
364
(define_attr "ldsched" "no,yes" (const (symbol_ref "arm_ld_sched")))
Lines 527-532 Link Here
527
	  (const_string "yes")
535
	  (const_string "yes")
528
	  (const_string "no"))))
536
	  (const_string "no"))))
529
537
538
(include "marvell-f-iwmmxt.md")
530
(include "arm-generic.md")
539
(include "arm-generic.md")
531
(include "arm926ejs.md")
540
(include "arm926ejs.md")
532
(include "arm1020e.md")
541
(include "arm1020e.md")
(-)gcc/config/arm/arm-protos.h (+2 lines)
Lines 156-161 Link Here
156
extern void arm_set_return_address (rtx, rtx);
156
extern void arm_set_return_address (rtx, rtx);
157
extern int arm_eliminable_register (rtx);
157
extern int arm_eliminable_register (rtx);
158
extern const char *arm_output_shift(rtx *, int);
158
extern const char *arm_output_shift(rtx *, int);
159
extern const char *arm_output_iwmmxt_shift_immediate (const char *, rtx *, bool);
160
extern const char *arm_output_iwmmxt_tinsr (rtx *);
159
extern unsigned int arm_sync_loop_insns (rtx , rtx *);
161
extern unsigned int arm_sync_loop_insns (rtx , rtx *);
160
extern int arm_attr_length_push_multi(rtx, rtx);
162
extern int arm_attr_length_push_multi(rtx, rtx);
161
extern void arm_expand_compare_and_swap (rtx op[]);
163
extern void arm_expand_compare_and_swap (rtx op[]);
(-)gcc/config/arm/iterators.md (-1 / +3 lines)
Lines 1-5 Link Here
1
;; Code and mode itertator and attribute definitions for the ARM backend
1
;; Code and mode itertator and attribute definitions for the ARM backend
2
;; Copyright (C) 2010 Free Software Foundation, Inc.
2
;; Copyright (C) 2010, 2012 Free Software Foundation, Inc.
3
;; Contributed by ARM Ltd.
3
;; Contributed by ARM Ltd.
4
;;
4
;;
5
;; This file is part of GCC.
5
;; This file is part of GCC.
Lines 45-50 Link Here
45
;; Integer element sizes implemented by IWMMXT.
45
;; Integer element sizes implemented by IWMMXT.
46
(define_mode_iterator VMMX [V2SI V4HI V8QI])
46
(define_mode_iterator VMMX [V2SI V4HI V8QI])
47
47
48
(define_mode_iterator VMMX2 [V4HI V2SI])
49
48
;; Integer element sizes for shifts.
50
;; Integer element sizes for shifts.
49
(define_mode_iterator VSHFT [V4HI V2SI DI])
51
(define_mode_iterator VSHFT [V4HI V2SI DI])
50
52
(-)gcc/config/arm/iwmmxt2.md (+918 lines)
Line 0 Link Here
1
;; Patterns for the Intel Wireless MMX technology architecture.
2
;; Copyright (C) 2011, 2012 Free Software Foundation, Inc.
3
;; Written by Marvell, Inc.
4
;;
5
;; This file is part of GCC.
6
;;
7
;; GCC is free software; you can redistribute it and/or modify it
8
;; under the terms of the GNU General Public License as published
9
;; by the Free Software Foundation; either version 3, or (at your
10
;; option) any later version.
11
12
;; GCC is distributed in the hope that it will be useful, but WITHOUT
13
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15
;; License for more details.
16
17
;; You should have received a copy of the GNU General Public License
18
;; along with GCC; see the file COPYING3.  If not see
19
;; <http://www.gnu.org/licenses/>.
20
21
(define_c_enum "unspec" [
22
  UNSPEC_WADDC		; Used by the intrinsic form of the iWMMXt WADDC instruction.
23
  UNSPEC_WABS		; Used by the intrinsic form of the iWMMXt WABS instruction.
24
  UNSPEC_WQMULWMR	; Used by the intrinsic form of the iWMMXt WQMULWMR instruction.
25
  UNSPEC_WQMULMR	; Used by the intrinsic form of the iWMMXt WQMULMR instruction.
26
  UNSPEC_WQMULWM	; Used by the intrinsic form of the iWMMXt WQMULWM instruction.
27
  UNSPEC_WQMULM		; Used by the intrinsic form of the iWMMXt WQMULM instruction.
28
  UNSPEC_WQMIAxyn	; Used by the intrinsic form of the iWMMXt WMIAxyn instruction.
29
  UNSPEC_WQMIAxy	; Used by the intrinsic form of the iWMMXt WMIAxy instruction.
30
  UNSPEC_TANDC		; Used by the intrinsic form of the iWMMXt TANDC instruction.
31
  UNSPEC_TORC		; Used by the intrinsic form of the iWMMXt TORC instruction.
32
  UNSPEC_TORVSC		; Used by the intrinsic form of the iWMMXt TORVSC instruction.
33
  UNSPEC_TEXTRC		; Used by the intrinsic form of the iWMMXt TEXTRC instruction.
34
])
35
36
(define_insn "iwmmxt_wabs<mode>3"
37
  [(set (match_operand:VMMX               0 "register_operand" "=y")
38
        (unspec:VMMX [(match_operand:VMMX 1 "register_operand"  "y")] UNSPEC_WABS))]
39
  "TARGET_REALLY_IWMMXT"
40
  "wabs<MMX_char>%?\\t%0, %1"
41
  [(set_attr "predicable" "yes")
42
   (set_attr "wtype" "wabs")]
43
)
44
45
(define_insn "iwmmxt_wabsdiffb"
46
  [(set (match_operand:V8QI                          0 "register_operand" "=y")
47
	(truncate:V8QI
48
	  (abs:V8HI
49
	    (minus:V8HI
50
	      (zero_extend:V8HI (match_operand:V8QI  1 "register_operand"  "y"))
51
	      (zero_extend:V8HI (match_operand:V8QI  2 "register_operand"  "y"))))))]
52
 "TARGET_REALLY_IWMMXT"
53
 "wabsdiffb%?\\t%0, %1, %2"
54
 [(set_attr "predicable" "yes")
55
  (set_attr "wtype" "wabsdiff")]
56
)
57
58
(define_insn "iwmmxt_wabsdiffh"
59
  [(set (match_operand:V4HI                          0 "register_operand" "=y")
60
        (truncate: V4HI
61
          (abs:V4SI
62
            (minus:V4SI
63
              (zero_extend:V4SI (match_operand:V4HI  1 "register_operand"  "y"))
64
	      (zero_extend:V4SI (match_operand:V4HI  2 "register_operand"  "y"))))))]
65
  "TARGET_REALLY_IWMMXT"
66
  "wabsdiffh%?\\t%0, %1, %2"
67
  [(set_attr "predicable" "yes")
68
   (set_attr "wtype" "wabsdiff")]
69
)
70
71
(define_insn "iwmmxt_wabsdiffw"
72
  [(set (match_operand:V2SI                          0 "register_operand" "=y")
73
        (truncate: V2SI
74
	  (abs:V2DI
75
	    (minus:V2DI
76
	      (zero_extend:V2DI (match_operand:V2SI  1 "register_operand"  "y"))
77
	      (zero_extend:V2DI (match_operand:V2SI  2 "register_operand"  "y"))))))]
78
 "TARGET_REALLY_IWMMXT"
79
 "wabsdiffw%?\\t%0, %1, %2"
80
 [(set_attr "predicable" "yes")
81
  (set_attr "wtype" "wabsdiff")]
82
)
83
84
(define_insn "iwmmxt_waddsubhx"
85
  [(set (match_operand:V4HI                                        0 "register_operand" "=y")
86
	(vec_merge:V4HI
87
	  (ss_minus:V4HI
88
	    (match_operand:V4HI                                    1 "register_operand" "y")
89
	    (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y")
90
	                     (parallel [(const_int 1) (const_int 0) (const_int 3) (const_int 2)])))
91
	  (ss_plus:V4HI
92
	    (match_dup 1)
93
	    (vec_select:V4HI (match_dup 2)
94
	                     (parallel [(const_int 1) (const_int 0) (const_int 3) (const_int 2)])))
95
	  (const_int 10)))]
96
  "TARGET_REALLY_IWMMXT"
97
  "waddsubhx%?\\t%0, %1, %2"
98
  [(set_attr "predicable" "yes")
99
   (set_attr "wtype" "waddsubhx")]
100
)
101
102
(define_insn "iwmmxt_wsubaddhx"
103
  [(set (match_operand:V4HI                                        0 "register_operand" "=y")
104
	(vec_merge:V4HI
105
	  (ss_plus:V4HI
106
	    (match_operand:V4HI                                    1 "register_operand" "y")
107
	    (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y")
108
	                     (parallel [(const_int 1) (const_int 0) (const_int 3) (const_int 2)])))
109
	  (ss_minus:V4HI
110
	    (match_dup 1)
111
	    (vec_select:V4HI (match_dup 2)
112
	                     (parallel [(const_int 1) (const_int 0) (const_int 3) (const_int 2)])))
113
	  (const_int 10)))]
114
  "TARGET_REALLY_IWMMXT"
115
  "wsubaddhx%?\\t%0, %1, %2"
116
  [(set_attr "predicable" "yes")
117
   (set_attr "wtype" "wsubaddhx")]
118
)
119
120
(define_insn "addc<mode>3"
121
  [(set (match_operand:VMMX2      0 "register_operand" "=y")
122
	(unspec:VMMX2
123
          [(plus:VMMX2
124
             (match_operand:VMMX2 1 "register_operand"  "y")
125
	     (match_operand:VMMX2 2 "register_operand"  "y"))] UNSPEC_WADDC))]
126
  "TARGET_REALLY_IWMMXT"
127
  "wadd<MMX_char>c%?\\t%0, %1, %2"
128
  [(set_attr "predicable" "yes")
129
   (set_attr "wtype" "wadd")]
130
)
131
132
(define_insn "iwmmxt_avg4"
133
[(set (match_operand:V8QI                                 0 "register_operand" "=y")
134
      (truncate:V8QI
135
        (vec_select:V8HI
136
	  (vec_merge:V8HI
137
	    (lshiftrt:V8HI
138
	      (plus:V8HI
139
	        (plus:V8HI
140
		  (plus:V8HI
141
	            (plus:V8HI
142
		      (zero_extend:V8HI (match_operand:V8QI 1 "register_operand" "y"))
143
		      (zero_extend:V8HI (match_operand:V8QI 2 "register_operand" "y")))
144
		    (vec_select:V8HI (zero_extend:V8HI (match_dup 1))
145
		                     (parallel [(const_int 7) (const_int 0) (const_int 1) (const_int 2)
146
				                (const_int 3) (const_int 4) (const_int 5) (const_int 6)])))
147
		  (vec_select:V8HI (zero_extend:V8HI (match_dup 2))
148
		                   (parallel [(const_int 7) (const_int 0) (const_int 1) (const_int 2)
149
				              (const_int 3) (const_int 4) (const_int 5) (const_int 6)])))
150
	        (const_vector:V8HI [(const_int 1) (const_int 1) (const_int 1) (const_int 1)
151
	                            (const_int 1) (const_int 1) (const_int 1) (const_int 1)]))
152
	      (const_int 2))
153
	    (const_vector:V8HI [(const_int 0) (const_int 0) (const_int 0) (const_int 0)
154
	                        (const_int 0) (const_int 0) (const_int 0) (const_int 0)])
155
	    (const_int 254))
156
	  (parallel [(const_int 1) (const_int 2) (const_int 3) (const_int 4)
157
	             (const_int 5) (const_int 6) (const_int 7) (const_int 0)]))))]
158
  "TARGET_REALLY_IWMMXT"
159
  "wavg4%?\\t%0, %1, %2"
160
  [(set_attr "predicable" "yes")
161
   (set_attr "wtype" "wavg4")]
162
)
163
164
(define_insn "iwmmxt_avg4r"
165
  [(set (match_operand:V8QI                                   0 "register_operand" "=y")
166
	(truncate:V8QI
167
	  (vec_select:V8HI
168
	    (vec_merge:V8HI
169
	      (lshiftrt:V8HI
170
	        (plus:V8HI
171
		  (plus:V8HI
172
		    (plus:V8HI
173
		      (plus:V8HI
174
		        (zero_extend:V8HI (match_operand:V8QI 1 "register_operand" "y"))
175
		        (zero_extend:V8HI (match_operand:V8QI 2 "register_operand" "y")))
176
		      (vec_select:V8HI (zero_extend:V8HI (match_dup 1))
177
		                       (parallel [(const_int 7) (const_int 0) (const_int 1) (const_int 2)
178
				                  (const_int 3) (const_int 4) (const_int 5) (const_int 6)])))
179
		    (vec_select:V8HI (zero_extend:V8HI (match_dup 2))
180
		                     (parallel [(const_int 7) (const_int 0) (const_int 1) (const_int 2)
181
				                (const_int 3) (const_int 4) (const_int 5) (const_int 6)])))
182
		  (const_vector:V8HI [(const_int 2) (const_int 2) (const_int 2) (const_int 2)
183
		                      (const_int 2) (const_int 2) (const_int 2) (const_int 2)]))
184
	        (const_int 2))
185
	      (const_vector:V8HI [(const_int 0) (const_int 0) (const_int 0) (const_int 0)
186
	                          (const_int 0) (const_int 0) (const_int 0) (const_int 0)])
187
	      (const_int 254))
188
	    (parallel [(const_int 1) (const_int 2) (const_int 3) (const_int 4)
189
	               (const_int 5) (const_int 6) (const_int 7) (const_int 0)]))))]
190
  "TARGET_REALLY_IWMMXT"
191
  "wavg4r%?\\t%0, %1, %2"
192
  [(set_attr "predicable" "yes")
193
   (set_attr "wtype" "wavg4")]
194
)
195
196
(define_insn "iwmmxt_wmaddsx"
197
  [(set (match_operand:V2SI                                        0 "register_operand" "=y")
198
	(plus:V2SI
199
	  (mult:V2SI
200
	    (vec_select:V2SI (sign_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
201
	                     (parallel [(const_int 1) (const_int 3)]))
202
	    (vec_select:V2SI (sign_extend:V4SI (match_operand:V4HI 2 "register_operand" "y"))
203
	                     (parallel [(const_int 0) (const_int 2)])))
204
	  (mult:V2SI
205
	    (vec_select:V2SI (sign_extend:V4SI (match_dup 1))
206
	                     (parallel [(const_int 0) (const_int 2)]))
207
	    (vec_select:V2SI (sign_extend:V4SI (match_dup 2))
208
	                     (parallel [(const_int 1) (const_int 3)])))))]
209
 "TARGET_REALLY_IWMMXT"
210
  "wmaddsx%?\\t%0, %1, %2"
211
  [(set_attr "predicable" "yes")
212
	(set_attr "wtype" "wmadd")]
213
)
214
215
(define_insn "iwmmxt_wmaddux"
216
  [(set (match_operand:V2SI                                        0 "register_operand" "=y")
217
	(plus:V2SI
218
	  (mult:V2SI
219
	    (vec_select:V2SI (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
220
	                     (parallel [(const_int 1) (const_int 3)]))
221
	    (vec_select:V2SI (zero_extend:V4SI (match_operand:V4HI 2 "register_operand" "y"))
222
	                     (parallel [(const_int 0) (const_int 2)])))
223
	  (mult:V2SI
224
	    (vec_select:V2SI (zero_extend:V4SI (match_dup 1))
225
	                     (parallel [(const_int 0) (const_int 2)]))
226
	    (vec_select:V2SI (zero_extend:V4SI (match_dup 2))
227
	                     (parallel [(const_int 1) (const_int 3)])))))]
228
  "TARGET_REALLY_IWMMXT"
229
  "wmaddux%?\\t%0, %1, %2"
230
  [(set_attr "predicable" "yes")
231
   (set_attr "wtype" "wmadd")]
232
)
233
234
(define_insn "iwmmxt_wmaddsn"
235
 [(set (match_operand:V2SI                                     0 "register_operand" "=y")
236
    (minus:V2SI
237
      (mult:V2SI
238
        (vec_select:V2SI (sign_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
239
	                 (parallel [(const_int 0) (const_int 2)]))
240
        (vec_select:V2SI (sign_extend:V4SI (match_operand:V4HI 2 "register_operand" "y"))
241
	                 (parallel [(const_int 0) (const_int 2)])))
242
      (mult:V2SI
243
        (vec_select:V2SI (sign_extend:V4SI (match_dup 1))
244
	                 (parallel [(const_int 1) (const_int 3)]))
245
        (vec_select:V2SI (sign_extend:V4SI (match_dup 2))
246
	                 (parallel [(const_int 1) (const_int 3)])))))]
247
 "TARGET_REALLY_IWMMXT"
248
 "wmaddsn%?\\t%0, %1, %2"
249
 [(set_attr "predicable" "yes")
250
  (set_attr "wtype" "wmadd")]
251
)
252
253
(define_insn "iwmmxt_wmaddun"
254
  [(set (match_operand:V2SI                                        0 "register_operand" "=y")
255
	(minus:V2SI
256
	  (mult:V2SI
257
	    (vec_select:V2SI (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
258
	                     (parallel [(const_int 0) (const_int 2)]))
259
	    (vec_select:V2SI (zero_extend:V4SI (match_operand:V4HI 2 "register_operand" "y"))
260
	                     (parallel [(const_int 0) (const_int 2)])))
261
	  (mult:V2SI
262
	    (vec_select:V2SI (zero_extend:V4SI (match_dup 1))
263
	                     (parallel [(const_int 1) (const_int 3)]))
264
	    (vec_select:V2SI (zero_extend:V4SI (match_dup 2))
265
	                     (parallel [(const_int 1) (const_int 3)])))))]
266
  "TARGET_REALLY_IWMMXT"
267
  "wmaddun%?\\t%0, %1, %2"
268
  [(set_attr "predicable" "yes")
269
   (set_attr "wtype" "wmadd")]
270
)
271
272
(define_insn "iwmmxt_wmulwsm"
273
  [(set (match_operand:V2SI                         0 "register_operand" "=y")
274
	(truncate:V2SI
275
	  (ashiftrt:V2DI
276
	    (mult:V2DI
277
	      (sign_extend:V2DI (match_operand:V2SI 1 "register_operand" "y"))
278
	      (sign_extend:V2DI (match_operand:V2SI 2 "register_operand" "y")))
279
	    (const_int 32))))]
280
  "TARGET_REALLY_IWMMXT"
281
  "wmulwsm%?\\t%0, %1, %2"
282
  [(set_attr "predicable" "yes")
283
   (set_attr "wtype" "wmulw")]
284
)
285
286
(define_insn "iwmmxt_wmulwum"
287
  [(set (match_operand:V2SI                         0 "register_operand" "=y")
288
	(truncate:V2SI
289
          (lshiftrt:V2DI
290
	    (mult:V2DI
291
	      (zero_extend:V2DI (match_operand:V2SI 1 "register_operand" "y"))
292
	      (zero_extend:V2DI (match_operand:V2SI 2 "register_operand" "y")))
293
	    (const_int 32))))]
294
  "TARGET_REALLY_IWMMXT"
295
  "wmulwum%?\\t%0, %1, %2"
296
  [(set_attr "predicable" "yes")
297
   (set_attr "wtype" "wmulw")]
298
)
299
300
(define_insn "iwmmxt_wmulsmr"
301
  [(set (match_operand:V4HI                           0 "register_operand" "=y")
302
	(truncate:V4HI
303
	  (ashiftrt:V4SI
304
	    (plus:V4SI
305
	      (mult:V4SI
306
	        (sign_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
307
		(sign_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
308
	      (const_vector:V4SI [(const_int 32768)
309
	                          (const_int 32768)
310
				  (const_int 32768)]))
311
	    (const_int 16))))]
312
  "TARGET_REALLY_IWMMXT"
313
  "wmulsmr%?\\t%0, %1, %2"
314
  [(set_attr "predicable" "yes")
315
   (set_attr "wtype" "wmul")]
316
)
317
318
(define_insn "iwmmxt_wmulumr"
319
  [(set (match_operand:V4HI                           0 "register_operand" "=y")
320
	(truncate:V4HI
321
	  (lshiftrt:V4SI
322
	    (plus:V4SI
323
	      (mult:V4SI
324
	        (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
325
		(zero_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
326
	      (const_vector:V4SI [(const_int 32768)
327
				  (const_int 32768)
328
				  (const_int 32768)
329
				  (const_int 32768)]))
330
	  (const_int 16))))]
331
  "TARGET_REALLY_IWMMXT"
332
  "wmulumr%?\\t%0, %1, %2"
333
  [(set_attr "predicable" "yes")
334
   (set_attr "wtype" "wmul")]
335
)
336
337
(define_insn "iwmmxt_wmulwsmr"
338
  [(set (match_operand:V2SI                           0 "register_operand" "=y")
339
	(truncate:V2SI
340
	  (ashiftrt:V2DI
341
	    (plus:V2DI
342
	      (mult:V2DI
343
	        (sign_extend:V2DI (match_operand:V2SI 1 "register_operand" "y"))
344
		(sign_extend:V2DI (match_operand:V2SI 2 "register_operand" "y")))
345
	      (const_vector:V2DI [(const_int 2147483648)
346
				  (const_int 2147483648)]))
347
	    (const_int 32))))]
348
  "TARGET_REALLY_IWMMXT"
349
  "wmulwsmr%?\\t%0, %1, %2"
350
  [(set_attr "predicable" "yes")
351
   (set_attr "wtype" "wmul")]
352
)
353
354
(define_insn "iwmmxt_wmulwumr"
355
  [(set (match_operand:V2SI                           0 "register_operand" "=y")
356
	(truncate:V2SI
357
	  (lshiftrt:V2DI
358
	    (plus:V2DI
359
	      (mult:V2DI
360
	        (zero_extend:V2DI (match_operand:V2SI 1 "register_operand" "y"))
361
		(zero_extend:V2DI (match_operand:V2SI 2 "register_operand" "y")))
362
	      (const_vector:V2DI [(const_int 2147483648)
363
			          (const_int 2147483648)]))
364
	    (const_int 32))))]
365
  "TARGET_REALLY_IWMMXT"
366
  "wmulwumr%?\\t%0, %1, %2"
367
  [(set_attr "predicable" "yes")
368
   (set_attr "wtype" "wmulw")]
369
)
370
371
(define_insn "iwmmxt_wmulwl"
372
  [(set (match_operand:V2SI   0 "register_operand" "=y")
373
        (mult:V2SI
374
          (match_operand:V2SI 1 "register_operand" "y")
375
	  (match_operand:V2SI 2 "register_operand" "y")))]
376
  "TARGET_REALLY_IWMMXT"
377
  "wmulwl%?\\t%0, %1, %2"
378
  [(set_attr "predicable" "yes")
379
   (set_attr "wtype" "wmulw")]
380
)
381
382
(define_insn "iwmmxt_wqmulm"
383
  [(set (match_operand:V4HI            0 "register_operand" "=y")
384
        (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
385
		      (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WQMULM))]
386
  "TARGET_REALLY_IWMMXT"
387
  "wqmulm%?\\t%0, %1, %2"
388
  [(set_attr "predicable" "yes")
389
   (set_attr "wtype" "wqmulm")]
390
)
391
392
(define_insn "iwmmxt_wqmulwm"
393
  [(set (match_operand:V2SI               0 "register_operand" "=y")
394
	(unspec:V2SI [(match_operand:V2SI 1 "register_operand" "y")
395
		      (match_operand:V2SI 2 "register_operand" "y")] UNSPEC_WQMULWM))]
396
  "TARGET_REALLY_IWMMXT"
397
  "wqmulwm%?\\t%0, %1, %2"
398
  [(set_attr "predicable" "yes")
399
   (set_attr "wtype" "wqmulwm")]
400
)
401
402
(define_insn "iwmmxt_wqmulmr"
403
  [(set (match_operand:V4HI               0 "register_operand" "=y")
404
	(unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
405
		      (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WQMULMR))]
406
  "TARGET_REALLY_IWMMXT"
407
  "wqmulmr%?\\t%0, %1, %2"
408
  [(set_attr "predicable" "yes")
409
   (set_attr "wtype" "wqmulm")]
410
)
411
412
(define_insn "iwmmxt_wqmulwmr"
413
  [(set (match_operand:V2SI            0 "register_operand" "=y")
414
        (unspec:V2SI [(match_operand:V2SI 1 "register_operand" "y")
415
		      (match_operand:V2SI 2 "register_operand" "y")] UNSPEC_WQMULWMR))]
416
  "TARGET_REALLY_IWMMXT"
417
  "wqmulwmr%?\\t%0, %1, %2"
418
  [(set_attr "predicable" "yes")
419
   (set_attr "wtype" "wqmulwm")]
420
)
421
422
(define_insn "iwmmxt_waddbhusm"
423
  [(set (match_operand:V8QI                          0 "register_operand" "=y")
424
	(vec_concat:V8QI
425
	  (const_vector:V4QI [(const_int 0) (const_int 0) (const_int 0) (const_int 0)])
426
	  (us_truncate:V4QI
427
	    (ss_plus:V4HI
428
	      (match_operand:V4HI                    1 "register_operand" "y")
429
	      (zero_extend:V4HI
430
	        (vec_select:V4QI (match_operand:V8QI 2 "register_operand" "y")
431
	                         (parallel [(const_int 4) (const_int 5) (const_int 6) (const_int 7)])))))))]
432
  "TARGET_REALLY_IWMMXT"
433
  "waddbhusm%?\\t%0, %1, %2"
434
  [(set_attr "predicable" "yes")
435
   (set_attr "wtype" "waddbhus")]
436
)
437
438
(define_insn "iwmmxt_waddbhusl"
439
  [(set (match_operand:V8QI                          0 "register_operand" "=y")
440
	(vec_concat:V8QI
441
	  (us_truncate:V4QI
442
	    (ss_plus:V4HI
443
	      (match_operand:V4HI                    1 "register_operand" "y")
444
	      (zero_extend:V4HI
445
		(vec_select:V4QI (match_operand:V8QI 2 "register_operand" "y")
446
		                 (parallel [(const_int 0) (const_int 1) (const_int 2) (const_int 3)])))))
447
	  (const_vector:V4QI [(const_int 0) (const_int 0) (const_int 0) (const_int 0)])))]
448
  "TARGET_REALLY_IWMMXT"
449
  "waddbhusl%?\\t%0, %1, %2"
450
  [(set_attr "predicable" "yes")
451
   (set_attr "wtype" "waddbhus")]
452
)
453
454
(define_insn "iwmmxt_wqmiabb"
455
  [(set (match_operand:V2SI	                             0 "register_operand" "=y")
456
	(unspec:V2SI [(match_operand:V2SI                    1 "register_operand" "0")
457
		      (zero_extract:V4HI (match_operand:V4HI 2 "register_operand" "y") (const_int 16) (const_int 0))
458
		      (zero_extract:V4HI (match_dup 2) (const_int 16) (const_int 32))
459
		      (zero_extract:V4HI (match_operand:V4HI 3 "register_operand" "y") (const_int 16) (const_int 0))
460
		      (zero_extract:V4HI (match_dup 3) (const_int 16) (const_int 32))] UNSPEC_WQMIAxy))]
461
  "TARGET_REALLY_IWMMXT"
462
  "wqmiabb%?\\t%0, %2, %3"
463
  [(set_attr "predicable" "yes")
464
   (set_attr "wtype" "wqmiaxy")]
465
)
466
467
(define_insn "iwmmxt_wqmiabt"
468
  [(set (match_operand:V2SI	                             0 "register_operand" "=y")
469
	(unspec:V2SI [(match_operand:V2SI                    1 "register_operand" "0")
470
	              (zero_extract:V4HI (match_operand:V4HI 2 "register_operand" "y") (const_int 16) (const_int 0))
471
		      (zero_extract:V4HI (match_dup 2) (const_int 16) (const_int 32))
472
		      (zero_extract:V4HI (match_operand:V4HI 3 "register_operand" "y") (const_int 16) (const_int 16))
473
		      (zero_extract:V4HI (match_dup 3) (const_int 16) (const_int 48))] UNSPEC_WQMIAxy))]
474
  "TARGET_REALLY_IWMMXT"
475
  "wqmiabt%?\\t%0, %2, %3"
476
  [(set_attr "predicable" "yes")
477
   (set_attr "wtype" "wqmiaxy")]
478
)
479
480
(define_insn "iwmmxt_wqmiatb"
481
  [(set (match_operand:V2SI                                  0 "register_operand" "=y")
482
        (unspec:V2SI [(match_operand:V2SI                    1 "register_operand" "0")
483
	              (zero_extract:V4HI (match_operand:V4HI 2 "register_operand" "y") (const_int 16) (const_int 16))
484
	              (zero_extract:V4HI (match_dup 2) (const_int 16) (const_int 48))
485
	              (zero_extract:V4HI (match_operand:V4HI 3 "register_operand" "y") (const_int 16) (const_int 0))
486
	              (zero_extract:V4HI (match_dup 3) (const_int 16) (const_int 32))] UNSPEC_WQMIAxy))]
487
  "TARGET_REALLY_IWMMXT"
488
  "wqmiatb%?\\t%0, %2, %3"
489
  [(set_attr "predicable" "yes")
490
   (set_attr "wtype" "wqmiaxy")]
491
)
492
493
(define_insn "iwmmxt_wqmiatt"
494
  [(set (match_operand:V2SI                                  0 "register_operand" "=y")
495
        (unspec:V2SI [(match_operand:V2SI                    1 "register_operand" "0")
496
	              (zero_extract:V4HI (match_operand:V4HI 2 "register_operand" "y") (const_int 16) (const_int 16))
497
	              (zero_extract:V4HI (match_dup 2) (const_int 16) (const_int 48))
498
	              (zero_extract:V4HI (match_operand:V4HI 3 "register_operand" "y") (const_int 16) (const_int 16))
499
	              (zero_extract:V4HI (match_dup 3) (const_int 16) (const_int 48))] UNSPEC_WQMIAxy))]
500
  "TARGET_REALLY_IWMMXT"
501
  "wqmiatt%?\\t%0, %2, %3"
502
  [(set_attr "predicable" "yes")
503
   (set_attr "wtype" "wqmiaxy")]
504
)
505
506
(define_insn "iwmmxt_wqmiabbn"
507
  [(set (match_operand:V2SI                                  0 "register_operand" "=y")
508
        (unspec:V2SI [(match_operand:V2SI                    1 "register_operand" "0")
509
                      (zero_extract:V4HI (match_operand:V4HI 2 "register_operand" "y") (const_int 16) (const_int 0))
510
	              (zero_extract:V4HI (match_dup 2) (const_int 16) (const_int 32))
511
	              (zero_extract:V4HI (match_operand:V4HI 3 "register_operand" "y") (const_int 16) (const_int 0))
512
	              (zero_extract:V4HI (match_dup 3) (const_int 16) (const_int 32))] UNSPEC_WQMIAxyn))]
513
  "TARGET_REALLY_IWMMXT"
514
  "wqmiabbn%?\\t%0, %2, %3"
515
  [(set_attr "predicable" "yes")
516
   (set_attr "wtype" "wqmiaxy")]
517
)
518
519
(define_insn "iwmmxt_wqmiabtn"
520
  [(set (match_operand:V2SI                                  0 "register_operand" "=y")
521
        (unspec:V2SI [(match_operand:V2SI                    1 "register_operand" "0")
522
                      (zero_extract:V4HI (match_operand:V4HI 2 "register_operand" "y") (const_int 16) (const_int 0))
523
	              (zero_extract:V4HI (match_dup 2) (const_int 16) (const_int 32))
524
	              (zero_extract:V4HI (match_operand:V4HI 3 "register_operand" "y") (const_int 16) (const_int 16))
525
	              (zero_extract:V4HI (match_dup 3) (const_int 16) (const_int 48))] UNSPEC_WQMIAxyn))]
526
  "TARGET_REALLY_IWMMXT"
527
  "wqmiabtn%?\\t%0, %2, %3"
528
  [(set_attr "predicable" "yes")
529
   (set_attr "wtype" "wqmiaxy")]
530
)
531
532
(define_insn "iwmmxt_wqmiatbn"
533
  [(set (match_operand:V2SI                                  0 "register_operand" "=y")
534
        (unspec:V2SI [(match_operand:V2SI                    1 "register_operand" "0")
535
                      (zero_extract:V4HI (match_operand:V4HI 2 "register_operand" "y") (const_int 16) (const_int 16))
536
	              (zero_extract:V4HI (match_dup 2) (const_int 16) (const_int 48))
537
	              (zero_extract:V4HI (match_operand:V4HI 3 "register_operand" "y") (const_int 16) (const_int 0))
538
	              (zero_extract:V4HI (match_dup 3) (const_int 16) (const_int 32))] UNSPEC_WQMIAxyn))]
539
  "TARGET_REALLY_IWMMXT"
540
  "wqmiatbn%?\\t%0, %2, %3"
541
  [(set_attr "predicable" "yes")
542
   (set_attr "wtype" "wqmiaxy")]
543
)
544
545
(define_insn "iwmmxt_wqmiattn"
546
 [(set (match_operand:V2SI                                  0 "register_operand" "=y")
547
       (unspec:V2SI [(match_operand:V2SI                    1 "register_operand" "0")
548
                     (zero_extract:V4HI (match_operand:V4HI 2 "register_operand" "y") (const_int 16) (const_int 16))
549
	             (zero_extract:V4HI (match_dup 2) (const_int 16) (const_int 48))
550
	             (zero_extract:V4HI (match_operand:V4HI 3 "register_operand" "y") (const_int 16) (const_int 16))
551
	             (zero_extract:V4HI (match_dup 3) (const_int 16) (const_int 48))] UNSPEC_WQMIAxyn))]
552
  "TARGET_REALLY_IWMMXT"
553
  "wqmiattn%?\\t%0, %2, %3"
554
  [(set_attr "predicable" "yes")
555
   (set_attr "wtype" "wqmiaxy")]
556
)
557
558
(define_insn "iwmmxt_wmiabb"
559
  [(set	(match_operand:DI	                          0 "register_operand" "=y")
560
	(plus:DI (match_operand:DI	                  1 "register_operand" "0")
561
		 (plus:DI
562
		   (mult:DI
563
		     (sign_extend:DI
564
		       (vec_select:HI (match_operand:V4HI 2 "register_operand" "y")
565
				      (parallel [(const_int 0)])))
566
		     (sign_extend:DI
567
		       (vec_select:HI (match_operand:V4HI 3 "register_operand" "y")
568
				      (parallel [(const_int 0)]))))
569
		   (mult:DI
570
		     (sign_extend:DI
571
		       (vec_select:HI (match_dup 2)
572
			              (parallel [(const_int 2)])))
573
		     (sign_extend:DI
574
		       (vec_select:HI (match_dup 3)
575
				      (parallel [(const_int 2)])))))))]
576
  "TARGET_REALLY_IWMMXT"
577
  "wmiabb%?\\t%0, %2, %3"
578
  [(set_attr "predicable" "yes")
579
   (set_attr "wtype" "wmiaxy")]
580
)
581
582
(define_insn "iwmmxt_wmiabt"
583
  [(set	(match_operand:DI	                          0 "register_operand" "=y")
584
	(plus:DI (match_operand:DI	                  1 "register_operand" "0")
585
		 (plus:DI
586
		   (mult:DI
587
		     (sign_extend:DI
588
		       (vec_select:HI (match_operand:V4HI 2 "register_operand" "y")
589
				      (parallel [(const_int 0)])))
590
		     (sign_extend:DI
591
		       (vec_select:HI (match_operand:V4HI 3 "register_operand" "y")
592
				      (parallel [(const_int 1)]))))
593
		   (mult:DI
594
		     (sign_extend:DI
595
		       (vec_select:HI (match_dup 2)
596
				      (parallel [(const_int 2)])))
597
		     (sign_extend:DI
598
		       (vec_select:HI (match_dup 3)
599
				      (parallel [(const_int 3)])))))))]
600
  "TARGET_REALLY_IWMMXT"
601
  "wmiabt%?\\t%0, %2, %3"
602
  [(set_attr "predicable" "yes")
603
   (set_attr "wtype" "wmiaxy")]
604
)
605
606
(define_insn "iwmmxt_wmiatb"
607
  [(set	(match_operand:DI	                          0 "register_operand" "=y")
608
	(plus:DI (match_operand:DI	                  1 "register_operand" "0")
609
		 (plus:DI
610
		   (mult:DI
611
		     (sign_extend:DI
612
		       (vec_select:HI (match_operand:V4HI 2 "register_operand" "y")
613
				      (parallel [(const_int 1)])))
614
		     (sign_extend:DI
615
		       (vec_select:HI (match_operand:V4HI 3 "register_operand" "y")
616
				      (parallel [(const_int 0)]))))
617
		   (mult:DI
618
		     (sign_extend:DI
619
		       (vec_select:HI (match_dup 2)
620
				      (parallel [(const_int 3)])))
621
		     (sign_extend:DI
622
		       (vec_select:HI (match_dup 3)
623
				      (parallel [(const_int 2)])))))))]
624
  "TARGET_REALLY_IWMMXT"
625
  "wmiatb%?\\t%0, %2, %3"
626
  [(set_attr "predicable" "yes")
627
   (set_attr "wtype" "wmiaxy")]
628
)
629
630
(define_insn "iwmmxt_wmiatt"
631
  [(set	(match_operand:DI	                   0 "register_operand" "=y")
632
        (plus:DI (match_operand:DI	           1 "register_operand" "0")
633
          (plus:DI
634
            (mult:DI
635
              (sign_extend:DI
636
                (vec_select:HI (match_operand:V4HI 2 "register_operand" "y")
637
	                       (parallel [(const_int 1)])))
638
	      (sign_extend:DI
639
	        (vec_select:HI (match_operand:V4HI 3 "register_operand" "y")
640
	                       (parallel [(const_int 1)]))))
641
            (mult:DI
642
	      (sign_extend:DI
643
                (vec_select:HI (match_dup 2)
644
	                       (parallel [(const_int 3)])))
645
              (sign_extend:DI
646
                (vec_select:HI (match_dup 3)
647
	                       (parallel [(const_int 3)])))))))]
648
  "TARGET_REALLY_IWMMXT"
649
  "wmiatt%?\\t%0, %2, %3"
650
  [(set_attr "predicable" "yes")
651
   (set_attr "wtype" "wmiaxy")]
652
)
653
654
(define_insn "iwmmxt_wmiabbn"
655
  [(set	(match_operand:DI	                           0 "register_operand" "=y")
656
	(minus:DI (match_operand:DI	                   1 "register_operand" "0")
657
		  (plus:DI
658
		    (mult:DI
659
		      (sign_extend:DI
660
			(vec_select:HI (match_operand:V4HI 2 "register_operand" "y")
661
				       (parallel [(const_int 0)])))
662
		      (sign_extend:DI
663
		        (vec_select:HI (match_operand:V4HI 3 "register_operand" "y")
664
				       (parallel [(const_int 0)]))))
665
		    (mult:DI
666
		      (sign_extend:DI
667
			(vec_select:HI (match_dup 2)
668
				       (parallel [(const_int 2)])))
669
		      (sign_extend:DI
670
		        (vec_select:HI (match_dup 3)
671
				       (parallel [(const_int 2)])))))))]
672
  "TARGET_REALLY_IWMMXT"
673
  "wmiabbn%?\\t%0, %2, %3"
674
  [(set_attr "predicable" "yes")
675
   (set_attr "wtype" "wmiaxy")]
676
)
677
678
(define_insn "iwmmxt_wmiabtn"
679
  [(set	(match_operand:DI	                           0 "register_operand" "=y")
680
	(minus:DI (match_operand:DI	                   1 "register_operand" "0")
681
		  (plus:DI
682
		    (mult:DI
683
		      (sign_extend:DI
684
			(vec_select:HI (match_operand:V4HI 2 "register_operand" "y")
685
				       (parallel [(const_int 0)])))
686
		      (sign_extend:DI
687
		        (vec_select:HI (match_operand:V4HI 3 "register_operand" "y")
688
				       (parallel [(const_int 1)]))))
689
		    (mult:DI
690
		      (sign_extend:DI
691
		        (vec_select:HI (match_dup 2)
692
				       (parallel [(const_int 2)])))
693
		      (sign_extend:DI
694
			(vec_select:HI (match_dup 3)
695
				       (parallel [(const_int 3)])))))))]
696
  "TARGET_REALLY_IWMMXT"
697
  "wmiabtn%?\\t%0, %2, %3"
698
  [(set_attr "predicable" "yes")
699
   (set_attr "wtype" "wmiaxy")]
700
)
701
702
(define_insn "iwmmxt_wmiatbn"
703
  [(set (match_operand:DI	                           0 "register_operand" "=y")
704
	(minus:DI (match_operand:DI	                   1 "register_operand" "0")
705
		  (plus:DI
706
		    (mult:DI
707
		      (sign_extend:DI
708
			(vec_select:HI (match_operand:V4HI 2 "register_operand" "y")
709
				       (parallel [(const_int 1)])))
710
		      (sign_extend:DI
711
		        (vec_select:HI (match_operand:V4HI 3 "register_operand" "y")
712
				       (parallel [(const_int 0)]))))
713
		    (mult:DI
714
		      (sign_extend:DI
715
		        (vec_select:HI (match_dup 2)
716
				       (parallel [(const_int 3)])))
717
		      (sign_extend:DI
718
			(vec_select:HI (match_dup 3)
719
				       (parallel [(const_int 2)])))))))]
720
  "TARGET_REALLY_IWMMXT"
721
  "wmiatbn%?\\t%0, %2, %3"
722
  [(set_attr "predicable" "yes")
723
   (set_attr "wtype" "wmiaxy")]
724
)
725
726
(define_insn "iwmmxt_wmiattn"
727
  [(set (match_operand:DI	                           0 "register_operand" "=y")
728
	(minus:DI (match_operand:DI	                   1 "register_operand" "0")
729
		  (plus:DI
730
		    (mult:DI
731
		      (sign_extend:DI
732
			(vec_select:HI (match_operand:V4HI 2 "register_operand" "y")
733
				       (parallel [(const_int 1)])))
734
		      (sign_extend:DI
735
			(vec_select:HI (match_operand:V4HI 3 "register_operand" "y")
736
				       (parallel [(const_int 1)]))))
737
		    (mult:DI
738
		      (sign_extend:DI
739
			(vec_select:HI (match_dup 2)
740
				       (parallel [(const_int 3)])))
741
		      (sign_extend:DI
742
			(vec_select:HI (match_dup 3)
743
				       (parallel [(const_int 3)])))))))]
744
  "TARGET_REALLY_IWMMXT"
745
  "wmiattn%?\\t%0, %2, %3"
746
  [(set_attr "predicable" "yes")
747
   (set_attr "wtype" "wmiaxy")]
748
)
749
750
(define_insn "iwmmxt_wmiawbb"
751
  [(set (match_operand:DI	0 "register_operand" "=y")
752
	(plus:DI
753
	  (match_operand:DI      1 "register_operand" "0")
754
	  (mult:DI
755
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 2 "register_operand" "y") (parallel [(const_int 0)])))
756
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 3 "register_operand" "y") (parallel [(const_int 0)]))))))]
757
  "TARGET_REALLY_IWMMXT"
758
  "wmiawbb%?\\t%0, %2, %3"
759
  [(set_attr "predicable" "yes")
760
   (set_attr "wtype" "wmiawxy")]
761
)
762
763
(define_insn "iwmmxt_wmiawbt"
764
  [(set (match_operand:DI	                               0 "register_operand" "=y")
765
	(plus:DI
766
	  (match_operand:DI                                    1 "register_operand" "0")
767
	  (mult:DI
768
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 2 "register_operand" "y") (parallel [(const_int 0)])))
769
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 3 "register_operand" "y") (parallel [(const_int 1)]))))))]
770
  "TARGET_REALLY_IWMMXT"
771
  "wmiawbt%?\\t%0, %2, %3"
772
  [(set_attr "predicable" "yes")
773
   (set_attr "wtype" "wmiawxy")]
774
)
775
776
(define_insn "iwmmxt_wmiawtb"
777
  [(set (match_operand:DI	                               0 "register_operand" "=y")
778
	(plus:DI
779
	  (match_operand:DI                                    1 "register_operand" "0")
780
	  (mult:DI
781
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 2 "register_operand" "y") (parallel [(const_int 1)])))
782
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 3 "register_operand" "y") (parallel [(const_int 0)]))))))]
783
  "TARGET_REALLY_IWMMXT"
784
  "wmiawtb%?\\t%0, %2, %3"
785
  [(set_attr "predicable" "yes")
786
   (set_attr "wtype" "wmiawxy")]
787
)
788
789
(define_insn "iwmmxt_wmiawtt"
790
[(set (match_operand:DI	                                     0 "register_operand" "=y")
791
      (plus:DI
792
	(match_operand:DI                                    1 "register_operand" "0")
793
	(mult:DI
794
	  (sign_extend:DI (vec_select:SI (match_operand:V2SI 2 "register_operand" "y") (parallel [(const_int 1)])))
795
	  (sign_extend:DI (vec_select:SI (match_operand:V2SI 3 "register_operand" "y") (parallel [(const_int 1)]))))))]
796
  "TARGET_REALLY_IWMMXT"
797
  "wmiawtt%?\\t%0, %2, %3"
798
  [(set_attr "predicable" "yes")
799
   (set_attr "wtype" "wmiawxy")]
800
)
801
802
(define_insn "iwmmxt_wmiawbbn"
803
  [(set (match_operand:DI	                               0 "register_operand" "=y")
804
	(minus:DI
805
	  (match_operand:DI                                    1 "register_operand" "0")
806
	  (mult:DI
807
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 2 "register_operand" "y") (parallel [(const_int 0)])))
808
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 3 "register_operand" "y") (parallel [(const_int 0)]))))))]
809
  "TARGET_REALLY_IWMMXT"
810
  "wmiawbbn%?\\t%0, %2, %3"
811
  [(set_attr "predicable" "yes")
812
   (set_attr "wtype" "wmiawxy")]
813
)
814
815
(define_insn "iwmmxt_wmiawbtn"
816
  [(set (match_operand:DI	                               0 "register_operand" "=y")
817
	(minus:DI
818
	  (match_operand:DI                                    1 "register_operand" "0")
819
	  (mult:DI
820
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 2 "register_operand" "y") (parallel [(const_int 0)])))
821
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 3 "register_operand" "y") (parallel [(const_int 1)]))))))]
822
  "TARGET_REALLY_IWMMXT"
823
  "wmiawbtn%?\\t%0, %2, %3"
824
  [(set_attr "predicable" "yes")
825
   (set_attr "wtype" "wmiawxy")]
826
)
827
828
(define_insn "iwmmxt_wmiawtbn"
829
  [(set (match_operand:DI	                               0 "register_operand" "=y")
830
	(minus:DI
831
	  (match_operand:DI                                    1 "register_operand" "0")
832
	  (mult:DI
833
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 2 "register_operand" "y") (parallel [(const_int 1)])))
834
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 3 "register_operand" "y") (parallel [(const_int 0)]))))))]
835
  "TARGET_REALLY_IWMMXT"
836
  "wmiawtbn%?\\t%0, %2, %3"
837
  [(set_attr "predicable" "yes")
838
   (set_attr "wtype" "wmiawxy")]
839
)
840
841
(define_insn "iwmmxt_wmiawttn"
842
  [(set (match_operand:DI	                               0 "register_operand" "=y")
843
	(minus:DI
844
	  (match_operand:DI                                    1 "register_operand" "0")
845
	  (mult:DI
846
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 2 "register_operand" "y") (parallel [(const_int 1)])))
847
	    (sign_extend:DI (vec_select:SI (match_operand:V2SI 3 "register_operand" "y") (parallel [(const_int 1)]))))))]
848
  "TARGET_REALLY_IWMMXT"
849
  "wmiawttn%?\\t%0, %2, %3"
850
  [(set_attr "predicable" "yes")
851
   (set_attr "wtype" "wmiawxy")]
852
)
853
854
(define_insn "iwmmxt_wmerge"
855
  [(set (match_operand:DI         0 "register_operand" "=y")
856
	(ior:DI
857
	  (ashift:DI
858
	    (match_operand:DI     2 "register_operand" "y")
859
	    (minus:SI
860
	      (const_int 64)
861
	      (mult:SI
862
	        (match_operand:SI 3 "immediate_operand" "i")
863
		(const_int 8))))
864
	  (lshiftrt:DI
865
	    (ashift:DI
866
	      (match_operand:DI   1 "register_operand" "y")
867
	      (mult:SI
868
	        (match_dup 3)
869
		(const_int 8)))
870
	    (mult:SI
871
	      (match_dup 3)
872
	      (const_int 8)))))]
873
  "TARGET_REALLY_IWMMXT"
874
  "wmerge%?\\t%0, %1, %2, %3"
875
  [(set_attr "predicable" "yes")
876
   (set_attr "wtype" "wmerge")]
877
)
878
879
(define_insn "iwmmxt_tandc<mode>3"
880
  [(set (reg:CC CC_REGNUM)
881
	(subreg:CC (unspec:VMMX [(const_int 0)] UNSPEC_TANDC) 0))
882
   (unspec:CC [(reg:SI 15)] UNSPEC_TANDC)]
883
  "TARGET_REALLY_IWMMXT"
884
  "tandc<MMX_char>%?\\t r15"
885
  [(set_attr "predicable" "yes")
886
   (set_attr "wtype" "tandc")]
887
)
888
889
(define_insn "iwmmxt_torc<mode>3"
890
  [(set (reg:CC CC_REGNUM)
891
	(subreg:CC (unspec:VMMX [(const_int 0)] UNSPEC_TORC) 0))
892
   (unspec:CC [(reg:SI 15)] UNSPEC_TORC)]
893
  "TARGET_REALLY_IWMMXT"
894
  "torc<MMX_char>%?\\t r15"
895
  [(set_attr "predicable" "yes")
896
   (set_attr "wtype" "torc")]
897
)
898
899
(define_insn "iwmmxt_torvsc<mode>3"
900
  [(set (reg:CC CC_REGNUM)
901
	(subreg:CC (unspec:VMMX [(const_int 0)] UNSPEC_TORVSC) 0))
902
   (unspec:CC [(reg:SI 15)] UNSPEC_TORVSC)]
903
  "TARGET_REALLY_IWMMXT"
904
  "torvsc<MMX_char>%?\\t r15"
905
  [(set_attr "predicable" "yes")
906
   (set_attr "wtype" "torvsc")]
907
)
908
909
(define_insn "iwmmxt_textrc<mode>3"
910
  [(set (reg:CC CC_REGNUM)
911
	(subreg:CC (unspec:VMMX [(const_int 0)
912
		                 (match_operand:SI 0 "immediate_operand" "i")] UNSPEC_TEXTRC) 0))
913
   (unspec:CC [(reg:SI 15)] UNSPEC_TEXTRC)]
914
  "TARGET_REALLY_IWMMXT"
915
  "textrc<MMX_char>%?\\t r15, %0"
916
  [(set_attr "predicable" "yes")
917
   (set_attr "wtype" "textrc")]
918
)
(-)gcc/config/arm/iwmmxt.md (-655 / +1100 lines)
Lines 1-6 Link Here
1
;; ??? This file needs auditing for thumb2
2
;; Patterns for the Intel Wireless MMX technology architecture.
1
;; Patterns for the Intel Wireless MMX technology architecture.
3
;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2010
2
;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2010, 2012
4
;; Free Software Foundation, Inc.
3
;; Free Software Foundation, Inc.
5
;; Contributed by Red Hat.
4
;; Contributed by Red Hat.
6
5
Lines 20-25 Link Here
20
;; along with GCC; see the file COPYING3.  If not see
19
;; along with GCC; see the file COPYING3.  If not see
21
;; <http://www.gnu.org/licenses/>.
20
;; <http://www.gnu.org/licenses/>.
22
21
22
;; Register numbers
23
(define_constants
24
  [(WCGR0           43)
25
   (WCGR1           44)
26
   (WCGR2           45)
27
   (WCGR3           46)
28
  ]
29
)
30
31
(define_insn "tbcstv8qi"
32
  [(set (match_operand:V8QI                   0 "register_operand" "=y")
33
        (vec_duplicate:V8QI (match_operand:QI 1 "s_register_operand" "r")))]
34
  "TARGET_REALLY_IWMMXT"
35
  "tbcstb%?\\t%0, %1"
36
  [(set_attr "predicable" "yes")
37
   (set_attr "wtype" "tbcst")]
38
)
39
40
(define_insn "tbcstv4hi"
41
  [(set (match_operand:V4HI                   0 "register_operand" "=y")
42
        (vec_duplicate:V4HI (match_operand:HI 1 "s_register_operand" "r")))]
43
  "TARGET_REALLY_IWMMXT"
44
  "tbcsth%?\\t%0, %1"
45
  [(set_attr "predicable" "yes")
46
   (set_attr "wtype" "tbcst")]
47
)
48
49
(define_insn "tbcstv2si"
50
  [(set (match_operand:V2SI                   0 "register_operand" "=y")
51
        (vec_duplicate:V2SI (match_operand:SI 1 "s_register_operand" "r")))]
52
  "TARGET_REALLY_IWMMXT"
53
  "tbcstw%?\\t%0, %1"
54
  [(set_attr "predicable" "yes")
55
   (set_attr "wtype" "tbcst")]
56
)
23
57
24
(define_insn "iwmmxt_iordi3"
58
(define_insn "iwmmxt_iordi3"
25
  [(set (match_operand:DI         0 "register_operand" "=y,?&r,?&r")
59
  [(set (match_operand:DI         0 "register_operand" "=y,?&r,?&r")
Lines 31-37 Link Here
31
   #
65
   #
32
   #"
66
   #"
33
  [(set_attr "predicable" "yes")
67
  [(set_attr "predicable" "yes")
34
   (set_attr "length" "4,8,8")])
68
   (set_attr "length" "4,8,8")
69
   (set_attr "wtype" "wor,none,none")]
70
)
35
71
36
(define_insn "iwmmxt_xordi3"
72
(define_insn "iwmmxt_xordi3"
37
  [(set (match_operand:DI         0 "register_operand" "=y,?&r,?&r")
73
  [(set (match_operand:DI         0 "register_operand" "=y,?&r,?&r")
Lines 43-49 Link Here
43
   #
79
   #
44
   #"
80
   #"
45
  [(set_attr "predicable" "yes")
81
  [(set_attr "predicable" "yes")
46
   (set_attr "length" "4,8,8")])
82
   (set_attr "length" "4,8,8")
83
   (set_attr "wtype" "wxor,none,none")]
84
)
47
85
48
(define_insn "iwmmxt_anddi3"
86
(define_insn "iwmmxt_anddi3"
49
  [(set (match_operand:DI         0 "register_operand" "=y,?&r,?&r")
87
  [(set (match_operand:DI         0 "register_operand" "=y,?&r,?&r")
Lines 55-61 Link Here
55
   #
93
   #
56
   #"
94
   #"
57
  [(set_attr "predicable" "yes")
95
  [(set_attr "predicable" "yes")
58
   (set_attr "length" "4,8,8")])
96
   (set_attr "length" "4,8,8")
97
   (set_attr "wtype" "wand,none,none")]
98
)
59
99
60
(define_insn "iwmmxt_nanddi3"
100
(define_insn "iwmmxt_nanddi3"
61
  [(set (match_operand:DI                 0 "register_operand" "=y")
101
  [(set (match_operand:DI                 0 "register_operand" "=y")
Lines 63-126 Link Here
63
		(not:DI (match_operand:DI 2 "register_operand"  "y"))))]
103
		(not:DI (match_operand:DI 2 "register_operand"  "y"))))]
64
  "TARGET_REALLY_IWMMXT"
104
  "TARGET_REALLY_IWMMXT"
65
  "wandn%?\\t%0, %1, %2"
105
  "wandn%?\\t%0, %1, %2"
66
  [(set_attr "predicable" "yes")])
106
  [(set_attr "predicable" "yes")
107
   (set_attr "wtype" "wandn")]
108
)
67
109
68
(define_insn "*iwmmxt_arm_movdi"
110
(define_insn "*iwmmxt_arm_movdi"
69
  [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, m,y,y,yr,y,yrUy")
111
  [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, r, r, m,y,y,yr,y,yrUy,*w, r,*w,*w, *Uv")
70
	(match_operand:DI 1 "di_operand"              "rIK,mi,r,y,yr,y,yrUy,y"))]
112
        (match_operand:DI 1 "di_operand"              "rDa,Db,Dc,mi,r,y,yr,y,yrUy,y, r,*w,*w,*Uvi,*w"))]
71
  "TARGET_REALLY_IWMMXT
113
  "TARGET_REALLY_IWMMXT
72
   && (   register_operand (operands[0], DImode)
114
   && (   register_operand (operands[0], DImode)
73
       || register_operand (operands[1], DImode))"
115
       || register_operand (operands[1], DImode))"
74
  "*
116
  "*
75
{
76
  switch (which_alternative)
117
  switch (which_alternative)
77
    {
118
    {
78
    default:
79
      return output_move_double (operands, true, NULL);
80
    case 0:
119
    case 0:
120
    case 1:
121
    case 2:
81
      return \"#\";
122
      return \"#\";
82
    case 3:
123
    case 3: case 4:
124
      return output_move_double (operands, true, NULL);
125
    case 5:
83
      return \"wmov%?\\t%0,%1\";
126
      return \"wmov%?\\t%0,%1\";
84
    case 4:
127
    case 6:
85
      return \"tmcrr%?\\t%0,%Q1,%R1\";
128
      return \"tmcrr%?\\t%0,%Q1,%R1\";
86
    case 5:
129
    case 7:
87
      return \"tmrrc%?\\t%Q0,%R0,%1\";
130
      return \"tmrrc%?\\t%Q0,%R0,%1\";
88
    case 6:
131
    case 8:
89
      return \"wldrd%?\\t%0,%1\";
132
      return \"wldrd%?\\t%0,%1\";
90
    case 7:
133
    case 9:
91
      return \"wstrd%?\\t%1,%0\";
134
      return \"wstrd%?\\t%1,%0\";
135
    case 10:
136
      return \"fmdrr%?\\t%P0, %Q1, %R1\\t%@ int\";
137
    case 11:
138
      return \"fmrrd%?\\t%Q0, %R0, %P1\\t%@ int\";
139
    case 12:
140
      if (TARGET_VFP_SINGLE)
141
	return \"fcpys%?\\t%0, %1\\t%@ int\;fcpys%?\\t%p0, %p1\\t%@ int\";
142
      else
143
	return \"fcpyd%?\\t%P0, %P1\\t%@ int\";
144
    case 13: case 14:
145
      return output_move_vfp (operands);
146
    default:
147
      gcc_unreachable ();
92
    }
148
    }
93
}"
149
  "
94
  [(set_attr "length"         "8,8,8,4,4,4,4,4")
150
  [(set (attr "length") (cond [(eq_attr "alternative" "0,3,4") (const_int 8)
95
   (set_attr "type"           "*,load1,store2,*,*,*,*,*")
151
                              (eq_attr "alternative" "1") (const_int 12)
96
   (set_attr "pool_range"     "*,1020,*,*,*,*,*,*")
152
                              (eq_attr "alternative" "2") (const_int 16)
97
   (set_attr "neg_pool_range" "*,1012,*,*,*,*,*,*")]
153
                              (eq_attr "alternative" "12")
154
                               (if_then_else
155
                                 (eq (symbol_ref "TARGET_VFP_SINGLE") (const_int 1))
156
                                 (const_int 8)
157
                                 (const_int 4))]
158
                              (const_int 4)))
159
   (set_attr "type" "*,*,*,load2,store2,*,*,*,*,*,r_2_f,f_2_r,ffarithd,f_loadd,f_stored")
160
   (set_attr "arm_pool_range" "*,*,*,1020,*,*,*,*,*,*,*,*,*,1020,*")
161
   (set_attr "arm_neg_pool_range" "*,*,*,1008,*,*,*,*,*,*,*,*,*,1008,*")
162
   (set_attr "wtype" "*,*,*,*,*,wmov,tmcrr,tmrrc,wldr,wstr,*,*,*,*,*")]
98
)
163
)
99
164
100
(define_insn "*iwmmxt_movsi_insn"
165
(define_insn "*iwmmxt_movsi_insn"
101
  [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,rk, m,z,r,?z,Uy,z")
166
  [(set (match_operand:SI 0 "nonimmediate_operand" "=rk,r,r,r,rk, m,z,r,?z,?Uy,*t, r,*t,*t  ,*Uv")
102
	(match_operand:SI 1 "general_operand"      "rk, I,K,mi,rk,r,z,Uy,z, z"))]
167
	(match_operand:SI 1 "general_operand"      " rk,I,K,j,mi,rk,r,z,Uy,  z, r,*t,*t,*Uvi, *t"))]
103
  "TARGET_REALLY_IWMMXT
168
  "TARGET_REALLY_IWMMXT
104
   && (   register_operand (operands[0], SImode)
169
   && (   register_operand (operands[0], SImode)
105
       || register_operand (operands[1], SImode))"
170
       || register_operand (operands[1], SImode))"
106
  "*
171
  "*
107
   switch (which_alternative)
172
   switch (which_alternative)
108
   {
173
     {
109
   case 0: return \"mov\\t%0, %1\";
174
     case 0: return \"mov\\t%0, %1\";
110
   case 1: return \"mov\\t%0, %1\";
175
     case 1: return \"mov\\t%0, %1\";
111
   case 2: return \"mvn\\t%0, #%B1\";
176
     case 2: return \"mvn\\t%0, #%B1\";
112
   case 3: return \"ldr\\t%0, %1\";
177
     case 3: return \"movw\\t%0, %1\";
113
   case 4: return \"str\\t%1, %0\";
178
     case 4: return \"ldr\\t%0, %1\";
114
   case 5: return \"tmcr\\t%0, %1\";
179
     case 5: return \"str\\t%1, %0\";
115
   case 6: return \"tmrc\\t%0, %1\";
180
     case 6: return \"tmcr\\t%0, %1\";
116
   case 7: return arm_output_load_gr (operands);
181
     case 7: return \"tmrc\\t%0, %1\";
117
   case 8: return \"wstrw\\t%1, %0\";
182
     case 8: return arm_output_load_gr (operands);
118
   default:return \"wstrw\\t%1, [sp, #-4]!\;wldrw\\t%0, [sp], #4\\t@move CG reg\";
183
     case 9: return \"wstrw\\t%1, %0\";
119
  }"
184
     case 10:return \"fmsr\\t%0, %1\";
120
  [(set_attr "type"           "*,*,*,load1,store1,*,*,load1,store1,*")
185
     case 11:return \"fmrs\\t%0, %1\";
121
   (set_attr "length"         "*,*,*,*,        *,*,*,  16,     *,8")
186
     case 12:return \"fcpys\\t%0, %1\\t%@ int\";
122
   (set_attr "pool_range"     "*,*,*,4096,     *,*,*,1024,     *,*")
187
     case 13: case 14:
123
   (set_attr "neg_pool_range" "*,*,*,4084,     *,*,*,   *,  1012,*")
188
       return output_move_vfp (operands);
189
     default:
190
       gcc_unreachable ();
191
     }"
192
  [(set_attr "type"           "*,*,*,*,load1,store1,*,*,*,*,r_2_f,f_2_r,fcpys,f_loads,f_stores")
193
   (set_attr "length"         "*,*,*,*,*,        *,*,*,  16,     *,*,*,*,*,*")
194
   (set_attr "pool_range"     "*,*,*,*,4096,     *,*,*,1024,     *,*,*,*,1020,*")
195
   (set_attr "neg_pool_range" "*,*,*,*,4084,     *,*,*,   *,  1012,*,*,*,1008,*")
124
   ;; Note - the "predicable" attribute is not allowed to have alternatives.
196
   ;; Note - the "predicable" attribute is not allowed to have alternatives.
125
   ;; Since the wSTRw wCx instruction is not predicable, we cannot support
197
   ;; Since the wSTRw wCx instruction is not predicable, we cannot support
126
   ;; predicating any of the alternatives in this template.  Instead,
198
   ;; predicating any of the alternatives in this template.  Instead,
Lines 129-135 Link Here
129
   ;; Also - we have to pretend that these insns clobber the condition code
201
   ;; Also - we have to pretend that these insns clobber the condition code
130
   ;; bits as otherwise arm_final_prescan_insn() will try to conditionalize
202
   ;; bits as otherwise arm_final_prescan_insn() will try to conditionalize
131
   ;; them.
203
   ;; them.
132
   (set_attr "conds" "clob")]
204
   (set_attr "conds" "clob")
205
   (set_attr "wtype" "*,*,*,*,*,*,tmcr,tmrc,wldr,wstr,*,*,*,*,*")]
133
)
206
)
134
207
135
;; Because iwmmxt_movsi_insn is not predicable, we provide the
208
;; Because iwmmxt_movsi_insn is not predicable, we provide the
Lines 177-195 Link Here
177
   }"
250
   }"
178
  [(set_attr "predicable" "yes")
251
  [(set_attr "predicable" "yes")
179
   (set_attr "length"         "4,     4,   4,4,4,8,   8,8")
252
   (set_attr "length"         "4,     4,   4,4,4,8,   8,8")
180
   (set_attr "type"           "*,store1,load1,*,*,*,load1,store1")
253
   (set_attr "type"           "*,*,*,*,*,*,load1,store1")
181
   (set_attr "pool_range"     "*,     *, 256,*,*,*, 256,*")
254
   (set_attr "pool_range"     "*,     *, 256,*,*,*, 256,*")
182
   (set_attr "neg_pool_range" "*,     *, 244,*,*,*, 244,*")])
255
   (set_attr "neg_pool_range" "*,     *, 244,*,*,*, 244,*")
256
   (set_attr "wtype"          "wmov,wstr,wldr,tmrrc,tmcrr,*,*,*")]
257
)
258
259
(define_expand "iwmmxt_setwcgr0"
260
  [(set (reg:SI WCGR0)
261
	(match_operand:SI 0 "register_operand"  ""))]
262
  "TARGET_REALLY_IWMMXT"
263
  {}
264
)
265
266
(define_expand "iwmmxt_setwcgr1"
267
  [(set (reg:SI WCGR1)
268
	(match_operand:SI 0 "register_operand"  ""))]
269
  "TARGET_REALLY_IWMMXT"
270
  {}
271
)
272
273
(define_expand "iwmmxt_setwcgr2"
274
  [(set (reg:SI WCGR2)
275
	(match_operand:SI 0 "register_operand"  ""))]
276
  "TARGET_REALLY_IWMMXT"
277
  {}
278
)
279
280
(define_expand "iwmmxt_setwcgr3"
281
  [(set (reg:SI WCGR3)
282
	(match_operand:SI 0 "register_operand"  ""))]
283
  "TARGET_REALLY_IWMMXT"
284
  {}
285
)
286
287
(define_expand "iwmmxt_getwcgr0"
288
  [(set (match_operand:SI 0 "register_operand"  "")
289
        (reg:SI WCGR0))]
290
  "TARGET_REALLY_IWMMXT"
291
  {}
292
)
293
294
(define_expand "iwmmxt_getwcgr1"
295
  [(set (match_operand:SI 0 "register_operand"  "")
296
        (reg:SI WCGR1))]
297
  "TARGET_REALLY_IWMMXT"
298
  {}
299
)
300
301
(define_expand "iwmmxt_getwcgr2"
302
  [(set (match_operand:SI 0 "register_operand"  "")
303
        (reg:SI WCGR2))]
304
  "TARGET_REALLY_IWMMXT"
305
  {}
306
)
307
308
(define_expand "iwmmxt_getwcgr3"
309
  [(set (match_operand:SI 0 "register_operand"  "")
310
        (reg:SI WCGR3))]
311
  "TARGET_REALLY_IWMMXT"
312
  {}
313
)
314
315
(define_insn "*and<mode>3_iwmmxt"
316
  [(set (match_operand:VMMX           0 "register_operand" "=y")
317
        (and:VMMX (match_operand:VMMX 1 "register_operand"  "y")
318
	          (match_operand:VMMX 2 "register_operand"  "y")))]
319
  "TARGET_REALLY_IWMMXT"
320
  "wand\\t%0, %1, %2"
321
  [(set_attr "predicable" "yes")
322
   (set_attr "wtype" "wand")]
323
)
324
325
(define_insn "*ior<mode>3_iwmmxt"
326
  [(set (match_operand:VMMX           0 "register_operand" "=y")
327
        (ior:VMMX (match_operand:VMMX 1 "register_operand"  "y")
328
	          (match_operand:VMMX 2 "register_operand"  "y")))]
329
  "TARGET_REALLY_IWMMXT"
330
  "wor\\t%0, %1, %2"
331
  [(set_attr "predicable" "yes")
332
   (set_attr "wtype" "wor")]
333
)
334
335
(define_insn "*xor<mode>3_iwmmxt"
336
  [(set (match_operand:VMMX           0 "register_operand" "=y")
337
        (xor:VMMX (match_operand:VMMX 1 "register_operand"  "y")
338
	          (match_operand:VMMX 2 "register_operand"  "y")))]
339
  "TARGET_REALLY_IWMMXT"
340
  "wxor\\t%0, %1, %2"
341
  [(set_attr "predicable" "yes")
342
   (set_attr "wtype" "wxor")]
343
)
344
183
345
184
;; Vector add/subtract
346
;; Vector add/subtract
185
347
186
(define_insn "*add<mode>3_iwmmxt"
348
(define_insn "*add<mode>3_iwmmxt"
187
  [(set (match_operand:VMMX            0 "register_operand" "=y")
349
  [(set (match_operand:VMMX            0 "register_operand" "=y")
188
        (plus:VMMX (match_operand:VMMX 1 "register_operand"  "y")
350
        (plus:VMMX (match_operand:VMMX 1 "register_operand" "y")
189
	           (match_operand:VMMX 2 "register_operand"  "y")))]
351
	           (match_operand:VMMX 2 "register_operand" "y")))]
190
  "TARGET_REALLY_IWMMXT"
352
  "TARGET_REALLY_IWMMXT"
191
  "wadd<MMX_char>%?\\t%0, %1, %2"
353
  "wadd<MMX_char>%?\\t%0, %1, %2"
192
  [(set_attr "predicable" "yes")])
354
  [(set_attr "predicable" "yes")
355
   (set_attr "wtype" "wadd")]
356
)
193
357
194
(define_insn "ssaddv8qi3"
358
(define_insn "ssaddv8qi3"
195
  [(set (match_operand:V8QI               0 "register_operand" "=y")
359
  [(set (match_operand:V8QI               0 "register_operand" "=y")
Lines 197-203 Link Here
197
		      (match_operand:V8QI 2 "register_operand"  "y")))]
361
		      (match_operand:V8QI 2 "register_operand"  "y")))]
198
  "TARGET_REALLY_IWMMXT"
362
  "TARGET_REALLY_IWMMXT"
199
  "waddbss%?\\t%0, %1, %2"
363
  "waddbss%?\\t%0, %1, %2"
200
  [(set_attr "predicable" "yes")])
364
  [(set_attr "predicable" "yes")
365
   (set_attr "wtype" "wadd")]
366
)
201
367
202
(define_insn "ssaddv4hi3"
368
(define_insn "ssaddv4hi3"
203
  [(set (match_operand:V4HI               0 "register_operand" "=y")
369
  [(set (match_operand:V4HI               0 "register_operand" "=y")
Lines 205-211 Link Here
205
		      (match_operand:V4HI 2 "register_operand"  "y")))]
371
		      (match_operand:V4HI 2 "register_operand"  "y")))]
206
  "TARGET_REALLY_IWMMXT"
372
  "TARGET_REALLY_IWMMXT"
207
  "waddhss%?\\t%0, %1, %2"
373
  "waddhss%?\\t%0, %1, %2"
208
  [(set_attr "predicable" "yes")])
374
  [(set_attr "predicable" "yes")
375
   (set_attr "wtype" "wadd")]
376
)
209
377
210
(define_insn "ssaddv2si3"
378
(define_insn "ssaddv2si3"
211
  [(set (match_operand:V2SI               0 "register_operand" "=y")
379
  [(set (match_operand:V2SI               0 "register_operand" "=y")
Lines 213-219 Link Here
213
		      (match_operand:V2SI 2 "register_operand"  "y")))]
381
		      (match_operand:V2SI 2 "register_operand"  "y")))]
214
  "TARGET_REALLY_IWMMXT"
382
  "TARGET_REALLY_IWMMXT"
215
  "waddwss%?\\t%0, %1, %2"
383
  "waddwss%?\\t%0, %1, %2"
216
  [(set_attr "predicable" "yes")])
384
  [(set_attr "predicable" "yes")
385
   (set_attr "wtype" "wadd")]
386
)
217
387
218
(define_insn "usaddv8qi3"
388
(define_insn "usaddv8qi3"
219
  [(set (match_operand:V8QI               0 "register_operand" "=y")
389
  [(set (match_operand:V8QI               0 "register_operand" "=y")
Lines 221-227 Link Here
221
		      (match_operand:V8QI 2 "register_operand"  "y")))]
391
		      (match_operand:V8QI 2 "register_operand"  "y")))]
222
  "TARGET_REALLY_IWMMXT"
392
  "TARGET_REALLY_IWMMXT"
223
  "waddbus%?\\t%0, %1, %2"
393
  "waddbus%?\\t%0, %1, %2"
224
  [(set_attr "predicable" "yes")])
394
  [(set_attr "predicable" "yes")
395
   (set_attr "wtype" "wadd")]
396
)
225
397
226
(define_insn "usaddv4hi3"
398
(define_insn "usaddv4hi3"
227
  [(set (match_operand:V4HI               0 "register_operand" "=y")
399
  [(set (match_operand:V4HI               0 "register_operand" "=y")
Lines 229-235 Link Here
229
		      (match_operand:V4HI 2 "register_operand"  "y")))]
401
		      (match_operand:V4HI 2 "register_operand"  "y")))]
230
  "TARGET_REALLY_IWMMXT"
402
  "TARGET_REALLY_IWMMXT"
231
  "waddhus%?\\t%0, %1, %2"
403
  "waddhus%?\\t%0, %1, %2"
232
  [(set_attr "predicable" "yes")])
404
  [(set_attr "predicable" "yes")
405
   (set_attr "wtype" "wadd")]
406
)
233
407
234
(define_insn "usaddv2si3"
408
(define_insn "usaddv2si3"
235
  [(set (match_operand:V2SI               0 "register_operand" "=y")
409
  [(set (match_operand:V2SI               0 "register_operand" "=y")
Lines 237-243 Link Here
237
		      (match_operand:V2SI 2 "register_operand"  "y")))]
411
		      (match_operand:V2SI 2 "register_operand"  "y")))]
238
  "TARGET_REALLY_IWMMXT"
412
  "TARGET_REALLY_IWMMXT"
239
  "waddwus%?\\t%0, %1, %2"
413
  "waddwus%?\\t%0, %1, %2"
240
  [(set_attr "predicable" "yes")])
414
  [(set_attr "predicable" "yes")
415
   (set_attr "wtype" "wadd")]
416
)
241
417
242
(define_insn "*sub<mode>3_iwmmxt"
418
(define_insn "*sub<mode>3_iwmmxt"
243
  [(set (match_operand:VMMX             0 "register_operand" "=y")
419
  [(set (match_operand:VMMX             0 "register_operand" "=y")
Lines 245-251 Link Here
245
		    (match_operand:VMMX 2 "register_operand"  "y")))]
421
		    (match_operand:VMMX 2 "register_operand"  "y")))]
246
  "TARGET_REALLY_IWMMXT"
422
  "TARGET_REALLY_IWMMXT"
247
  "wsub<MMX_char>%?\\t%0, %1, %2"
423
  "wsub<MMX_char>%?\\t%0, %1, %2"
248
  [(set_attr "predicable" "yes")])
424
  [(set_attr "predicable" "yes")
425
   (set_attr "wtype" "wsub")]
426
)
249
427
250
(define_insn "sssubv8qi3"
428
(define_insn "sssubv8qi3"
251
  [(set (match_operand:V8QI                0 "register_operand" "=y")
429
  [(set (match_operand:V8QI                0 "register_operand" "=y")
Lines 253-259 Link Here
253
		       (match_operand:V8QI 2 "register_operand"  "y")))]
431
		       (match_operand:V8QI 2 "register_operand"  "y")))]
254
  "TARGET_REALLY_IWMMXT"
432
  "TARGET_REALLY_IWMMXT"
255
  "wsubbss%?\\t%0, %1, %2"
433
  "wsubbss%?\\t%0, %1, %2"
256
  [(set_attr "predicable" "yes")])
434
  [(set_attr "predicable" "yes")
435
   (set_attr "wtype" "wsub")]
436
)
257
437
258
(define_insn "sssubv4hi3"
438
(define_insn "sssubv4hi3"
259
  [(set (match_operand:V4HI                0 "register_operand" "=y")
439
  [(set (match_operand:V4HI                0 "register_operand" "=y")
Lines 261-267 Link Here
261
		       (match_operand:V4HI 2 "register_operand" "y")))]
441
		       (match_operand:V4HI 2 "register_operand" "y")))]
262
  "TARGET_REALLY_IWMMXT"
442
  "TARGET_REALLY_IWMMXT"
263
  "wsubhss%?\\t%0, %1, %2"
443
  "wsubhss%?\\t%0, %1, %2"
264
  [(set_attr "predicable" "yes")])
444
  [(set_attr "predicable" "yes")
445
   (set_attr "wtype" "wsub")]
446
)
265
447
266
(define_insn "sssubv2si3"
448
(define_insn "sssubv2si3"
267
  [(set (match_operand:V2SI                0 "register_operand" "=y")
449
  [(set (match_operand:V2SI                0 "register_operand" "=y")
Lines 269-275 Link Here
269
		       (match_operand:V2SI 2 "register_operand" "y")))]
451
		       (match_operand:V2SI 2 "register_operand" "y")))]
270
  "TARGET_REALLY_IWMMXT"
452
  "TARGET_REALLY_IWMMXT"
271
  "wsubwss%?\\t%0, %1, %2"
453
  "wsubwss%?\\t%0, %1, %2"
272
  [(set_attr "predicable" "yes")])
454
  [(set_attr "predicable" "yes")
455
   (set_attr "wtype" "wsub")]
456
)
273
457
274
(define_insn "ussubv8qi3"
458
(define_insn "ussubv8qi3"
275
  [(set (match_operand:V8QI                0 "register_operand" "=y")
459
  [(set (match_operand:V8QI                0 "register_operand" "=y")
Lines 277-283 Link Here
277
		       (match_operand:V8QI 2 "register_operand" "y")))]
461
		       (match_operand:V8QI 2 "register_operand" "y")))]
278
  "TARGET_REALLY_IWMMXT"
462
  "TARGET_REALLY_IWMMXT"
279
  "wsubbus%?\\t%0, %1, %2"
463
  "wsubbus%?\\t%0, %1, %2"
280
  [(set_attr "predicable" "yes")])
464
  [(set_attr "predicable" "yes")
465
   (set_attr "wtype" "wsub")]
466
)
281
467
282
(define_insn "ussubv4hi3"
468
(define_insn "ussubv4hi3"
283
  [(set (match_operand:V4HI                0 "register_operand" "=y")
469
  [(set (match_operand:V4HI                0 "register_operand" "=y")
Lines 285-291 Link Here
285
		       (match_operand:V4HI 2 "register_operand" "y")))]
471
		       (match_operand:V4HI 2 "register_operand" "y")))]
286
  "TARGET_REALLY_IWMMXT"
472
  "TARGET_REALLY_IWMMXT"
287
  "wsubhus%?\\t%0, %1, %2"
473
  "wsubhus%?\\t%0, %1, %2"
288
  [(set_attr "predicable" "yes")])
474
  [(set_attr "predicable" "yes")
475
   (set_attr "wtype" "wsub")]
476
)
289
477
290
(define_insn "ussubv2si3"
478
(define_insn "ussubv2si3"
291
  [(set (match_operand:V2SI                0 "register_operand" "=y")
479
  [(set (match_operand:V2SI                0 "register_operand" "=y")
Lines 293-299 Link Here
293
		       (match_operand:V2SI 2 "register_operand" "y")))]
481
		       (match_operand:V2SI 2 "register_operand" "y")))]
294
  "TARGET_REALLY_IWMMXT"
482
  "TARGET_REALLY_IWMMXT"
295
  "wsubwus%?\\t%0, %1, %2"
483
  "wsubwus%?\\t%0, %1, %2"
296
  [(set_attr "predicable" "yes")])
484
  [(set_attr "predicable" "yes")
485
   (set_attr "wtype" "wsub")]
486
)
297
487
298
(define_insn "*mulv4hi3_iwmmxt"
488
(define_insn "*mulv4hi3_iwmmxt"
299
  [(set (match_operand:V4HI            0 "register_operand" "=y")
489
  [(set (match_operand:V4HI            0 "register_operand" "=y")
Lines 301-363 Link Here
301
		   (match_operand:V4HI 2 "register_operand" "y")))]
491
		   (match_operand:V4HI 2 "register_operand" "y")))]
302
  "TARGET_REALLY_IWMMXT"
492
  "TARGET_REALLY_IWMMXT"
303
  "wmulul%?\\t%0, %1, %2"
493
  "wmulul%?\\t%0, %1, %2"
304
  [(set_attr "predicable" "yes")])
494
  [(set_attr "predicable" "yes")
495
   (set_attr "wtype" "wmul")]
496
)
305
497
306
(define_insn "smulv4hi3_highpart"
498
(define_insn "smulv4hi3_highpart"
307
  [(set (match_operand:V4HI                                0 "register_operand" "=y")
499
  [(set (match_operand:V4HI 0 "register_operand" "=y")
308
	(truncate:V4HI
500
	  (truncate:V4HI
309
	 (lshiftrt:V4SI
501
	    (lshiftrt:V4SI
310
	  (mult:V4SI (sign_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
502
	      (mult:V4SI (sign_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
311
		     (sign_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
503
	                 (sign_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
312
	  (const_int 16))))]
504
	      (const_int 16))))]
313
  "TARGET_REALLY_IWMMXT"
505
  "TARGET_REALLY_IWMMXT"
314
  "wmulsm%?\\t%0, %1, %2"
506
  "wmulsm%?\\t%0, %1, %2"
315
  [(set_attr "predicable" "yes")])
507
  [(set_attr "predicable" "yes")
508
   (set_attr "wtype" "wmul")]
509
)
316
510
317
(define_insn "umulv4hi3_highpart"
511
(define_insn "umulv4hi3_highpart"
318
  [(set (match_operand:V4HI                                0 "register_operand" "=y")
512
  [(set (match_operand:V4HI 0 "register_operand" "=y")
319
	(truncate:V4HI
513
	  (truncate:V4HI
320
	 (lshiftrt:V4SI
514
	    (lshiftrt:V4SI
321
	  (mult:V4SI (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
515
	      (mult:V4SI (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
322
		     (zero_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
516
	                 (zero_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
323
	  (const_int 16))))]
517
	      (const_int 16))))]
324
  "TARGET_REALLY_IWMMXT"
518
  "TARGET_REALLY_IWMMXT"
325
  "wmulum%?\\t%0, %1, %2"
519
  "wmulum%?\\t%0, %1, %2"
326
  [(set_attr "predicable" "yes")])
520
  [(set_attr "predicable" "yes")
521
   (set_attr "wtype" "wmul")]
522
)
327
523
328
(define_insn "iwmmxt_wmacs"
524
(define_insn "iwmmxt_wmacs"
329
  [(set (match_operand:DI               0 "register_operand" "=y")
525
  [(set (match_operand:DI               0 "register_operand" "=y")
330
	(unspec:DI [(match_operand:DI   1 "register_operand" "0")
526
	(unspec:DI [(match_operand:DI   1 "register_operand" "0")
331
		    (match_operand:V4HI 2 "register_operand" "y")
527
	            (match_operand:V4HI 2 "register_operand" "y")
332
		    (match_operand:V4HI 3 "register_operand" "y")] UNSPEC_WMACS))]
528
	            (match_operand:V4HI 3 "register_operand" "y")] UNSPEC_WMACS))]
333
  "TARGET_REALLY_IWMMXT"
529
  "TARGET_REALLY_IWMMXT"
334
  "wmacs%?\\t%0, %2, %3"
530
  "wmacs%?\\t%0, %2, %3"
335
  [(set_attr "predicable" "yes")])
531
  [(set_attr "predicable" "yes")
532
   (set_attr "wtype" "wmac")]
533
)
336
534
337
(define_insn "iwmmxt_wmacsz"
535
(define_insn "iwmmxt_wmacsz"
338
  [(set (match_operand:DI               0 "register_operand" "=y")
536
  [(set (match_operand:DI               0 "register_operand" "=y")
339
	(unspec:DI [(match_operand:V4HI 1 "register_operand" "y")
537
	(unspec:DI [(match_operand:V4HI 1 "register_operand" "y")
340
		    (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMACSZ))]
538
	            (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMACSZ))]
341
  "TARGET_REALLY_IWMMXT"
539
  "TARGET_REALLY_IWMMXT"
342
  "wmacsz%?\\t%0, %1, %2"
540
  "wmacsz%?\\t%0, %1, %2"
343
  [(set_attr "predicable" "yes")])
541
  [(set_attr "predicable" "yes")
542
   (set_attr "wtype" "wmac")]
543
)
344
544
345
(define_insn "iwmmxt_wmacu"
545
(define_insn "iwmmxt_wmacu"
346
  [(set (match_operand:DI               0 "register_operand" "=y")
546
  [(set (match_operand:DI               0 "register_operand" "=y")
347
	(unspec:DI [(match_operand:DI   1 "register_operand" "0")
547
	(unspec:DI [(match_operand:DI   1 "register_operand" "0")
348
		    (match_operand:V4HI 2 "register_operand" "y")
548
	            (match_operand:V4HI 2 "register_operand" "y")
349
		    (match_operand:V4HI 3 "register_operand" "y")] UNSPEC_WMACU))]
549
	            (match_operand:V4HI 3 "register_operand" "y")] UNSPEC_WMACU))]
350
  "TARGET_REALLY_IWMMXT"
550
  "TARGET_REALLY_IWMMXT"
351
  "wmacu%?\\t%0, %2, %3"
551
  "wmacu%?\\t%0, %2, %3"
352
  [(set_attr "predicable" "yes")])
552
  [(set_attr "predicable" "yes")
553
   (set_attr "wtype" "wmac")]
554
)
353
555
354
(define_insn "iwmmxt_wmacuz"
556
(define_insn "iwmmxt_wmacuz"
355
  [(set (match_operand:DI               0 "register_operand" "=y")
557
  [(set (match_operand:DI               0 "register_operand" "=y")
356
	(unspec:DI [(match_operand:V4HI 1 "register_operand" "y")
558
	(unspec:DI [(match_operand:V4HI 1 "register_operand" "y")
357
		    (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMACUZ))]
559
	            (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMACUZ))]
358
  "TARGET_REALLY_IWMMXT"
560
  "TARGET_REALLY_IWMMXT"
359
  "wmacuz%?\\t%0, %1, %2"
561
  "wmacuz%?\\t%0, %1, %2"
360
  [(set_attr "predicable" "yes")])
562
  [(set_attr "predicable" "yes")
563
   (set_attr "wtype" "wmac")]
564
)
361
565
362
;; Same as xordi3, but don't show input operands so that we don't think
566
;; Same as xordi3, but don't show input operands so that we don't think
363
;; they are live.
567
;; they are live.
Lines 366-533 Link Here
366
        (unspec:DI [(const_int 0)] UNSPEC_CLRDI))]
570
        (unspec:DI [(const_int 0)] UNSPEC_CLRDI))]
367
  "TARGET_REALLY_IWMMXT"
571
  "TARGET_REALLY_IWMMXT"
368
  "wxor%?\\t%0, %0, %0"
572
  "wxor%?\\t%0, %0, %0"
369
  [(set_attr "predicable" "yes")])
573
  [(set_attr "predicable" "yes")
574
   (set_attr "wtype" "wxor")]
575
)
370
576
371
;; Seems like cse likes to generate these, so we have to support them.
577
;; Seems like cse likes to generate these, so we have to support them.
372
578
373
(define_insn "*iwmmxt_clrv8qi"
579
(define_insn "iwmmxt_clrv8qi"
374
  [(set (match_operand:V8QI 0 "register_operand" "=y")
580
  [(set (match_operand:V8QI 0 "s_register_operand" "=y")
375
        (const_vector:V8QI [(const_int 0) (const_int 0)
581
        (const_vector:V8QI [(const_int 0) (const_int 0)
376
			    (const_int 0) (const_int 0)
582
			    (const_int 0) (const_int 0)
377
			    (const_int 0) (const_int 0)
583
			    (const_int 0) (const_int 0)
378
			    (const_int 0) (const_int 0)]))]
584
			    (const_int 0) (const_int 0)]))]
379
  "TARGET_REALLY_IWMMXT"
585
  "TARGET_REALLY_IWMMXT"
380
  "wxor%?\\t%0, %0, %0"
586
  "wxor%?\\t%0, %0, %0"
381
  [(set_attr "predicable" "yes")])
587
  [(set_attr "predicable" "yes")
588
   (set_attr "wtype" "wxor")]
589
)
382
590
383
(define_insn "*iwmmxt_clrv4hi"
591
(define_insn "iwmmxt_clrv4hi"
384
  [(set (match_operand:V4HI 0 "register_operand" "=y")
592
  [(set (match_operand:V4HI 0 "s_register_operand" "=y")
385
        (const_vector:V4HI [(const_int 0) (const_int 0)
593
        (const_vector:V4HI [(const_int 0) (const_int 0)
386
			    (const_int 0) (const_int 0)]))]
594
			    (const_int 0) (const_int 0)]))]
387
  "TARGET_REALLY_IWMMXT"
595
  "TARGET_REALLY_IWMMXT"
388
  "wxor%?\\t%0, %0, %0"
596
  "wxor%?\\t%0, %0, %0"
389
  [(set_attr "predicable" "yes")])
597
  [(set_attr "predicable" "yes")
598
   (set_attr "wtype" "wxor")]
599
)
390
600
391
(define_insn "*iwmmxt_clrv2si"
601
(define_insn "iwmmxt_clrv2si"
392
  [(set (match_operand:V2SI 0 "register_operand" "=y")
602
  [(set (match_operand:V2SI 0 "register_operand" "=y")
393
        (const_vector:V2SI [(const_int 0) (const_int 0)]))]
603
        (const_vector:V2SI [(const_int 0) (const_int 0)]))]
394
  "TARGET_REALLY_IWMMXT"
604
  "TARGET_REALLY_IWMMXT"
395
  "wxor%?\\t%0, %0, %0"
605
  "wxor%?\\t%0, %0, %0"
396
  [(set_attr "predicable" "yes")])
606
  [(set_attr "predicable" "yes")
607
   (set_attr "wtype" "wxor")]
608
)
397
609
398
;; Unsigned averages/sum of absolute differences
610
;; Unsigned averages/sum of absolute differences
399
611
400
(define_insn "iwmmxt_uavgrndv8qi3"
612
(define_insn "iwmmxt_uavgrndv8qi3"
401
  [(set (match_operand:V8QI              0 "register_operand" "=y")
613
  [(set (match_operand:V8QI                                    0 "register_operand" "=y")
402
        (ashiftrt:V8QI
614
        (truncate:V8QI
403
	 (plus:V8QI (plus:V8QI
615
	  (lshiftrt:V8HI
404
		     (match_operand:V8QI 1 "register_operand" "y")
616
	    (plus:V8HI
405
		     (match_operand:V8QI 2 "register_operand" "y"))
617
	      (plus:V8HI (zero_extend:V8HI (match_operand:V8QI 1 "register_operand" "y"))
406
		    (const_vector:V8QI [(const_int 1)
618
	                 (zero_extend:V8HI (match_operand:V8QI 2 "register_operand" "y")))
407
					(const_int 1)
619
	      (const_vector:V8HI [(const_int 1)
408
					(const_int 1)
620
	                          (const_int 1)
409
					(const_int 1)
621
	                          (const_int 1)
410
					(const_int 1)
622
	                          (const_int 1)
411
					(const_int 1)
623
	                          (const_int 1)
412
					(const_int 1)
624
	                          (const_int 1)
413
					(const_int 1)]))
625
	                          (const_int 1)
414
	 (const_int 1)))]
626
	                          (const_int 1)]))
627
	    (const_int 1))))]
415
  "TARGET_REALLY_IWMMXT"
628
  "TARGET_REALLY_IWMMXT"
416
  "wavg2br%?\\t%0, %1, %2"
629
  "wavg2br%?\\t%0, %1, %2"
417
  [(set_attr "predicable" "yes")])
630
  [(set_attr "predicable" "yes")
631
   (set_attr "wtype" "wavg2")]
632
)
418
633
419
(define_insn "iwmmxt_uavgrndv4hi3"
634
(define_insn "iwmmxt_uavgrndv4hi3"
420
  [(set (match_operand:V4HI              0 "register_operand" "=y")
635
  [(set (match_operand:V4HI                                    0 "register_operand" "=y")
421
        (ashiftrt:V4HI
636
        (truncate:V4HI
422
	 (plus:V4HI (plus:V4HI
637
	  (lshiftrt:V4SI
423
		     (match_operand:V4HI 1 "register_operand" "y")
638
            (plus:V4SI
424
		     (match_operand:V4HI 2 "register_operand" "y"))
639
	      (plus:V4SI (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
425
		    (const_vector:V4HI [(const_int 1)
640
	                 (zero_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
426
					(const_int 1)
641
	      (const_vector:V4SI [(const_int 1)
427
					(const_int 1)
642
	                          (const_int 1)
428
					(const_int 1)]))
643
	                          (const_int 1)
429
	 (const_int 1)))]
644
	                          (const_int 1)]))
645
	    (const_int 1))))]
430
  "TARGET_REALLY_IWMMXT"
646
  "TARGET_REALLY_IWMMXT"
431
  "wavg2hr%?\\t%0, %1, %2"
647
  "wavg2hr%?\\t%0, %1, %2"
432
  [(set_attr "predicable" "yes")])
648
  [(set_attr "predicable" "yes")
433
649
   (set_attr "wtype" "wavg2")]
650
)
434
651
435
(define_insn "iwmmxt_uavgv8qi3"
652
(define_insn "iwmmxt_uavgv8qi3"
436
  [(set (match_operand:V8QI                 0 "register_operand" "=y")
653
  [(set (match_operand:V8QI                                  0 "register_operand" "=y")
437
        (ashiftrt:V8QI (plus:V8QI
654
        (truncate:V8QI
438
			(match_operand:V8QI 1 "register_operand" "y")
655
	  (lshiftrt:V8HI
439
			(match_operand:V8QI 2 "register_operand" "y"))
656
	    (plus:V8HI (zero_extend:V8HI (match_operand:V8QI 1 "register_operand" "y"))
440
		       (const_int 1)))]
657
	               (zero_extend:V8HI (match_operand:V8QI 2 "register_operand" "y")))
658
	    (const_int 1))))]
441
  "TARGET_REALLY_IWMMXT"
659
  "TARGET_REALLY_IWMMXT"
442
  "wavg2b%?\\t%0, %1, %2"
660
  "wavg2b%?\\t%0, %1, %2"
443
  [(set_attr "predicable" "yes")])
661
  [(set_attr "predicable" "yes")
662
   (set_attr "wtype" "wavg2")]
663
)
444
664
445
(define_insn "iwmmxt_uavgv4hi3"
665
(define_insn "iwmmxt_uavgv4hi3"
446
  [(set (match_operand:V4HI                 0 "register_operand" "=y")
666
  [(set (match_operand:V4HI                                  0 "register_operand" "=y")
447
        (ashiftrt:V4HI (plus:V4HI
667
        (truncate:V4HI
448
			(match_operand:V4HI 1 "register_operand" "y")
668
	  (lshiftrt:V4SI
449
			(match_operand:V4HI 2 "register_operand" "y"))
669
	    (plus:V4SI (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
450
		       (const_int 1)))]
670
	               (zero_extend:V4SI (match_operand:V4HI 2 "register_operand" "y")))
671
	    (const_int 1))))]
451
  "TARGET_REALLY_IWMMXT"
672
  "TARGET_REALLY_IWMMXT"
452
  "wavg2h%?\\t%0, %1, %2"
673
  "wavg2h%?\\t%0, %1, %2"
453
  [(set_attr "predicable" "yes")])
674
  [(set_attr "predicable" "yes")
454
675
   (set_attr "wtype" "wavg2")]
455
(define_insn "iwmmxt_psadbw"
676
)
456
  [(set (match_operand:V8QI                       0 "register_operand" "=y")
457
        (abs:V8QI (minus:V8QI (match_operand:V8QI 1 "register_operand" "y")
458
			      (match_operand:V8QI 2 "register_operand" "y"))))]
459
  "TARGET_REALLY_IWMMXT"
460
  "psadbw%?\\t%0, %1, %2"
461
  [(set_attr "predicable" "yes")])
462
463
677
464
;; Insert/extract/shuffle
678
;; Insert/extract/shuffle
465
679
466
(define_insn "iwmmxt_tinsrb"
680
(define_insn "iwmmxt_tinsrb"
467
  [(set (match_operand:V8QI                             0 "register_operand"    "=y")
681
  [(set (match_operand:V8QI                0 "register_operand" "=y")
468
        (vec_merge:V8QI (match_operand:V8QI             1 "register_operand"     "0")
682
        (vec_merge:V8QI
469
			(vec_duplicate:V8QI
683
	  (vec_duplicate:V8QI
470
			 (truncate:QI (match_operand:SI 2 "nonimmediate_operand" "r")))
684
	    (truncate:QI (match_operand:SI 2 "nonimmediate_operand" "r")))
471
			(match_operand:SI               3 "immediate_operand"    "i")))]
685
	  (match_operand:V8QI              1 "register_operand"     "0")
686
	  (match_operand:SI                3 "immediate_operand"    "i")))]
472
  "TARGET_REALLY_IWMMXT"
687
  "TARGET_REALLY_IWMMXT"
473
  "tinsrb%?\\t%0, %2, %3"
688
  "*
474
  [(set_attr "predicable" "yes")])
689
   {
690
     return arm_output_iwmmxt_tinsr (operands);
691
   }
692
   "
693
  [(set_attr "predicable" "yes")
694
   (set_attr "wtype" "tinsr")]
695
)
475
696
476
(define_insn "iwmmxt_tinsrh"
697
(define_insn "iwmmxt_tinsrh"
477
  [(set (match_operand:V4HI                             0 "register_operand"    "=y")
698
  [(set (match_operand:V4HI                0 "register_operand"    "=y")
478
        (vec_merge:V4HI (match_operand:V4HI             1 "register_operand"     "0")
699
        (vec_merge:V4HI
479
			(vec_duplicate:V4HI
700
          (vec_duplicate:V4HI
480
			 (truncate:HI (match_operand:SI 2 "nonimmediate_operand" "r")))
701
            (truncate:HI (match_operand:SI 2 "nonimmediate_operand" "r")))
481
			(match_operand:SI               3 "immediate_operand"    "i")))]
702
	  (match_operand:V4HI              1 "register_operand"     "0")
703
	  (match_operand:SI                3 "immediate_operand"    "i")))]
482
  "TARGET_REALLY_IWMMXT"
704
  "TARGET_REALLY_IWMMXT"
483
  "tinsrh%?\\t%0, %2, %3"
705
  "*
484
  [(set_attr "predicable" "yes")])
706
   {
707
     return arm_output_iwmmxt_tinsr (operands);
708
   }
709
   "
710
  [(set_attr "predicable" "yes")
711
   (set_attr "wtype" "tinsr")]
712
)
485
713
486
(define_insn "iwmmxt_tinsrw"
714
(define_insn "iwmmxt_tinsrw"
487
  [(set (match_operand:V2SI                 0 "register_operand"    "=y")
715
  [(set (match_operand:V2SI   0 "register_operand"    "=y")
488
        (vec_merge:V2SI (match_operand:V2SI 1 "register_operand"     "0")
716
        (vec_merge:V2SI
489
			(vec_duplicate:V2SI
717
          (vec_duplicate:V2SI
490
			 (match_operand:SI  2 "nonimmediate_operand" "r"))
718
            (match_operand:SI 2 "nonimmediate_operand" "r"))
491
			(match_operand:SI   3 "immediate_operand"    "i")))]
719
          (match_operand:V2SI 1 "register_operand"     "0")
720
          (match_operand:SI   3 "immediate_operand"    "i")))]
492
  "TARGET_REALLY_IWMMXT"
721
  "TARGET_REALLY_IWMMXT"
493
  "tinsrw%?\\t%0, %2, %3"
722
  "*
494
  [(set_attr "predicable" "yes")])
723
   {
724
     return arm_output_iwmmxt_tinsr (operands);
725
   }
726
   "
727
  [(set_attr "predicable" "yes")
728
   (set_attr "wtype" "tinsr")]
729
)
495
730
496
(define_insn "iwmmxt_textrmub"
731
(define_insn "iwmmxt_textrmub"
497
  [(set (match_operand:SI                                  0 "register_operand" "=r")
732
  [(set (match_operand:SI                                   0 "register_operand" "=r")
498
        (zero_extend:SI (vec_select:QI (match_operand:V8QI 1 "register_operand" "y")
733
        (zero_extend:SI (vec_select:QI (match_operand:V8QI  1 "register_operand" "y")
499
				       (parallel
734
		                       (parallel
500
					[(match_operand:SI 2 "immediate_operand" "i")]))))]
735
				         [(match_operand:SI 2 "immediate_operand" "i")]))))]
501
  "TARGET_REALLY_IWMMXT"
736
  "TARGET_REALLY_IWMMXT"
502
  "textrmub%?\\t%0, %1, %2"
737
  "textrmub%?\\t%0, %1, %2"
503
  [(set_attr "predicable" "yes")])
738
  [(set_attr "predicable" "yes")
739
   (set_attr "wtype" "textrm")]
740
)
504
741
505
(define_insn "iwmmxt_textrmsb"
742
(define_insn "iwmmxt_textrmsb"
506
  [(set (match_operand:SI                                  0 "register_operand" "=r")
743
  [(set (match_operand:SI                                   0 "register_operand" "=r")
507
        (sign_extend:SI (vec_select:QI (match_operand:V8QI 1 "register_operand" "y")
744
        (sign_extend:SI (vec_select:QI (match_operand:V8QI  1 "register_operand" "y")
508
				       (parallel
745
				       (parallel
509
					[(match_operand:SI 2 "immediate_operand" "i")]))))]
746
				         [(match_operand:SI 2 "immediate_operand" "i")]))))]
510
  "TARGET_REALLY_IWMMXT"
747
  "TARGET_REALLY_IWMMXT"
511
  "textrmsb%?\\t%0, %1, %2"
748
  "textrmsb%?\\t%0, %1, %2"
512
  [(set_attr "predicable" "yes")])
749
  [(set_attr "predicable" "yes")
750
   (set_attr "wtype" "textrm")]
751
)
513
752
514
(define_insn "iwmmxt_textrmuh"
753
(define_insn "iwmmxt_textrmuh"
515
  [(set (match_operand:SI                                  0 "register_operand" "=r")
754
  [(set (match_operand:SI                                   0 "register_operand" "=r")
516
        (zero_extend:SI (vec_select:HI (match_operand:V4HI 1 "register_operand" "y")
755
        (zero_extend:SI (vec_select:HI (match_operand:V4HI  1 "register_operand" "y")
517
				       (parallel
756
				       (parallel
518
					[(match_operand:SI 2 "immediate_operand" "i")]))))]
757
				         [(match_operand:SI 2 "immediate_operand" "i")]))))]
519
  "TARGET_REALLY_IWMMXT"
758
  "TARGET_REALLY_IWMMXT"
520
  "textrmuh%?\\t%0, %1, %2"
759
  "textrmuh%?\\t%0, %1, %2"
521
  [(set_attr "predicable" "yes")])
760
  [(set_attr "predicable" "yes")
761
   (set_attr "wtype" "textrm")]
762
)
522
763
523
(define_insn "iwmmxt_textrmsh"
764
(define_insn "iwmmxt_textrmsh"
524
  [(set (match_operand:SI                                  0 "register_operand" "=r")
765
  [(set (match_operand:SI                                   0 "register_operand" "=r")
525
        (sign_extend:SI (vec_select:HI (match_operand:V4HI 1 "register_operand" "y")
766
        (sign_extend:SI (vec_select:HI (match_operand:V4HI  1 "register_operand" "y")
526
				       (parallel
767
				       (parallel
527
					[(match_operand:SI 2 "immediate_operand" "i")]))))]
768
				         [(match_operand:SI 2 "immediate_operand" "i")]))))]
528
  "TARGET_REALLY_IWMMXT"
769
  "TARGET_REALLY_IWMMXT"
529
  "textrmsh%?\\t%0, %1, %2"
770
  "textrmsh%?\\t%0, %1, %2"
530
  [(set_attr "predicable" "yes")])
771
  [(set_attr "predicable" "yes")
772
   (set_attr "wtype" "textrm")]
773
)
531
774
532
;; There are signed/unsigned variants of this instruction, but they are
775
;; There are signed/unsigned variants of this instruction, but they are
533
;; pointless.
776
;; pointless.
Lines 537-543 Link Here
537
		       (parallel [(match_operand:SI 2 "immediate_operand" "i")])))]
780
		       (parallel [(match_operand:SI 2 "immediate_operand" "i")])))]
538
  "TARGET_REALLY_IWMMXT"
781
  "TARGET_REALLY_IWMMXT"
539
  "textrmsw%?\\t%0, %1, %2"
782
  "textrmsw%?\\t%0, %1, %2"
540
  [(set_attr "predicable" "yes")])
783
  [(set_attr "predicable" "yes")
784
   (set_attr "wtype" "textrm")]
785
)
541
786
542
(define_insn "iwmmxt_wshufh"
787
(define_insn "iwmmxt_wshufh"
543
  [(set (match_operand:V4HI               0 "register_operand" "=y")
788
  [(set (match_operand:V4HI               0 "register_operand" "=y")
Lines 545-551 Link Here
545
		      (match_operand:SI   2 "immediate_operand" "i")] UNSPEC_WSHUFH))]
790
		      (match_operand:SI   2 "immediate_operand" "i")] UNSPEC_WSHUFH))]
546
  "TARGET_REALLY_IWMMXT"
791
  "TARGET_REALLY_IWMMXT"
547
  "wshufh%?\\t%0, %1, %2"
792
  "wshufh%?\\t%0, %1, %2"
548
  [(set_attr "predicable" "yes")])
793
  [(set_attr "predicable" "yes")
794
   (set_attr "wtype" "wshufh")]
795
)
549
796
550
;; Mask-generating comparisons
797
;; Mask-generating comparisons
551
;;
798
;;
Lines 557-648 Link Here
557
;; into the entire destination vector, (with the '1' going into the least
804
;; into the entire destination vector, (with the '1' going into the least
558
;; significant element of the vector).  This is not how these instructions
805
;; significant element of the vector).  This is not how these instructions
559
;; behave.
806
;; behave.
560
;;
561
;; Unfortunately the current patterns are illegal.  They are SET insns
562
;; without a SET in them.  They work in most cases for ordinary code
563
;; generation, but there are circumstances where they can cause gcc to fail.
564
;; XXX - FIXME.
565
807
566
(define_insn "eqv8qi3"
808
(define_insn "eqv8qi3"
567
  [(unspec_volatile [(match_operand:V8QI 0 "register_operand" "=y")
809
  [(set (match_operand:V8QI                        0 "register_operand" "=y")
568
		     (match_operand:V8QI 1 "register_operand"  "y")
810
	(unspec_volatile:V8QI [(match_operand:V8QI 1 "register_operand"  "y")
569
		     (match_operand:V8QI 2 "register_operand"  "y")]
811
	                       (match_operand:V8QI 2 "register_operand"  "y")]
570
		    VUNSPEC_WCMP_EQ)]
812
	                      VUNSPEC_WCMP_EQ))]
571
  "TARGET_REALLY_IWMMXT"
813
  "TARGET_REALLY_IWMMXT"
572
  "wcmpeqb%?\\t%0, %1, %2"
814
  "wcmpeqb%?\\t%0, %1, %2"
573
  [(set_attr "predicable" "yes")])
815
  [(set_attr "predicable" "yes")
816
   (set_attr "wtype" "wcmpeq")]
817
)
574
818
575
(define_insn "eqv4hi3"
819
(define_insn "eqv4hi3"
576
  [(unspec_volatile [(match_operand:V4HI 0 "register_operand" "=y")
820
  [(set (match_operand:V4HI                        0 "register_operand" "=y")
577
		     (match_operand:V4HI 1 "register_operand"  "y")
821
	(unspec_volatile:V4HI [(match_operand:V4HI 1 "register_operand"  "y")
578
		     (match_operand:V4HI 2 "register_operand"  "y")]
822
		               (match_operand:V4HI 2 "register_operand"  "y")]
579
		    VUNSPEC_WCMP_EQ)]
823
	                       VUNSPEC_WCMP_EQ))]
580
  "TARGET_REALLY_IWMMXT"
824
  "TARGET_REALLY_IWMMXT"
581
  "wcmpeqh%?\\t%0, %1, %2"
825
  "wcmpeqh%?\\t%0, %1, %2"
582
  [(set_attr "predicable" "yes")])
826
  [(set_attr "predicable" "yes")
827
   (set_attr "wtype" "wcmpeq")]
828
)
583
829
584
(define_insn "eqv2si3"
830
(define_insn "eqv2si3"
585
  [(unspec_volatile:V2SI [(match_operand:V2SI 0 "register_operand" "=y")
831
  [(set (match_operand:V2SI    0 "register_operand" "=y")
586
			  (match_operand:V2SI 1 "register_operand"  "y")
832
	(unspec_volatile:V2SI
587
			  (match_operand:V2SI 2 "register_operand"  "y")]
833
	  [(match_operand:V2SI 1 "register_operand"  "y")
588
			 VUNSPEC_WCMP_EQ)]
834
	   (match_operand:V2SI 2 "register_operand"  "y")]
835
           VUNSPEC_WCMP_EQ))]
589
  "TARGET_REALLY_IWMMXT"
836
  "TARGET_REALLY_IWMMXT"
590
  "wcmpeqw%?\\t%0, %1, %2"
837
  "wcmpeqw%?\\t%0, %1, %2"
591
  [(set_attr "predicable" "yes")])
838
  [(set_attr "predicable" "yes")
839
   (set_attr "wtype" "wcmpeq")]
840
)
592
841
593
(define_insn "gtuv8qi3"
842
(define_insn "gtuv8qi3"
594
  [(unspec_volatile [(match_operand:V8QI 0 "register_operand" "=y")
843
  [(set (match_operand:V8QI                        0 "register_operand" "=y")
595
		     (match_operand:V8QI 1 "register_operand"  "y")
844
	(unspec_volatile:V8QI [(match_operand:V8QI 1 "register_operand"  "y")
596
		     (match_operand:V8QI 2 "register_operand"  "y")]
845
	                       (match_operand:V8QI 2 "register_operand"  "y")]
597
		    VUNSPEC_WCMP_GTU)]
846
	                       VUNSPEC_WCMP_GTU))]
598
  "TARGET_REALLY_IWMMXT"
847
  "TARGET_REALLY_IWMMXT"
599
  "wcmpgtub%?\\t%0, %1, %2"
848
  "wcmpgtub%?\\t%0, %1, %2"
600
  [(set_attr "predicable" "yes")])
849
  [(set_attr "predicable" "yes")
850
   (set_attr "wtype" "wcmpgt")]
851
)
601
852
602
(define_insn "gtuv4hi3"
853
(define_insn "gtuv4hi3"
603
  [(unspec_volatile [(match_operand:V4HI 0 "register_operand" "=y")
854
  [(set (match_operand:V4HI                        0 "register_operand" "=y")
604
		     (match_operand:V4HI 1 "register_operand"  "y")
855
        (unspec_volatile:V4HI [(match_operand:V4HI 1 "register_operand"  "y")
605
		     (match_operand:V4HI 2 "register_operand"  "y")]
856
                               (match_operand:V4HI 2 "register_operand"  "y")]
606
		    VUNSPEC_WCMP_GTU)]
857
                               VUNSPEC_WCMP_GTU))]
607
  "TARGET_REALLY_IWMMXT"
858
  "TARGET_REALLY_IWMMXT"
608
  "wcmpgtuh%?\\t%0, %1, %2"
859
  "wcmpgtuh%?\\t%0, %1, %2"
609
  [(set_attr "predicable" "yes")])
860
  [(set_attr "predicable" "yes")
861
   (set_attr "wtype" "wcmpgt")]
862
)
610
863
611
(define_insn "gtuv2si3"
864
(define_insn "gtuv2si3"
612
  [(unspec_volatile [(match_operand:V2SI 0 "register_operand" "=y")
865
  [(set (match_operand:V2SI                        0 "register_operand" "=y")
613
		     (match_operand:V2SI 1 "register_operand"  "y")
866
	(unspec_volatile:V2SI [(match_operand:V2SI 1 "register_operand"  "y")
614
		     (match_operand:V2SI 2 "register_operand"  "y")]
867
	                       (match_operand:V2SI 2 "register_operand"  "y")]
615
		    VUNSPEC_WCMP_GTU)]
868
	                       VUNSPEC_WCMP_GTU))]
616
  "TARGET_REALLY_IWMMXT"
869
  "TARGET_REALLY_IWMMXT"
617
  "wcmpgtuw%?\\t%0, %1, %2"
870
  "wcmpgtuw%?\\t%0, %1, %2"
618
  [(set_attr "predicable" "yes")])
871
  [(set_attr "predicable" "yes")
872
   (set_attr "wtype" "wcmpgt")]
873
)
619
874
620
(define_insn "gtv8qi3"
875
(define_insn "gtv8qi3"
621
  [(unspec_volatile [(match_operand:V8QI 0 "register_operand" "=y")
876
  [(set (match_operand:V8QI                        0 "register_operand" "=y")
622
		     (match_operand:V8QI 1 "register_operand"  "y")
877
	(unspec_volatile:V8QI [(match_operand:V8QI 1 "register_operand"  "y")
623
		     (match_operand:V8QI 2 "register_operand"  "y")]
878
	                       (match_operand:V8QI 2 "register_operand"  "y")]
624
		    VUNSPEC_WCMP_GT)]
879
	                       VUNSPEC_WCMP_GT))]
625
  "TARGET_REALLY_IWMMXT"
880
  "TARGET_REALLY_IWMMXT"
626
  "wcmpgtsb%?\\t%0, %1, %2"
881
  "wcmpgtsb%?\\t%0, %1, %2"
627
  [(set_attr "predicable" "yes")])
882
  [(set_attr "predicable" "yes")
883
   (set_attr "wtype" "wcmpgt")]
884
)
628
885
629
(define_insn "gtv4hi3"
886
(define_insn "gtv4hi3"
630
  [(unspec_volatile [(match_operand:V4HI 0 "register_operand" "=y")
887
  [(set (match_operand:V4HI                        0 "register_operand" "=y")
631
		     (match_operand:V4HI 1 "register_operand"  "y")
888
	(unspec_volatile:V4HI [(match_operand:V4HI 1 "register_operand"  "y")
632
		     (match_operand:V4HI 2 "register_operand"  "y")]
889
	                       (match_operand:V4HI 2 "register_operand"  "y")]
633
		    VUNSPEC_WCMP_GT)]
890
	                       VUNSPEC_WCMP_GT))]
634
  "TARGET_REALLY_IWMMXT"
891
  "TARGET_REALLY_IWMMXT"
635
  "wcmpgtsh%?\\t%0, %1, %2"
892
  "wcmpgtsh%?\\t%0, %1, %2"
636
  [(set_attr "predicable" "yes")])
893
  [(set_attr "predicable" "yes")
894
   (set_attr "wtype" "wcmpgt")]
895
)
637
896
638
(define_insn "gtv2si3"
897
(define_insn "gtv2si3"
639
  [(unspec_volatile [(match_operand:V2SI 0 "register_operand" "=y")
898
  [(set (match_operand:V2SI                        0 "register_operand" "=y")
640
		     (match_operand:V2SI 1 "register_operand"  "y")
899
	(unspec_volatile:V2SI [(match_operand:V2SI 1 "register_operand"  "y")
641
		     (match_operand:V2SI 2 "register_operand"  "y")]
900
	                       (match_operand:V2SI 2 "register_operand"  "y")]
642
		    VUNSPEC_WCMP_GT)]
901
	                       VUNSPEC_WCMP_GT))]
643
  "TARGET_REALLY_IWMMXT"
902
  "TARGET_REALLY_IWMMXT"
644
  "wcmpgtsw%?\\t%0, %1, %2"
903
  "wcmpgtsw%?\\t%0, %1, %2"
645
  [(set_attr "predicable" "yes")])
904
  [(set_attr "predicable" "yes")
905
   (set_attr "wtype" "wcmpgt")]
906
)
646
907
647
;; Max/min insns
908
;; Max/min insns
648
909
Lines 652-658 Link Here
652
		   (match_operand:VMMX 2 "register_operand" "y")))]
913
		   (match_operand:VMMX 2 "register_operand" "y")))]
653
  "TARGET_REALLY_IWMMXT"
914
  "TARGET_REALLY_IWMMXT"
654
  "wmaxs<MMX_char>%?\\t%0, %1, %2"
915
  "wmaxs<MMX_char>%?\\t%0, %1, %2"
655
  [(set_attr "predicable" "yes")])
916
  [(set_attr "predicable" "yes")
917
   (set_attr "wtype" "wmax")]
918
)
656
919
657
(define_insn "*umax<mode>3_iwmmxt"
920
(define_insn "*umax<mode>3_iwmmxt"
658
  [(set (match_operand:VMMX            0 "register_operand" "=y")
921
  [(set (match_operand:VMMX            0 "register_operand" "=y")
Lines 660-666 Link Here
660
		   (match_operand:VMMX 2 "register_operand" "y")))]
923
		   (match_operand:VMMX 2 "register_operand" "y")))]
661
  "TARGET_REALLY_IWMMXT"
924
  "TARGET_REALLY_IWMMXT"
662
  "wmaxu<MMX_char>%?\\t%0, %1, %2"
925
  "wmaxu<MMX_char>%?\\t%0, %1, %2"
663
  [(set_attr "predicable" "yes")])
926
  [(set_attr "predicable" "yes")
927
   (set_attr "wtype" "wmax")]
928
)
664
929
665
(define_insn "*smin<mode>3_iwmmxt"
930
(define_insn "*smin<mode>3_iwmmxt"
666
  [(set (match_operand:VMMX            0 "register_operand" "=y")
931
  [(set (match_operand:VMMX            0 "register_operand" "=y")
Lines 668-674 Link Here
668
		   (match_operand:VMMX 2 "register_operand" "y")))]
933
		   (match_operand:VMMX 2 "register_operand" "y")))]
669
  "TARGET_REALLY_IWMMXT"
934
  "TARGET_REALLY_IWMMXT"
670
  "wmins<MMX_char>%?\\t%0, %1, %2"
935
  "wmins<MMX_char>%?\\t%0, %1, %2"
671
  [(set_attr "predicable" "yes")])
936
  [(set_attr "predicable" "yes")
937
   (set_attr "wtype" "wmin")]
938
)
672
939
673
(define_insn "*umin<mode>3_iwmmxt"
940
(define_insn "*umin<mode>3_iwmmxt"
674
  [(set (match_operand:VMMX            0 "register_operand" "=y")
941
  [(set (match_operand:VMMX            0 "register_operand" "=y")
Lines 676-1332 Link Here
676
		   (match_operand:VMMX 2 "register_operand" "y")))]
943
		   (match_operand:VMMX 2 "register_operand" "y")))]
677
  "TARGET_REALLY_IWMMXT"
944
  "TARGET_REALLY_IWMMXT"
678
  "wminu<MMX_char>%?\\t%0, %1, %2"
945
  "wminu<MMX_char>%?\\t%0, %1, %2"
679
  [(set_attr "predicable" "yes")])
946
  [(set_attr "predicable" "yes")
947
   (set_attr "wtype" "wmin")]
948
)
680
949
681
;; Pack/unpack insns.
950
;; Pack/unpack insns.
682
951
683
(define_insn "iwmmxt_wpackhss"
952
(define_insn "iwmmxt_wpackhss"
684
  [(set (match_operand:V8QI                    0 "register_operand" "=y")
953
  [(set (match_operand:V8QI                     0 "register_operand" "=y")
685
	(vec_concat:V8QI
954
	(vec_concat:V8QI
686
	 (ss_truncate:V4QI (match_operand:V4HI 1 "register_operand" "y"))
955
	  (ss_truncate:V4QI (match_operand:V4HI 1 "register_operand" "y"))
687
	 (ss_truncate:V4QI (match_operand:V4HI 2 "register_operand" "y"))))]
956
	  (ss_truncate:V4QI (match_operand:V4HI 2 "register_operand" "y"))))]
688
  "TARGET_REALLY_IWMMXT"
957
  "TARGET_REALLY_IWMMXT"
689
  "wpackhss%?\\t%0, %1, %2"
958
  "wpackhss%?\\t%0, %1, %2"
690
  [(set_attr "predicable" "yes")])
959
  [(set_attr "predicable" "yes")
960
   (set_attr "wtype" "wpack")]
961
)
691
962
692
(define_insn "iwmmxt_wpackwss"
963
(define_insn "iwmmxt_wpackwss"
693
  [(set (match_operand:V4HI                    0 "register_operand" "=y")
964
  [(set (match_operand:V4HI                     0 "register_operand" "=y")
694
	(vec_concat:V4HI
965
        (vec_concat:V4HI
695
	 (ss_truncate:V2HI (match_operand:V2SI 1 "register_operand" "y"))
966
	  (ss_truncate:V2HI (match_operand:V2SI 1 "register_operand" "y"))
696
	 (ss_truncate:V2HI (match_operand:V2SI 2 "register_operand" "y"))))]
967
	  (ss_truncate:V2HI (match_operand:V2SI 2 "register_operand" "y"))))]
697
  "TARGET_REALLY_IWMMXT"
968
  "TARGET_REALLY_IWMMXT"
698
  "wpackwss%?\\t%0, %1, %2"
969
  "wpackwss%?\\t%0, %1, %2"
699
  [(set_attr "predicable" "yes")])
970
  [(set_attr "predicable" "yes")
971
   (set_attr "wtype" "wpack")]
972
)
700
973
701
(define_insn "iwmmxt_wpackdss"
974
(define_insn "iwmmxt_wpackdss"
702
  [(set (match_operand:V2SI                0 "register_operand" "=y")
975
  [(set (match_operand:V2SI                 0 "register_operand" "=y")
703
	(vec_concat:V2SI
976
	(vec_concat:V2SI
704
	 (ss_truncate:SI (match_operand:DI 1 "register_operand" "y"))
977
	  (ss_truncate:SI (match_operand:DI 1 "register_operand" "y"))
705
	 (ss_truncate:SI (match_operand:DI 2 "register_operand" "y"))))]
978
	  (ss_truncate:SI (match_operand:DI 2 "register_operand" "y"))))]
706
  "TARGET_REALLY_IWMMXT"
979
  "TARGET_REALLY_IWMMXT"
707
  "wpackdss%?\\t%0, %1, %2"
980
  "wpackdss%?\\t%0, %1, %2"
708
  [(set_attr "predicable" "yes")])
981
  [(set_attr "predicable" "yes")
982
   (set_attr "wtype" "wpack")]
983
)
709
984
710
(define_insn "iwmmxt_wpackhus"
985
(define_insn "iwmmxt_wpackhus"
711
  [(set (match_operand:V8QI                    0 "register_operand" "=y")
986
  [(set (match_operand:V8QI                     0 "register_operand" "=y")
712
	(vec_concat:V8QI
987
	(vec_concat:V8QI
713
	 (us_truncate:V4QI (match_operand:V4HI 1 "register_operand" "y"))
988
	  (us_truncate:V4QI (match_operand:V4HI 1 "register_operand" "y"))
714
	 (us_truncate:V4QI (match_operand:V4HI 2 "register_operand" "y"))))]
989
	  (us_truncate:V4QI (match_operand:V4HI 2 "register_operand" "y"))))]
715
  "TARGET_REALLY_IWMMXT"
990
  "TARGET_REALLY_IWMMXT"
716
  "wpackhus%?\\t%0, %1, %2"
991
  "wpackhus%?\\t%0, %1, %2"
717
  [(set_attr "predicable" "yes")])
992
  [(set_attr "predicable" "yes")
993
   (set_attr "wtype" "wpack")]
994
)
718
995
719
(define_insn "iwmmxt_wpackwus"
996
(define_insn "iwmmxt_wpackwus"
720
  [(set (match_operand:V4HI                    0 "register_operand" "=y")
997
  [(set (match_operand:V4HI                     0 "register_operand" "=y")
721
	(vec_concat:V4HI
998
	(vec_concat:V4HI
722
	 (us_truncate:V2HI (match_operand:V2SI 1 "register_operand" "y"))
999
	  (us_truncate:V2HI (match_operand:V2SI 1 "register_operand" "y"))
723
	 (us_truncate:V2HI (match_operand:V2SI 2 "register_operand" "y"))))]
1000
	  (us_truncate:V2HI (match_operand:V2SI 2 "register_operand" "y"))))]
724
  "TARGET_REALLY_IWMMXT"
1001
  "TARGET_REALLY_IWMMXT"
725
  "wpackwus%?\\t%0, %1, %2"
1002
  "wpackwus%?\\t%0, %1, %2"
726
  [(set_attr "predicable" "yes")])
1003
  [(set_attr "predicable" "yes")
1004
   (set_attr "wtype" "wpack")]
1005
)
727
1006
728
(define_insn "iwmmxt_wpackdus"
1007
(define_insn "iwmmxt_wpackdus"
729
  [(set (match_operand:V2SI                0 "register_operand" "=y")
1008
  [(set (match_operand:V2SI                 0 "register_operand" "=y")
730
	(vec_concat:V2SI
1009
	(vec_concat:V2SI
731
	 (us_truncate:SI (match_operand:DI 1 "register_operand" "y"))
1010
	  (us_truncate:SI (match_operand:DI 1 "register_operand" "y"))
732
	 (us_truncate:SI (match_operand:DI 2 "register_operand" "y"))))]
1011
	  (us_truncate:SI (match_operand:DI 2 "register_operand" "y"))))]
733
  "TARGET_REALLY_IWMMXT"
1012
  "TARGET_REALLY_IWMMXT"
734
  "wpackdus%?\\t%0, %1, %2"
1013
  "wpackdus%?\\t%0, %1, %2"
735
  [(set_attr "predicable" "yes")])
1014
  [(set_attr "predicable" "yes")
736
1015
   (set_attr "wtype" "wpack")]
1016
)
737
1017
738
(define_insn "iwmmxt_wunpckihb"
1018
(define_insn "iwmmxt_wunpckihb"
739
  [(set (match_operand:V8QI                   0 "register_operand" "=y")
1019
  [(set (match_operand:V8QI                                      0 "register_operand" "=y")
740
	(vec_merge:V8QI
1020
	(vec_merge:V8QI
741
	 (vec_select:V8QI (match_operand:V8QI 1 "register_operand" "y")
1021
	  (vec_select:V8QI (match_operand:V8QI 1 "register_operand" "y")
742
			  (parallel [(const_int 4)
1022
		           (parallel [(const_int 4)
743
				     (const_int 0)
1023
			              (const_int 0)
744
				     (const_int 5)
1024
			              (const_int 5)
745
				     (const_int 1)
1025
			              (const_int 1)
746
				     (const_int 6)
1026
			              (const_int 6)
747
				     (const_int 2)
1027
			              (const_int 2)
748
				     (const_int 7)
1028
			              (const_int 7)
749
				     (const_int 3)]))
1029
			              (const_int 3)]))
750
	 (vec_select:V8QI (match_operand:V8QI 2 "register_operand" "y")
1030
          (vec_select:V8QI (match_operand:V8QI 2 "register_operand" "y")
751
			  (parallel [(const_int 0)
1031
			   (parallel [(const_int 0)
752
				     (const_int 4)
1032
			              (const_int 4)
753
				     (const_int 1)
1033
			              (const_int 1)
754
				     (const_int 5)
1034
			              (const_int 5)
755
				     (const_int 2)
1035
			              (const_int 2)
756
				     (const_int 6)
1036
			              (const_int 6)
757
				     (const_int 3)
1037
			              (const_int 3)
758
				     (const_int 7)]))
1038
			              (const_int 7)]))
759
	 (const_int 85)))]
1039
          (const_int 85)))]
760
  "TARGET_REALLY_IWMMXT"
1040
  "TARGET_REALLY_IWMMXT"
761
  "wunpckihb%?\\t%0, %1, %2"
1041
  "wunpckihb%?\\t%0, %1, %2"
762
  [(set_attr "predicable" "yes")])
1042
  [(set_attr "predicable" "yes")
1043
   (set_attr "wtype" "wunpckih")]
1044
)
763
1045
764
(define_insn "iwmmxt_wunpckihh"
1046
(define_insn "iwmmxt_wunpckihh"
765
  [(set (match_operand:V4HI                   0 "register_operand" "=y")
1047
  [(set (match_operand:V4HI                                      0 "register_operand" "=y")
766
	(vec_merge:V4HI
1048
	(vec_merge:V4HI
767
	 (vec_select:V4HI (match_operand:V4HI 1 "register_operand" "y")
1049
	  (vec_select:V4HI (match_operand:V4HI 1 "register_operand" "y")
768
			  (parallel [(const_int 0)
1050
		           (parallel [(const_int 2)
769
				     (const_int 2)
1051
			              (const_int 0)
770
				     (const_int 1)
1052
			              (const_int 3)
771
				     (const_int 3)]))
1053
			              (const_int 1)]))
772
	 (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y")
1054
	  (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y")
773
			  (parallel [(const_int 2)
1055
		           (parallel [(const_int 0)
774
				     (const_int 0)
1056
			              (const_int 2)
775
				     (const_int 3)
1057
			              (const_int 1)
776
				     (const_int 1)]))
1058
			              (const_int 3)]))
777
	 (const_int 5)))]
1059
          (const_int 5)))]
778
  "TARGET_REALLY_IWMMXT"
1060
  "TARGET_REALLY_IWMMXT"
779
  "wunpckihh%?\\t%0, %1, %2"
1061
  "wunpckihh%?\\t%0, %1, %2"
780
  [(set_attr "predicable" "yes")])
1062
  [(set_attr "predicable" "yes")
1063
   (set_attr "wtype" "wunpckih")]
1064
)
781
1065
782
(define_insn "iwmmxt_wunpckihw"
1066
(define_insn "iwmmxt_wunpckihw"
783
  [(set (match_operand:V2SI                   0 "register_operand" "=y")
1067
  [(set (match_operand:V2SI                    0 "register_operand" "=y")
784
	(vec_merge:V2SI
1068
	(vec_merge:V2SI
785
	 (vec_select:V2SI (match_operand:V2SI 1 "register_operand" "y")
1069
	  (vec_select:V2SI (match_operand:V2SI 1 "register_operand" "y")
786
			  (parallel [(const_int 0)
1070
		           (parallel [(const_int 1)
787
				     (const_int 1)]))
1071
		                      (const_int 0)]))
788
	 (vec_select:V2SI (match_operand:V2SI 2 "register_operand" "y")
1072
          (vec_select:V2SI (match_operand:V2SI 2 "register_operand" "y")
789
			  (parallel [(const_int 1)
1073
		           (parallel [(const_int 0)
790
				     (const_int 0)]))
1074
			              (const_int 1)]))
791
	 (const_int 1)))]
1075
          (const_int 1)))]
792
  "TARGET_REALLY_IWMMXT"
1076
  "TARGET_REALLY_IWMMXT"
793
  "wunpckihw%?\\t%0, %1, %2"
1077
  "wunpckihw%?\\t%0, %1, %2"
794
  [(set_attr "predicable" "yes")])
1078
  [(set_attr "predicable" "yes")
1079
   (set_attr "wtype" "wunpckih")]
1080
)
795
1081
796
(define_insn "iwmmxt_wunpckilb"
1082
(define_insn "iwmmxt_wunpckilb"
797
  [(set (match_operand:V8QI                   0 "register_operand" "=y")
1083
  [(set (match_operand:V8QI                                      0 "register_operand" "=y")
798
	(vec_merge:V8QI
1084
	(vec_merge:V8QI
799
	 (vec_select:V8QI (match_operand:V8QI 1 "register_operand" "y")
1085
	  (vec_select:V8QI (match_operand:V8QI 1 "register_operand" "y")
800
			  (parallel [(const_int 0)
1086
		           (parallel [(const_int 0)
801
				     (const_int 4)
1087
			              (const_int 4)
802
				     (const_int 1)
1088
			              (const_int 1)
803
				     (const_int 5)
1089
			              (const_int 5)
804
				     (const_int 2)
1090
		                      (const_int 2)
805
				     (const_int 6)
1091
				      (const_int 6)
806
				     (const_int 3)
1092
				      (const_int 3)
807
				     (const_int 7)]))
1093
				      (const_int 7)]))
808
	 (vec_select:V8QI (match_operand:V8QI 2 "register_operand" "y")
1094
	  (vec_select:V8QI (match_operand:V8QI 2 "register_operand" "y")
809
			  (parallel [(const_int 4)
1095
		           (parallel [(const_int 4)
810
				     (const_int 0)
1096
			              (const_int 0)
811
				     (const_int 5)
1097
			              (const_int 5)
812
				     (const_int 1)
1098
			              (const_int 1)
813
				     (const_int 6)
1099
			              (const_int 6)
814
				     (const_int 2)
1100
			              (const_int 2)
815
				     (const_int 7)
1101
			              (const_int 7)
816
				     (const_int 3)]))
1102
			              (const_int 3)]))
817
	 (const_int 85)))]
1103
	  (const_int 85)))]
818
  "TARGET_REALLY_IWMMXT"
1104
  "TARGET_REALLY_IWMMXT"
819
  "wunpckilb%?\\t%0, %1, %2"
1105
  "wunpckilb%?\\t%0, %1, %2"
820
  [(set_attr "predicable" "yes")])
1106
  [(set_attr "predicable" "yes")
1107
   (set_attr "wtype" "wunpckil")]
1108
)
821
1109
822
(define_insn "iwmmxt_wunpckilh"
1110
(define_insn "iwmmxt_wunpckilh"
823
  [(set (match_operand:V4HI                   0 "register_operand" "=y")
1111
  [(set (match_operand:V4HI                                      0 "register_operand" "=y")
824
	(vec_merge:V4HI
1112
	(vec_merge:V4HI
825
	 (vec_select:V4HI (match_operand:V4HI 1 "register_operand" "y")
1113
	  (vec_select:V4HI (match_operand:V4HI 1 "register_operand" "y")
826
			  (parallel [(const_int 2)
1114
		           (parallel [(const_int 0)
827
				     (const_int 0)
1115
			              (const_int 2)
828
				     (const_int 3)
1116
			              (const_int 1)
829
				     (const_int 1)]))
1117
			              (const_int 3)]))
830
	 (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y")
1118
	  (vec_select:V4HI (match_operand:V4HI 2 "register_operand" "y")
831
			  (parallel [(const_int 0)
1119
			   (parallel [(const_int 2)
832
				     (const_int 2)
1120
			              (const_int 0)
833
				     (const_int 1)
1121
			              (const_int 3)
834
				     (const_int 3)]))
1122
			              (const_int 1)]))
835
	 (const_int 5)))]
1123
	  (const_int 5)))]
836
  "TARGET_REALLY_IWMMXT"
1124
  "TARGET_REALLY_IWMMXT"
837
  "wunpckilh%?\\t%0, %1, %2"
1125
  "wunpckilh%?\\t%0, %1, %2"
838
  [(set_attr "predicable" "yes")])
1126
  [(set_attr "predicable" "yes")
1127
   (set_attr "wtype" "wunpckil")]
1128
)
839
1129
840
(define_insn "iwmmxt_wunpckilw"
1130
(define_insn "iwmmxt_wunpckilw"
841
  [(set (match_operand:V2SI                   0 "register_operand" "=y")
1131
  [(set (match_operand:V2SI                    0 "register_operand" "=y")
842
	(vec_merge:V2SI
1132
	(vec_merge:V2SI
843
	 (vec_select:V2SI (match_operand:V2SI 1 "register_operand" "y")
1133
	  (vec_select:V2SI (match_operand:V2SI 1 "register_operand" "y")
844
			   (parallel [(const_int 1)
1134
		           (parallel [(const_int 0)
845
				      (const_int 0)]))
1135
				      (const_int 1)]))
846
	 (vec_select:V2SI (match_operand:V2SI 2 "register_operand" "y")
1136
	  (vec_select:V2SI (match_operand:V2SI 2 "register_operand" "y")
847
			  (parallel [(const_int 0)
1137
		           (parallel [(const_int 1)
848
				     (const_int 1)]))
1138
			              (const_int 0)]))
849
	 (const_int 1)))]
1139
	  (const_int 1)))]
850
  "TARGET_REALLY_IWMMXT"
1140
  "TARGET_REALLY_IWMMXT"
851
  "wunpckilw%?\\t%0, %1, %2"
1141
  "wunpckilw%?\\t%0, %1, %2"
852
  [(set_attr "predicable" "yes")])
1142
  [(set_attr "predicable" "yes")
1143
   (set_attr "wtype" "wunpckil")]
1144
)
853
1145
854
(define_insn "iwmmxt_wunpckehub"
1146
(define_insn "iwmmxt_wunpckehub"
855
  [(set (match_operand:V4HI                   0 "register_operand" "=y")
1147
  [(set (match_operand:V4HI                     0 "register_operand" "=y")
856
	(zero_extend:V4HI
1148
	(vec_select:V4HI
857
	 (vec_select:V4QI (match_operand:V8QI 1 "register_operand" "y")
1149
	  (zero_extend:V8HI (match_operand:V8QI 1 "register_operand" "y"))
858
			  (parallel [(const_int 4) (const_int 5)
1150
	  (parallel [(const_int 4) (const_int 5)
859
				     (const_int 6) (const_int 7)]))))]
1151
	             (const_int 6) (const_int 7)])))]
860
  "TARGET_REALLY_IWMMXT"
1152
  "TARGET_REALLY_IWMMXT"
861
  "wunpckehub%?\\t%0, %1"
1153
  "wunpckehub%?\\t%0, %1"
862
  [(set_attr "predicable" "yes")])
1154
  [(set_attr "predicable" "yes")
1155
   (set_attr "wtype" "wunpckeh")]
1156
)
863
1157
864
(define_insn "iwmmxt_wunpckehuh"
1158
(define_insn "iwmmxt_wunpckehuh"
865
  [(set (match_operand:V2SI                   0 "register_operand" "=y")
1159
  [(set (match_operand:V2SI                     0 "register_operand" "=y")
866
	(zero_extend:V2SI
1160
	(vec_select:V2SI
867
	 (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "y")
1161
	  (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
868
			  (parallel [(const_int 2) (const_int 3)]))))]
1162
	  (parallel [(const_int 2) (const_int 3)])))]
869
  "TARGET_REALLY_IWMMXT"
1163
  "TARGET_REALLY_IWMMXT"
870
  "wunpckehuh%?\\t%0, %1"
1164
  "wunpckehuh%?\\t%0, %1"
871
  [(set_attr "predicable" "yes")])
1165
  [(set_attr "predicable" "yes")
1166
   (set_attr "wtype" "wunpckeh")]
1167
)
872
1168
873
(define_insn "iwmmxt_wunpckehuw"
1169
(define_insn "iwmmxt_wunpckehuw"
874
  [(set (match_operand:DI                   0 "register_operand" "=y")
1170
  [(set (match_operand:DI                       0 "register_operand" "=y")
875
	(zero_extend:DI
1171
	(vec_select:DI
876
	 (vec_select:SI (match_operand:V2SI 1 "register_operand" "y")
1172
	  (zero_extend:V2DI (match_operand:V2SI 1 "register_operand" "y"))
877
			(parallel [(const_int 1)]))))]
1173
	  (parallel [(const_int 1)])))]
878
  "TARGET_REALLY_IWMMXT"
1174
  "TARGET_REALLY_IWMMXT"
879
  "wunpckehuw%?\\t%0, %1"
1175
  "wunpckehuw%?\\t%0, %1"
880
  [(set_attr "predicable" "yes")])
1176
  [(set_attr "predicable" "yes")
1177
   (set_attr "wtype" "wunpckeh")]
1178
)
881
1179
882
(define_insn "iwmmxt_wunpckehsb"
1180
(define_insn "iwmmxt_wunpckehsb"
883
  [(set (match_operand:V4HI                   0 "register_operand" "=y")
1181
  [(set (match_operand:V4HI                     0 "register_operand" "=y")
884
	(sign_extend:V4HI
1182
        (vec_select:V4HI
885
	 (vec_select:V4QI (match_operand:V8QI 1 "register_operand" "y")
1183
	  (sign_extend:V8HI (match_operand:V8QI 1 "register_operand" "y"))
886
			  (parallel [(const_int 4) (const_int 5)
1184
	  (parallel [(const_int 4) (const_int 5)
887
				     (const_int 6) (const_int 7)]))))]
1185
	             (const_int 6) (const_int 7)])))]
888
  "TARGET_REALLY_IWMMXT"
1186
  "TARGET_REALLY_IWMMXT"
889
  "wunpckehsb%?\\t%0, %1"
1187
  "wunpckehsb%?\\t%0, %1"
890
  [(set_attr "predicable" "yes")])
1188
  [(set_attr "predicable" "yes")
1189
   (set_attr "wtype" "wunpckeh")]
1190
)
891
1191
892
(define_insn "iwmmxt_wunpckehsh"
1192
(define_insn "iwmmxt_wunpckehsh"
893
  [(set (match_operand:V2SI                   0 "register_operand" "=y")
1193
  [(set (match_operand:V2SI                     0 "register_operand" "=y")
894
	(sign_extend:V2SI
1194
	(vec_select:V2SI
895
	 (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "y")
1195
	  (sign_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
896
			  (parallel [(const_int 2) (const_int 3)]))))]
1196
	  (parallel [(const_int 2) (const_int 3)])))]
897
  "TARGET_REALLY_IWMMXT"
1197
  "TARGET_REALLY_IWMMXT"
898
  "wunpckehsh%?\\t%0, %1"
1198
  "wunpckehsh%?\\t%0, %1"
899
  [(set_attr "predicable" "yes")])
1199
  [(set_attr "predicable" "yes")
1200
   (set_attr "wtype" "wunpckeh")]
1201
)
900
1202
901
(define_insn "iwmmxt_wunpckehsw"
1203
(define_insn "iwmmxt_wunpckehsw"
902
  [(set (match_operand:DI                   0 "register_operand" "=y")
1204
  [(set (match_operand:DI                       0 "register_operand" "=y")
903
	(sign_extend:DI
1205
	(vec_select:DI
904
	 (vec_select:SI (match_operand:V2SI 1 "register_operand" "y")
1206
	  (sign_extend:V2DI (match_operand:V2SI 1 "register_operand" "y"))
905
			(parallel [(const_int 1)]))))]
1207
	  (parallel [(const_int 1)])))]
906
  "TARGET_REALLY_IWMMXT"
1208
  "TARGET_REALLY_IWMMXT"
907
  "wunpckehsw%?\\t%0, %1"
1209
  "wunpckehsw%?\\t%0, %1"
908
  [(set_attr "predicable" "yes")])
1210
  [(set_attr "predicable" "yes")
1211
   (set_attr "wtype" "wunpckeh")]
1212
)
909
1213
910
(define_insn "iwmmxt_wunpckelub"
1214
(define_insn "iwmmxt_wunpckelub"
911
  [(set (match_operand:V4HI                   0 "register_operand" "=y")
1215
  [(set (match_operand:V4HI                     0 "register_operand" "=y")
912
	(zero_extend:V4HI
1216
	(vec_select:V4HI
913
	 (vec_select:V4QI (match_operand:V8QI 1 "register_operand" "y")
1217
	  (zero_extend:V8HI (match_operand:V8QI 1 "register_operand" "y"))
914
			  (parallel [(const_int 0) (const_int 1)
1218
	  (parallel [(const_int 0) (const_int 1)
915
				     (const_int 2) (const_int 3)]))))]
1219
		     (const_int 2) (const_int 3)])))]
916
  "TARGET_REALLY_IWMMXT"
1220
  "TARGET_REALLY_IWMMXT"
917
  "wunpckelub%?\\t%0, %1"
1221
  "wunpckelub%?\\t%0, %1"
918
  [(set_attr "predicable" "yes")])
1222
  [(set_attr "predicable" "yes")
1223
   (set_attr "wtype" "wunpckel")]
1224
)
919
1225
920
(define_insn "iwmmxt_wunpckeluh"
1226
(define_insn "iwmmxt_wunpckeluh"
921
  [(set (match_operand:V2SI                   0 "register_operand" "=y")
1227
  [(set (match_operand:V2SI                     0 "register_operand" "=y")
922
	(zero_extend:V2SI
1228
	(vec_select:V2SI
923
	 (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "y")
1229
	  (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
924
			  (parallel [(const_int 0) (const_int 1)]))))]
1230
	  (parallel [(const_int 0) (const_int 1)])))]
925
  "TARGET_REALLY_IWMMXT"
1231
  "TARGET_REALLY_IWMMXT"
926
  "wunpckeluh%?\\t%0, %1"
1232
  "wunpckeluh%?\\t%0, %1"
927
  [(set_attr "predicable" "yes")])
1233
  [(set_attr "predicable" "yes")
1234
   (set_attr "wtype" "wunpckel")]
1235
)
928
1236
929
(define_insn "iwmmxt_wunpckeluw"
1237
(define_insn "iwmmxt_wunpckeluw"
930
  [(set (match_operand:DI                   0 "register_operand" "=y")
1238
  [(set (match_operand:DI                       0 "register_operand" "=y")
931
	(zero_extend:DI
1239
	(vec_select:DI
932
	 (vec_select:SI (match_operand:V2SI 1 "register_operand" "y")
1240
	  (zero_extend:V2DI (match_operand:V2SI 1 "register_operand" "y"))
933
			(parallel [(const_int 0)]))))]
1241
	  (parallel [(const_int 0)])))]
934
  "TARGET_REALLY_IWMMXT"
1242
  "TARGET_REALLY_IWMMXT"
935
  "wunpckeluw%?\\t%0, %1"
1243
  "wunpckeluw%?\\t%0, %1"
936
  [(set_attr "predicable" "yes")])
1244
  [(set_attr "predicable" "yes")
1245
   (set_attr "wtype" "wunpckel")]
1246
)
937
1247
938
(define_insn "iwmmxt_wunpckelsb"
1248
(define_insn "iwmmxt_wunpckelsb"
939
  [(set (match_operand:V4HI                   0 "register_operand" "=y")
1249
  [(set (match_operand:V4HI                     0 "register_operand" "=y")
940
	(sign_extend:V4HI
1250
	(vec_select:V4HI
941
	 (vec_select:V4QI (match_operand:V8QI 1 "register_operand" "y")
1251
	  (sign_extend:V8HI (match_operand:V8QI 1 "register_operand" "y"))
942
			  (parallel [(const_int 0) (const_int 1)
1252
	  (parallel [(const_int 0) (const_int 1)
943
				     (const_int 2) (const_int 3)]))))]
1253
		     (const_int 2) (const_int 3)])))]
944
  "TARGET_REALLY_IWMMXT"
1254
  "TARGET_REALLY_IWMMXT"
945
  "wunpckelsb%?\\t%0, %1"
1255
  "wunpckelsb%?\\t%0, %1"
946
  [(set_attr "predicable" "yes")])
1256
  [(set_attr "predicable" "yes")
1257
   (set_attr "wtype" "wunpckel")]
1258
)
947
1259
948
(define_insn "iwmmxt_wunpckelsh"
1260
(define_insn "iwmmxt_wunpckelsh"
949
  [(set (match_operand:V2SI                   0 "register_operand" "=y")
1261
  [(set (match_operand:V2SI                     0 "register_operand" "=y")
950
	(sign_extend:V2SI
1262
	(vec_select:V2SI
951
	 (vec_select:V2HI (match_operand:V4HI 1 "register_operand" "y")
1263
	  (sign_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
952
			  (parallel [(const_int 0) (const_int 1)]))))]
1264
	  (parallel [(const_int 0) (const_int 1)])))]
953
  "TARGET_REALLY_IWMMXT"
1265
  "TARGET_REALLY_IWMMXT"
954
  "wunpckelsh%?\\t%0, %1"
1266
  "wunpckelsh%?\\t%0, %1"
955
  [(set_attr "predicable" "yes")])
1267
  [(set_attr "predicable" "yes")
1268
   (set_attr "wtype" "wunpckel")]
1269
)
956
1270
957
(define_insn "iwmmxt_wunpckelsw"
1271
(define_insn "iwmmxt_wunpckelsw"
958
  [(set (match_operand:DI                   0 "register_operand" "=y")
1272
  [(set (match_operand:DI                       0 "register_operand" "=y")
959
	(sign_extend:DI
1273
        (vec_select:DI
960
	 (vec_select:SI (match_operand:V2SI 1 "register_operand" "y")
1274
	  (sign_extend:V2DI (match_operand:V2SI 1 "register_operand" "y"))
961
			(parallel [(const_int 0)]))))]
1275
	  (parallel [(const_int 0)])))]
962
  "TARGET_REALLY_IWMMXT"
1276
  "TARGET_REALLY_IWMMXT"
963
  "wunpckelsw%?\\t%0, %1"
1277
  "wunpckelsw%?\\t%0, %1"
964
  [(set_attr "predicable" "yes")])
1278
  [(set_attr "predicable" "yes")
1279
   (set_attr "wtype" "wunpckel")]
1280
)
965
1281
966
;; Shifts
1282
;; Shifts
967
1283
968
(define_insn "rorv4hi3"
1284
(define_insn "ror<mode>3"
969
  [(set (match_operand:V4HI                0 "register_operand" "=y")
1285
  [(set (match_operand:VSHFT                 0 "register_operand" "=y,y")
970
        (rotatert:V4HI (match_operand:V4HI 1 "register_operand" "y")
1286
        (rotatert:VSHFT (match_operand:VSHFT 1 "register_operand" "y,y")
971
		       (match_operand:SI   2 "register_operand" "z")))]
1287
		        (match_operand:SI    2 "imm_or_reg_operand" "z,i")))]
972
  "TARGET_REALLY_IWMMXT"
973
  "wrorhg%?\\t%0, %1, %2"
974
  [(set_attr "predicable" "yes")])
975
976
(define_insn "rorv2si3"
977
  [(set (match_operand:V2SI                0 "register_operand" "=y")
978
        (rotatert:V2SI (match_operand:V2SI 1 "register_operand" "y")
979
		       (match_operand:SI   2 "register_operand" "z")))]
980
  "TARGET_REALLY_IWMMXT"
1288
  "TARGET_REALLY_IWMMXT"
981
  "wrorwg%?\\t%0, %1, %2"
1289
  "*
982
  [(set_attr "predicable" "yes")])
1290
  switch  (which_alternative)
983
1291
    {
984
(define_insn "rordi3"
1292
    case 0:
985
  [(set (match_operand:DI              0 "register_operand" "=y")
1293
      return \"wror<MMX_char>g%?\\t%0, %1, %2\";
986
	(rotatert:DI (match_operand:DI 1 "register_operand" "y")
1294
    case 1:
987
		   (match_operand:SI   2 "register_operand" "z")))]
1295
      return arm_output_iwmmxt_shift_immediate (\"wror<MMX_char>\", operands, true);
988
  "TARGET_REALLY_IWMMXT"
1296
    default:
989
  "wrordg%?\\t%0, %1, %2"
1297
      gcc_unreachable ();
990
  [(set_attr "predicable" "yes")])
1298
    }
1299
  "
1300
  [(set_attr "predicable" "yes")
1301
   (set_attr "arch" "*, iwmmxt2")
1302
   (set_attr "wtype" "wror, wror")]
1303
)
991
1304
992
(define_insn "ashr<mode>3_iwmmxt"
1305
(define_insn "ashr<mode>3_iwmmxt"
993
  [(set (match_operand:VSHFT                 0 "register_operand" "=y")
1306
  [(set (match_operand:VSHFT                 0 "register_operand" "=y,y")
994
        (ashiftrt:VSHFT (match_operand:VSHFT 1 "register_operand" "y")
1307
        (ashiftrt:VSHFT (match_operand:VSHFT 1 "register_operand" "y,y")
995
			(match_operand:SI    2 "register_operand" "z")))]
1308
			(match_operand:SI    2 "imm_or_reg_operand" "z,i")))]
996
  "TARGET_REALLY_IWMMXT"
1309
  "TARGET_REALLY_IWMMXT"
997
  "wsra<MMX_char>g%?\\t%0, %1, %2"
1310
  "*
998
  [(set_attr "predicable" "yes")])
1311
  switch  (which_alternative)
1312
    {
1313
    case 0:
1314
      return \"wsra<MMX_char>g%?\\t%0, %1, %2\";
1315
    case 1:
1316
      return arm_output_iwmmxt_shift_immediate (\"wsra<MMX_char>\", operands, true);
1317
    default:
1318
      gcc_unreachable ();
1319
    }
1320
  "
1321
  [(set_attr "predicable" "yes")
1322
   (set_attr "arch" "*, iwmmxt2")
1323
   (set_attr "wtype" "wsra, wsra")]
1324
)
999
1325
1000
(define_insn "lshr<mode>3_iwmmxt"
1326
(define_insn "lshr<mode>3_iwmmxt"
1001
  [(set (match_operand:VSHFT                 0 "register_operand" "=y")
1327
  [(set (match_operand:VSHFT                 0 "register_operand" "=y,y")
1002
        (lshiftrt:VSHFT (match_operand:VSHFT 1 "register_operand" "y")
1328
        (lshiftrt:VSHFT (match_operand:VSHFT 1 "register_operand" "y,y")
1003
			(match_operand:SI    2 "register_operand" "z")))]
1329
			(match_operand:SI    2 "imm_or_reg_operand" "z,i")))]
1004
  "TARGET_REALLY_IWMMXT"
1330
  "TARGET_REALLY_IWMMXT"
1005
  "wsrl<MMX_char>g%?\\t%0, %1, %2"
1331
  "*
1006
  [(set_attr "predicable" "yes")])
1332
  switch  (which_alternative)
1333
    {
1334
    case 0:
1335
      return \"wsrl<MMX_char>g%?\\t%0, %1, %2\";
1336
    case 1:
1337
      return arm_output_iwmmxt_shift_immediate (\"wsrl<MMX_char>\", operands, false);
1338
    default:
1339
      gcc_unreachable ();
1340
    }
1341
  "
1342
  [(set_attr "predicable" "yes")
1343
   (set_attr "arch" "*, iwmmxt2")
1344
   (set_attr "wtype" "wsrl, wsrl")]
1345
)
1007
1346
1008
(define_insn "ashl<mode>3_iwmmxt"
1347
(define_insn "ashl<mode>3_iwmmxt"
1009
  [(set (match_operand:VSHFT               0 "register_operand" "=y")
1348
  [(set (match_operand:VSHFT               0 "register_operand" "=y,y")
1010
        (ashift:VSHFT (match_operand:VSHFT 1 "register_operand" "y")
1349
        (ashift:VSHFT (match_operand:VSHFT 1 "register_operand" "y,y")
1011
		      (match_operand:SI    2 "register_operand" "z")))]
1350
		      (match_operand:SI    2 "imm_or_reg_operand" "z,i")))]
1012
  "TARGET_REALLY_IWMMXT"
1013
  "wsll<MMX_char>g%?\\t%0, %1, %2"
1014
  [(set_attr "predicable" "yes")])
1015
1016
(define_insn "rorv4hi3_di"
1017
  [(set (match_operand:V4HI                0 "register_operand" "=y")
1018
        (rotatert:V4HI (match_operand:V4HI 1 "register_operand" "y")
1019
		       (match_operand:DI   2 "register_operand" "y")))]
1020
  "TARGET_REALLY_IWMMXT"
1021
  "wrorh%?\\t%0, %1, %2"
1022
  [(set_attr "predicable" "yes")])
1023
1024
(define_insn "rorv2si3_di"
1025
  [(set (match_operand:V2SI                0 "register_operand" "=y")
1026
        (rotatert:V2SI (match_operand:V2SI 1 "register_operand" "y")
1027
		       (match_operand:DI   2 "register_operand" "y")))]
1028
  "TARGET_REALLY_IWMMXT"
1029
  "wrorw%?\\t%0, %1, %2"
1030
  [(set_attr "predicable" "yes")])
1031
1032
(define_insn "rordi3_di"
1033
  [(set (match_operand:DI              0 "register_operand" "=y")
1034
	(rotatert:DI (match_operand:DI 1 "register_operand" "y")
1035
		   (match_operand:DI   2 "register_operand" "y")))]
1036
  "TARGET_REALLY_IWMMXT"
1037
  "wrord%?\\t%0, %1, %2"
1038
  [(set_attr "predicable" "yes")])
1039
1040
(define_insn "ashrv4hi3_di"
1041
  [(set (match_operand:V4HI                0 "register_operand" "=y")
1042
        (ashiftrt:V4HI (match_operand:V4HI 1 "register_operand" "y")
1043
		       (match_operand:DI   2 "register_operand" "y")))]
1044
  "TARGET_REALLY_IWMMXT"
1351
  "TARGET_REALLY_IWMMXT"
1045
  "wsrah%?\\t%0, %1, %2"
1352
  "*
1046
  [(set_attr "predicable" "yes")])
1353
  switch  (which_alternative)
1047
1354
    {
1048
(define_insn "ashrv2si3_di"
1355
    case 0:
1049
  [(set (match_operand:V2SI                0 "register_operand" "=y")
1356
      return \"wsll<MMX_char>g%?\\t%0, %1, %2\";
1050
        (ashiftrt:V2SI (match_operand:V2SI 1 "register_operand" "y")
1357
    case 1:
1051
		       (match_operand:DI   2 "register_operand" "y")))]
1358
      return arm_output_iwmmxt_shift_immediate (\"wsll<MMX_char>\", operands, false);
1052
  "TARGET_REALLY_IWMMXT"
1359
    default:
1053
  "wsraw%?\\t%0, %1, %2"
1360
      gcc_unreachable ();
1054
  [(set_attr "predicable" "yes")])
1361
    }
1362
  "
1363
  [(set_attr "predicable" "yes")
1364
   (set_attr "arch" "*, iwmmxt2")
1365
   (set_attr "wtype" "wsll, wsll")]
1366
)
1055
1367
1056
(define_insn "ashrdi3_di"
1368
(define_insn "ror<mode>3_di"
1057
  [(set (match_operand:DI              0 "register_operand" "=y")
1369
  [(set (match_operand:VSHFT                 0 "register_operand" "=y,y")
1058
	(ashiftrt:DI (match_operand:DI 1 "register_operand" "y")
1370
        (rotatert:VSHFT (match_operand:VSHFT 1 "register_operand" "y,y")
1059
		   (match_operand:DI   2 "register_operand" "y")))]
1371
		        (match_operand:DI    2 "imm_or_reg_operand" "y,i")))]
1060
  "TARGET_REALLY_IWMMXT"
1372
  "TARGET_REALLY_IWMMXT"
1061
  "wsrad%?\\t%0, %1, %2"
1373
  "*
1062
  [(set_attr "predicable" "yes")])
1374
  switch (which_alternative)
1375
    {
1376
    case 0:
1377
      return \"wror<MMX_char>%?\\t%0, %1, %2\";
1378
    case 1:
1379
      return arm_output_iwmmxt_shift_immediate (\"wror<MMX_char>\", operands, true);
1380
    default:
1381
      gcc_unreachable ();
1382
    }
1383
  "
1384
  [(set_attr "predicable" "yes")
1385
   (set_attr "arch" "*, iwmmxt2")
1386
   (set_attr "wtype" "wror, wror")]
1387
)
1063
1388
1064
(define_insn "lshrv4hi3_di"
1389
(define_insn "ashr<mode>3_di"
1065
  [(set (match_operand:V4HI                0 "register_operand" "=y")
1390
  [(set (match_operand:VSHFT                 0 "register_operand" "=y,y")
1066
        (lshiftrt:V4HI (match_operand:V4HI 1 "register_operand" "y")
1391
        (ashiftrt:VSHFT (match_operand:VSHFT 1 "register_operand" "y,y")
1067
		       (match_operand:DI   2 "register_operand" "y")))]
1392
		        (match_operand:DI    2 "imm_or_reg_operand" "y,i")))]
1068
  "TARGET_REALLY_IWMMXT"
1393
  "TARGET_REALLY_IWMMXT"
1069
  "wsrlh%?\\t%0, %1, %2"
1394
  "*
1070
  [(set_attr "predicable" "yes")])
1395
  switch (which_alternative)
1396
    {
1397
    case 0:
1398
      return \"wsra<MMX_char>%?\\t%0, %1, %2\";
1399
    case 1:
1400
      return arm_output_iwmmxt_shift_immediate (\"wsra<MMX_char>\", operands, true);
1401
    default:
1402
      gcc_unreachable ();
1403
    }
1404
  "
1405
  [(set_attr "predicable" "yes")
1406
   (set_attr "arch" "*, iwmmxt2")
1407
   (set_attr "wtype" "wsra, wsra")]
1408
)
1071
1409
1072
(define_insn "lshrv2si3_di"
1410
(define_insn "lshr<mode>3_di"
1073
  [(set (match_operand:V2SI                0 "register_operand" "=y")
1411
  [(set (match_operand:VSHFT                 0 "register_operand" "=y,y")
1074
        (lshiftrt:V2SI (match_operand:V2SI 1 "register_operand" "y")
1412
        (lshiftrt:VSHFT (match_operand:VSHFT 1 "register_operand" "y,y")
1075
		       (match_operand:DI   2 "register_operand" "y")))]
1413
		        (match_operand:DI    2 "register_operand" "y,i")))]
1076
  "TARGET_REALLY_IWMMXT"
1414
  "TARGET_REALLY_IWMMXT"
1077
  "wsrlw%?\\t%0, %1, %2"
1415
  "*
1078
  [(set_attr "predicable" "yes")])
1416
  switch (which_alternative)
1417
    {
1418
    case 0:
1419
      return \"wsrl<MMX_char>%?\\t%0, %1, %2\";
1420
    case 1:
1421
      return arm_output_iwmmxt_shift_immediate (\"wsrl<MMX_char>\", operands, false);
1422
    default:
1423
      gcc_unreachable ();
1424
    }
1425
  "
1426
  [(set_attr "predicable" "yes")
1427
   (set_attr "arch" "*, iwmmxt2")
1428
   (set_attr "wtype" "wsrl, wsrl")]
1429
)
1079
1430
1080
(define_insn "lshrdi3_di"
1431
(define_insn "ashl<mode>3_di"
1081
  [(set (match_operand:DI              0 "register_operand" "=y")
1432
  [(set (match_operand:VSHFT               0 "register_operand" "=y,y")
1082
	(lshiftrt:DI (match_operand:DI 1 "register_operand" "y")
1433
        (ashift:VSHFT (match_operand:VSHFT 1 "register_operand" "y,y")
1083
		     (match_operand:DI 2 "register_operand" "y")))]
1434
		      (match_operand:DI    2 "imm_or_reg_operand" "y,i")))]
1084
  "TARGET_REALLY_IWMMXT"
1085
  "wsrld%?\\t%0, %1, %2"
1086
  [(set_attr "predicable" "yes")])
1087
1088
(define_insn "ashlv4hi3_di"
1089
  [(set (match_operand:V4HI              0 "register_operand" "=y")
1090
        (ashift:V4HI (match_operand:V4HI 1 "register_operand" "y")
1091
		     (match_operand:DI   2 "register_operand" "y")))]
1092
  "TARGET_REALLY_IWMMXT"
1093
  "wsllh%?\\t%0, %1, %2"
1094
  [(set_attr "predicable" "yes")])
1095
1096
(define_insn "ashlv2si3_di"
1097
  [(set (match_operand:V2SI              0 "register_operand" "=y")
1098
        (ashift:V2SI (match_operand:V2SI 1 "register_operand" "y")
1099
		       (match_operand:DI 2 "register_operand" "y")))]
1100
  "TARGET_REALLY_IWMMXT"
1101
  "wsllw%?\\t%0, %1, %2"
1102
  [(set_attr "predicable" "yes")])
1103
1104
(define_insn "ashldi3_di"
1105
  [(set (match_operand:DI            0 "register_operand" "=y")
1106
	(ashift:DI (match_operand:DI 1 "register_operand" "y")
1107
		   (match_operand:DI 2 "register_operand" "y")))]
1108
  "TARGET_REALLY_IWMMXT"
1435
  "TARGET_REALLY_IWMMXT"
1109
  "wslld%?\\t%0, %1, %2"
1436
  "*
1110
  [(set_attr "predicable" "yes")])
1437
  switch (which_alternative)
1438
    {
1439
    case 0:
1440
      return \"wsll<MMX_char>%?\\t%0, %1, %2\";
1441
    case 1:
1442
      return arm_output_iwmmxt_shift_immediate (\"wsll<MMX_char>\", operands, false);
1443
    default:
1444
      gcc_unreachable ();
1445
    }
1446
  "
1447
  [(set_attr "predicable" "yes")
1448
   (set_attr "arch" "*, iwmmxt2")
1449
   (set_attr "wtype" "wsll, wsll")]
1450
)
1111
1451
1112
(define_insn "iwmmxt_wmadds"
1452
(define_insn "iwmmxt_wmadds"
1113
  [(set (match_operand:V4HI               0 "register_operand" "=y")
1453
  [(set (match_operand:V2SI                                        0 "register_operand" "=y")
1114
        (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
1454
	(plus:V2SI
1115
		      (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMADDS))]
1455
	  (mult:V2SI
1456
	    (vec_select:V2SI (sign_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
1457
	                     (parallel [(const_int 1) (const_int 3)]))
1458
	    (vec_select:V2SI (sign_extend:V4SI (match_operand:V4HI 2 "register_operand" "y"))
1459
	                     (parallel [(const_int 1) (const_int 3)])))
1460
	  (mult:V2SI
1461
	    (vec_select:V2SI (sign_extend:V4SI (match_dup 1))
1462
	                     (parallel [(const_int 0) (const_int 2)]))
1463
	    (vec_select:V2SI (sign_extend:V4SI (match_dup 2))
1464
	                     (parallel [(const_int 0) (const_int 2)])))))]
1116
  "TARGET_REALLY_IWMMXT"
1465
  "TARGET_REALLY_IWMMXT"
1117
  "wmadds%?\\t%0, %1, %2"
1466
  "wmadds%?\\t%0, %1, %2"
1118
  [(set_attr "predicable" "yes")])
1467
  [(set_attr "predicable" "yes")
1468
   (set_attr "wtype" "wmadd")]
1469
)
1119
1470
1120
(define_insn "iwmmxt_wmaddu"
1471
(define_insn "iwmmxt_wmaddu"
1121
  [(set (match_operand:V4HI               0 "register_operand" "=y")
1472
  [(set (match_operand:V2SI               0 "register_operand" "=y")
1122
        (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
1473
	(plus:V2SI
1123
		      (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WMADDU))]
1474
	  (mult:V2SI
1475
	    (vec_select:V2SI (zero_extend:V4SI (match_operand:V4HI 1 "register_operand" "y"))
1476
	                     (parallel [(const_int 1) (const_int 3)]))
1477
	    (vec_select:V2SI (zero_extend:V4SI (match_operand:V4HI 2 "register_operand" "y"))
1478
	                     (parallel [(const_int 1) (const_int 3)])))
1479
	  (mult:V2SI
1480
	    (vec_select:V2SI (zero_extend:V4SI (match_dup 1))
1481
	                     (parallel [(const_int 0) (const_int 2)]))
1482
	    (vec_select:V2SI (zero_extend:V4SI (match_dup 2))
1483
	                     (parallel [(const_int 0) (const_int 2)])))))]
1124
  "TARGET_REALLY_IWMMXT"
1484
  "TARGET_REALLY_IWMMXT"
1125
  "wmaddu%?\\t%0, %1, %2"
1485
  "wmaddu%?\\t%0, %1, %2"
1126
  [(set_attr "predicable" "yes")])
1486
  [(set_attr "predicable" "yes")
1487
   (set_attr "wtype" "wmadd")]
1488
)
1127
1489
1128
(define_insn "iwmmxt_tmia"
1490
(define_insn "iwmmxt_tmia"
1129
  [(set (match_operand:DI                    0 "register_operand" "=y")
1491
  [(set (match_operand:DI                     0 "register_operand" "=y")
1130
	(plus:DI (match_operand:DI           1 "register_operand" "0")
1492
	(plus:DI (match_operand:DI            1 "register_operand" "0")
1131
		 (mult:DI (sign_extend:DI
1493
		 (mult:DI (sign_extend:DI
1132
			   (match_operand:SI 2 "register_operand" "r"))
1494
			    (match_operand:SI 2 "register_operand" "r"))
1133
			  (sign_extend:DI
1495
			  (sign_extend:DI
1134
			   (match_operand:SI 3 "register_operand" "r")))))]
1496
			    (match_operand:SI 3 "register_operand" "r")))))]
1135
  "TARGET_REALLY_IWMMXT"
1497
  "TARGET_REALLY_IWMMXT"
1136
  "tmia%?\\t%0, %2, %3"
1498
  "tmia%?\\t%0, %2, %3"
1137
  [(set_attr "predicable" "yes")])
1499
  [(set_attr "predicable" "yes")
1500
   (set_attr "wtype" "tmia")]
1501
)
1138
1502
1139
(define_insn "iwmmxt_tmiaph"
1503
(define_insn "iwmmxt_tmiaph"
1140
  [(set (match_operand:DI          0 "register_operand" "=y")
1504
  [(set (match_operand:DI                                    0 "register_operand" "=y")
1141
	(plus:DI (match_operand:DI 1 "register_operand" "0")
1505
	(plus:DI (match_operand:DI                           1 "register_operand" "0")
1142
		 (plus:DI
1506
		 (plus:DI
1143
		  (mult:DI (sign_extend:DI
1507
		   (mult:DI (sign_extend:DI
1144
			    (truncate:HI (match_operand:SI 2 "register_operand" "r")))
1508
			      (truncate:HI (match_operand:SI 2 "register_operand" "r")))
1145
			   (sign_extend:DI
1509
			    (sign_extend:DI
1146
			    (truncate:HI (match_operand:SI 3 "register_operand" "r"))))
1510
			      (truncate:HI (match_operand:SI 3 "register_operand" "r"))))
1147
		  (mult:DI (sign_extend:DI
1511
		   (mult:DI (sign_extend:DI
1148
			    (truncate:HI (ashiftrt:SI (match_dup 2) (const_int 16))))
1512
			      (truncate:HI (ashiftrt:SI (match_dup 2) (const_int 16))))
1149
			   (sign_extend:DI
1513
			    (sign_extend:DI
1150
			    (truncate:HI (ashiftrt:SI (match_dup 3) (const_int 16))))))))]
1514
			      (truncate:HI (ashiftrt:SI (match_dup 3) (const_int 16))))))))]
1151
  "TARGET_REALLY_IWMMXT"
1515
  "TARGET_REALLY_IWMMXT"
1152
  "tmiaph%?\\t%0, %2, %3"
1516
  "tmiaph%?\\t%0, %2, %3"
1153
  [(set_attr "predicable" "yes")])
1517
  [(set_attr "predicable" "yes")
1518
   (set_attr "wtype" "tmiaph")]
1519
)
1154
1520
1155
(define_insn "iwmmxt_tmiabb"
1521
(define_insn "iwmmxt_tmiabb"
1156
  [(set (match_operand:DI          0 "register_operand" "=y")
1522
  [(set (match_operand:DI                                  0 "register_operand" "=y")
1157
	(plus:DI (match_operand:DI 1 "register_operand" "0")
1523
	(plus:DI (match_operand:DI                         1 "register_operand" "0")
1158
		 (mult:DI (sign_extend:DI
1524
		 (mult:DI (sign_extend:DI
1159
			   (truncate:HI (match_operand:SI 2 "register_operand" "r")))
1525
			    (truncate:HI (match_operand:SI 2 "register_operand" "r")))
1160
			  (sign_extend:DI
1526
			  (sign_extend:DI
1161
			   (truncate:HI (match_operand:SI 3 "register_operand" "r"))))))]
1527
			    (truncate:HI (match_operand:SI 3 "register_operand" "r"))))))]
1162
  "TARGET_REALLY_IWMMXT"
1528
  "TARGET_REALLY_IWMMXT"
1163
  "tmiabb%?\\t%0, %2, %3"
1529
  "tmiabb%?\\t%0, %2, %3"
1164
  [(set_attr "predicable" "yes")])
1530
  [(set_attr "predicable" "yes")
1531
   (set_attr "wtype" "tmiaxy")]
1532
)
1165
1533
1166
(define_insn "iwmmxt_tmiatb"
1534
(define_insn "iwmmxt_tmiatb"
1167
  [(set (match_operand:DI          0 "register_operand" "=y")
1535
  [(set (match_operand:DI                         0 "register_operand" "=y")
1168
	(plus:DI (match_operand:DI 1 "register_operand" "0")
1536
	(plus:DI (match_operand:DI                1 "register_operand" "0")
1169
		 (mult:DI (sign_extend:DI
1537
		 (mult:DI (sign_extend:DI
1170
			   (truncate:HI (ashiftrt:SI
1538
			    (truncate:HI
1171
					 (match_operand:SI 2 "register_operand" "r")
1539
			      (ashiftrt:SI
1172
					 (const_int 16))))
1540
				(match_operand:SI 2 "register_operand" "r")
1541
				(const_int 16))))
1173
			  (sign_extend:DI
1542
			  (sign_extend:DI
1174
			   (truncate:HI (match_operand:SI 3 "register_operand" "r"))))))]
1543
			    (truncate:HI
1544
			      (match_operand:SI   3 "register_operand" "r"))))))]
1175
  "TARGET_REALLY_IWMMXT"
1545
  "TARGET_REALLY_IWMMXT"
1176
  "tmiatb%?\\t%0, %2, %3"
1546
  "tmiatb%?\\t%0, %2, %3"
1177
  [(set_attr "predicable" "yes")])
1547
  [(set_attr "predicable" "yes")
1548
   (set_attr "wtype" "tmiaxy")]
1549
)
1178
1550
1179
(define_insn "iwmmxt_tmiabt"
1551
(define_insn "iwmmxt_tmiabt"
1180
  [(set (match_operand:DI          0 "register_operand" "=y")
1552
  [(set (match_operand:DI                         0 "register_operand" "=y")
1181
	(plus:DI (match_operand:DI 1 "register_operand" "0")
1553
	(plus:DI (match_operand:DI                1 "register_operand" "0")
1182
		 (mult:DI (sign_extend:DI
1554
		 (mult:DI (sign_extend:DI
1183
			   (truncate:HI (match_operand:SI 2 "register_operand" "r")))
1555
			    (truncate:HI
1556
			      (match_operand:SI   2 "register_operand" "r")))
1184
			  (sign_extend:DI
1557
			  (sign_extend:DI
1185
			   (truncate:HI (ashiftrt:SI
1558
			    (truncate:HI
1186
					 (match_operand:SI 3 "register_operand" "r")
1559
			      (ashiftrt:SI
1187
					 (const_int 16)))))))]
1560
				(match_operand:SI 3 "register_operand" "r")
1561
				(const_int 16)))))))]
1188
  "TARGET_REALLY_IWMMXT"
1562
  "TARGET_REALLY_IWMMXT"
1189
  "tmiabt%?\\t%0, %2, %3"
1563
  "tmiabt%?\\t%0, %2, %3"
1190
  [(set_attr "predicable" "yes")])
1564
  [(set_attr "predicable" "yes")
1565
   (set_attr "wtype" "tmiaxy")]
1566
)
1191
1567
1192
(define_insn "iwmmxt_tmiatt"
1568
(define_insn "iwmmxt_tmiatt"
1193
  [(set (match_operand:DI          0 "register_operand" "=y")
1569
  [(set (match_operand:DI          0 "register_operand" "=y")
1194
	(plus:DI (match_operand:DI 1 "register_operand" "0")
1570
	(plus:DI (match_operand:DI 1 "register_operand" "0")
1195
		 (mult:DI (sign_extend:DI
1571
		 (mult:DI (sign_extend:DI
1196
			   (truncate:HI (ashiftrt:SI
1572
			    (truncate:HI
1197
					 (match_operand:SI 2 "register_operand" "r")
1573
			      (ashiftrt:SI
1198
					 (const_int 16))))
1574
				(match_operand:SI 2 "register_operand" "r")
1575
				(const_int 16))))
1199
			  (sign_extend:DI
1576
			  (sign_extend:DI
1200
			   (truncate:HI (ashiftrt:SI
1577
			    (truncate:HI
1201
					 (match_operand:SI 3 "register_operand" "r")
1578
			      (ashiftrt:SI
1202
					 (const_int 16)))))))]
1579
				(match_operand:SI 3 "register_operand" "r")
1580
				(const_int 16)))))))]
1203
  "TARGET_REALLY_IWMMXT"
1581
  "TARGET_REALLY_IWMMXT"
1204
  "tmiatt%?\\t%0, %2, %3"
1582
  "tmiatt%?\\t%0, %2, %3"
1205
  [(set_attr "predicable" "yes")])
1583
  [(set_attr "predicable" "yes")
1206
1584
   (set_attr "wtype" "tmiaxy")]
1207
(define_insn "iwmmxt_tbcstqi"
1585
)
1208
  [(set (match_operand:V8QI                   0 "register_operand" "=y")
1209
	(vec_duplicate:V8QI (match_operand:QI 1 "register_operand" "r")))]
1210
  "TARGET_REALLY_IWMMXT"
1211
  "tbcstb%?\\t%0, %1"
1212
  [(set_attr "predicable" "yes")])
1213
1214
(define_insn "iwmmxt_tbcsthi"
1215
  [(set (match_operand:V4HI                   0 "register_operand" "=y")
1216
	(vec_duplicate:V4HI (match_operand:HI 1 "register_operand" "r")))]
1217
  "TARGET_REALLY_IWMMXT"
1218
  "tbcsth%?\\t%0, %1"
1219
  [(set_attr "predicable" "yes")])
1220
1221
(define_insn "iwmmxt_tbcstsi"
1222
  [(set (match_operand:V2SI                   0 "register_operand" "=y")
1223
	(vec_duplicate:V2SI (match_operand:SI 1 "register_operand" "r")))]
1224
  "TARGET_REALLY_IWMMXT"
1225
  "tbcstw%?\\t%0, %1"
1226
  [(set_attr "predicable" "yes")])
1227
1586
1228
(define_insn "iwmmxt_tmovmskb"
1587
(define_insn "iwmmxt_tmovmskb"
1229
  [(set (match_operand:SI               0 "register_operand" "=r")
1588
  [(set (match_operand:SI               0 "register_operand" "=r")
1230
	(unspec:SI [(match_operand:V8QI 1 "register_operand" "y")] UNSPEC_TMOVMSK))]
1589
	(unspec:SI [(match_operand:V8QI 1 "register_operand" "y")] UNSPEC_TMOVMSK))]
1231
  "TARGET_REALLY_IWMMXT"
1590
  "TARGET_REALLY_IWMMXT"
1232
  "tmovmskb%?\\t%0, %1"
1591
  "tmovmskb%?\\t%0, %1"
1233
  [(set_attr "predicable" "yes")])
1592
  [(set_attr "predicable" "yes")
1593
   (set_attr "wtype" "tmovmsk")]
1594
)
1234
1595
1235
(define_insn "iwmmxt_tmovmskh"
1596
(define_insn "iwmmxt_tmovmskh"
1236
  [(set (match_operand:SI               0 "register_operand" "=r")
1597
  [(set (match_operand:SI               0 "register_operand" "=r")
1237
	(unspec:SI [(match_operand:V4HI 1 "register_operand" "y")] UNSPEC_TMOVMSK))]
1598
	(unspec:SI [(match_operand:V4HI 1 "register_operand" "y")] UNSPEC_TMOVMSK))]
1238
  "TARGET_REALLY_IWMMXT"
1599
  "TARGET_REALLY_IWMMXT"
1239
  "tmovmskh%?\\t%0, %1"
1600
  "tmovmskh%?\\t%0, %1"
1240
  [(set_attr "predicable" "yes")])
1601
  [(set_attr "predicable" "yes")
1602
   (set_attr "wtype" "tmovmsk")]
1603
)
1241
1604
1242
(define_insn "iwmmxt_tmovmskw"
1605
(define_insn "iwmmxt_tmovmskw"
1243
  [(set (match_operand:SI               0 "register_operand" "=r")
1606
  [(set (match_operand:SI               0 "register_operand" "=r")
1244
	(unspec:SI [(match_operand:V2SI 1 "register_operand" "y")] UNSPEC_TMOVMSK))]
1607
	(unspec:SI [(match_operand:V2SI 1 "register_operand" "y")] UNSPEC_TMOVMSK))]
1245
  "TARGET_REALLY_IWMMXT"
1608
  "TARGET_REALLY_IWMMXT"
1246
  "tmovmskw%?\\t%0, %1"
1609
  "tmovmskw%?\\t%0, %1"
1247
  [(set_attr "predicable" "yes")])
1610
  [(set_attr "predicable" "yes")
1611
   (set_attr "wtype" "tmovmsk")]
1612
)
1248
1613
1249
(define_insn "iwmmxt_waccb"
1614
(define_insn "iwmmxt_waccb"
1250
  [(set (match_operand:DI               0 "register_operand" "=y")
1615
  [(set (match_operand:DI               0 "register_operand" "=y")
1251
	(unspec:DI [(match_operand:V8QI 1 "register_operand" "y")] UNSPEC_WACC))]
1616
	(unspec:DI [(match_operand:V8QI 1 "register_operand" "y")] UNSPEC_WACC))]
1252
  "TARGET_REALLY_IWMMXT"
1617
  "TARGET_REALLY_IWMMXT"
1253
  "waccb%?\\t%0, %1"
1618
  "waccb%?\\t%0, %1"
1254
  [(set_attr "predicable" "yes")])
1619
  [(set_attr "predicable" "yes")
1620
   (set_attr "wtype" "wacc")]
1621
)
1255
1622
1256
(define_insn "iwmmxt_wacch"
1623
(define_insn "iwmmxt_wacch"
1257
  [(set (match_operand:DI               0 "register_operand" "=y")
1624
  [(set (match_operand:DI               0 "register_operand" "=y")
1258
	(unspec:DI [(match_operand:V4HI 1 "register_operand" "y")] UNSPEC_WACC))]
1625
	(unspec:DI [(match_operand:V4HI 1 "register_operand" "y")] UNSPEC_WACC))]
1259
  "TARGET_REALLY_IWMMXT"
1626
  "TARGET_REALLY_IWMMXT"
1260
  "wacch%?\\t%0, %1"
1627
  "wacch%?\\t%0, %1"
1261
  [(set_attr "predicable" "yes")])
1628
  [(set_attr "predicable" "yes")
1629
   (set_attr "wtype" "wacc")]
1630
)
1262
1631
1263
(define_insn "iwmmxt_waccw"
1632
(define_insn "iwmmxt_waccw"
1264
  [(set (match_operand:DI               0 "register_operand" "=y")
1633
  [(set (match_operand:DI               0 "register_operand" "=y")
1265
	(unspec:DI [(match_operand:V2SI 1 "register_operand" "y")] UNSPEC_WACC))]
1634
	(unspec:DI [(match_operand:V2SI 1 "register_operand" "y")] UNSPEC_WACC))]
1266
  "TARGET_REALLY_IWMMXT"
1635
  "TARGET_REALLY_IWMMXT"
1267
  "waccw%?\\t%0, %1"
1636
  "waccw%?\\t%0, %1"
1268
  [(set_attr "predicable" "yes")])
1637
  [(set_attr "predicable" "yes")
1638
   (set_attr "wtype" "wacc")]
1639
)
1640
1641
;; use unspec here to prevent 8 * imm to be optimized by cse
1642
(define_insn "iwmmxt_waligni"
1643
  [(set (match_operand:V8QI                                0 "register_operand" "=y")
1644
	(unspec:V8QI [(subreg:V8QI
1645
		        (ashiftrt:TI
1646
		          (subreg:TI (vec_concat:V16QI
1647
				       (match_operand:V8QI 1 "register_operand" "y")
1648
				       (match_operand:V8QI 2 "register_operand" "y")) 0)
1649
		          (mult:SI
1650
		            (match_operand:SI              3 "immediate_operand" "i")
1651
		            (const_int 8))) 0)] UNSPEC_WALIGNI))]
1652
  "TARGET_REALLY_IWMMXT"
1653
  "waligni%?\\t%0, %1, %2, %3"
1654
  [(set_attr "predicable" "yes")
1655
   (set_attr "wtype" "waligni")]
1656
)
1269
1657
1270
(define_insn "iwmmxt_walign"
1658
(define_insn "iwmmxt_walignr"
1271
  [(set (match_operand:V8QI                           0 "register_operand" "=y,y")
1659
  [(set (match_operand:V8QI                           0 "register_operand" "=y")
1272
	(subreg:V8QI (ashiftrt:TI
1660
	(subreg:V8QI (ashiftrt:TI
1273
		      (subreg:TI (vec_concat:V16QI
1661
		       (subreg:TI (vec_concat:V16QI
1274
				  (match_operand:V8QI 1 "register_operand" "y,y")
1662
				    (match_operand:V8QI 1 "register_operand" "y")
1275
				  (match_operand:V8QI 2 "register_operand" "y,y")) 0)
1663
				    (match_operand:V8QI 2 "register_operand" "y")) 0)
1276
		      (mult:SI
1664
		       (mult:SI
1277
		       (match_operand:SI              3 "nonmemory_operand" "i,z")
1665
		         (zero_extract:SI (match_operand:SI 3 "register_operand" "z") (const_int 3) (const_int 0))
1278
		       (const_int 8))) 0))]
1666
		         (const_int 8))) 0))]
1279
  "TARGET_REALLY_IWMMXT"
1667
  "TARGET_REALLY_IWMMXT"
1280
  "@
1668
  "walignr%U3%?\\t%0, %1, %2"
1281
   waligni%?\\t%0, %1, %2, %3
1669
  [(set_attr "predicable" "yes")
1282
   walignr%U3%?\\t%0, %1, %2"
1670
   (set_attr "wtype" "walignr")]
1283
  [(set_attr "predicable" "yes")])
1671
)
1284
1672
1285
(define_insn "iwmmxt_tmrc"
1673
(define_insn "iwmmxt_walignr0"
1286
  [(set (match_operand:SI                      0 "register_operand" "=r")
1674
  [(set (match_operand:V8QI                           0 "register_operand" "=y")
1287
	(unspec_volatile:SI [(match_operand:SI 1 "immediate_operand" "i")]
1675
	(subreg:V8QI (ashiftrt:TI
1288
			    VUNSPEC_TMRC))]
1676
		       (subreg:TI (vec_concat:V16QI
1289
  "TARGET_REALLY_IWMMXT"
1677
				    (match_operand:V8QI 1 "register_operand" "y")
1290
  "tmrc%?\\t%0, %w1"
1678
				    (match_operand:V8QI 2 "register_operand" "y")) 0)
1291
  [(set_attr "predicable" "yes")])
1679
		       (mult:SI
1292
1680
		         (zero_extract:SI (reg:SI WCGR0) (const_int 3) (const_int 0))
1293
(define_insn "iwmmxt_tmcr"
1681
		         (const_int 8))) 0))]
1294
  [(unspec_volatile:SI [(match_operand:SI 0 "immediate_operand" "i")
1682
  "TARGET_REALLY_IWMMXT"
1295
			(match_operand:SI 1 "register_operand"  "r")]
1683
  "walignr0%?\\t%0, %1, %2"
1296
		       VUNSPEC_TMCR)]
1684
  [(set_attr "predicable" "yes")
1685
   (set_attr "wtype" "walignr")]
1686
)
1687
1688
(define_insn "iwmmxt_walignr1"
1689
  [(set (match_operand:V8QI                           0 "register_operand" "=y")
1690
	(subreg:V8QI (ashiftrt:TI
1691
		       (subreg:TI (vec_concat:V16QI
1692
				    (match_operand:V8QI 1 "register_operand" "y")
1693
				    (match_operand:V8QI 2 "register_operand" "y")) 0)
1694
		       (mult:SI
1695
		         (zero_extract:SI (reg:SI WCGR1) (const_int 3) (const_int 0))
1696
		         (const_int 8))) 0))]
1697
  "TARGET_REALLY_IWMMXT"
1698
  "walignr1%?\\t%0, %1, %2"
1699
  [(set_attr "predicable" "yes")
1700
   (set_attr "wtype" "walignr")]
1701
)
1702
1703
(define_insn "iwmmxt_walignr2"
1704
  [(set (match_operand:V8QI                           0 "register_operand" "=y")
1705
	(subreg:V8QI (ashiftrt:TI
1706
		       (subreg:TI (vec_concat:V16QI
1707
				    (match_operand:V8QI 1 "register_operand" "y")
1708
				    (match_operand:V8QI 2 "register_operand" "y")) 0)
1709
		       (mult:SI
1710
		         (zero_extract:SI (reg:SI WCGR2) (const_int 3) (const_int 0))
1711
		         (const_int 8))) 0))]
1712
  "TARGET_REALLY_IWMMXT"
1713
  "walignr2%?\\t%0, %1, %2"
1714
  [(set_attr "predicable" "yes")
1715
   (set_attr "wtype" "walignr")]
1716
)
1717
1718
(define_insn "iwmmxt_walignr3"
1719
  [(set (match_operand:V8QI                           0 "register_operand" "=y")
1720
	(subreg:V8QI (ashiftrt:TI
1721
		       (subreg:TI (vec_concat:V16QI
1722
				    (match_operand:V8QI 1 "register_operand" "y")
1723
				    (match_operand:V8QI 2 "register_operand" "y")) 0)
1724
		       (mult:SI
1725
		         (zero_extract:SI (reg:SI WCGR3) (const_int 3) (const_int 0))
1726
		         (const_int 8))) 0))]
1297
  "TARGET_REALLY_IWMMXT"
1727
  "TARGET_REALLY_IWMMXT"
1298
  "tmcr%?\\t%w0, %1"
1728
  "walignr3%?\\t%0, %1, %2"
1299
  [(set_attr "predicable" "yes")])
1729
  [(set_attr "predicable" "yes")
1730
   (set_attr "wtype" "walignr")]
1731
)
1300
1732
1301
(define_insn "iwmmxt_wsadb"
1733
(define_insn "iwmmxt_wsadb"
1302
  [(set (match_operand:V8QI               0 "register_operand" "=y")
1734
  [(set (match_operand:V2SI               0 "register_operand" "=y")
1303
        (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "y")
1735
        (unspec:V2SI [
1304
		      (match_operand:V8QI 2 "register_operand" "y")] UNSPEC_WSAD))]
1736
		      (match_operand:V2SI 1 "register_operand" "0")
1737
		      (match_operand:V8QI 2 "register_operand" "y")
1738
		      (match_operand:V8QI 3 "register_operand" "y")] UNSPEC_WSAD))]
1305
  "TARGET_REALLY_IWMMXT"
1739
  "TARGET_REALLY_IWMMXT"
1306
  "wsadb%?\\t%0, %1, %2"
1740
  "wsadb%?\\t%0, %2, %3"
1307
  [(set_attr "predicable" "yes")])
1741
  [(set_attr "predicable" "yes")
1742
   (set_attr "wtype" "wsad")]
1743
)
1308
1744
1309
(define_insn "iwmmxt_wsadh"
1745
(define_insn "iwmmxt_wsadh"
1310
  [(set (match_operand:V4HI               0 "register_operand" "=y")
1746
  [(set (match_operand:V2SI               0 "register_operand" "=y")
1311
        (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
1747
        (unspec:V2SI [
1312
		      (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WSAD))]
1748
		      (match_operand:V2SI 1 "register_operand" "0")
1749
		      (match_operand:V4HI 2 "register_operand" "y")
1750
		      (match_operand:V4HI 3 "register_operand" "y")] UNSPEC_WSAD))]
1313
  "TARGET_REALLY_IWMMXT"
1751
  "TARGET_REALLY_IWMMXT"
1314
  "wsadh%?\\t%0, %1, %2"
1752
  "wsadh%?\\t%0, %2, %3"
1315
  [(set_attr "predicable" "yes")])
1753
  [(set_attr "predicable" "yes")
1754
   (set_attr "wtype" "wsad")]
1755
)
1316
1756
1317
(define_insn "iwmmxt_wsadbz"
1757
(define_insn "iwmmxt_wsadbz"
1318
  [(set (match_operand:V8QI               0 "register_operand" "=y")
1758
  [(set (match_operand:V2SI               0 "register_operand" "=y")
1319
        (unspec:V8QI [(match_operand:V8QI 1 "register_operand" "y")
1759
        (unspec:V2SI [(match_operand:V8QI 1 "register_operand" "y")
1320
		      (match_operand:V8QI 2 "register_operand" "y")] UNSPEC_WSADZ))]
1760
		      (match_operand:V8QI 2 "register_operand" "y")] UNSPEC_WSADZ))]
1321
  "TARGET_REALLY_IWMMXT"
1761
  "TARGET_REALLY_IWMMXT"
1322
  "wsadbz%?\\t%0, %1, %2"
1762
  "wsadbz%?\\t%0, %1, %2"
1323
  [(set_attr "predicable" "yes")])
1763
  [(set_attr "predicable" "yes")
1764
   (set_attr "wtype" "wsad")]
1765
)
1324
1766
1325
(define_insn "iwmmxt_wsadhz"
1767
(define_insn "iwmmxt_wsadhz"
1326
  [(set (match_operand:V4HI               0 "register_operand" "=y")
1768
  [(set (match_operand:V2SI               0 "register_operand" "=y")
1327
        (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "y")
1769
        (unspec:V2SI [(match_operand:V4HI 1 "register_operand" "y")
1328
		      (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WSADZ))]
1770
		      (match_operand:V4HI 2 "register_operand" "y")] UNSPEC_WSADZ))]
1329
  "TARGET_REALLY_IWMMXT"
1771
  "TARGET_REALLY_IWMMXT"
1330
  "wsadhz%?\\t%0, %1, %2"
1772
  "wsadhz%?\\t%0, %1, %2"
1331
  [(set_attr "predicable" "yes")])
1773
  [(set_attr "predicable" "yes")
1774
   (set_attr "wtype" "wsad")]
1775
)
1332
1776
1777
(include "iwmmxt2.md")
(-)gcc/config/arm/marvell-f-iwmmxt.md (+179 lines)
Line 0 Link Here
1
;; Marvell WMMX2 pipeline description
2
;; Copyright (C) 2011, 2012 Free Software Foundation, Inc.
3
;; Written by Marvell, Inc.
4
5
;; This file is part of GCC.
6
7
;; GCC is free software; you can redistribute it and/or modify it
8
;; under the terms of the GNU General Public License as published
9
;; by the Free Software Foundation; either version 3, or (at your
10
;; option) any later version.
11
12
;; GCC is distributed in the hope that it will be useful, but WITHOUT
13
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15
;; License for more details.
16
17
;; You should have received a copy of the GNU General Public License
18
;; along with GCC; see the file COPYING3.  If not see
19
;; <http://www.gnu.org/licenses/>.
20
21
22
(define_automaton "marvell_f_iwmmxt")
23
24
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25
;; Pipelines
26
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27
28
;; This is a 7-stage pipelines:
29
;;
30
;;    MD | MI | ME1 | ME2 | ME3 | ME4 | MW
31
;;
32
;; There are various bypasses modelled to a greater or lesser extent.
33
;;
34
;; Latencies in this file correspond to the number of cycles after
35
;; the issue stage that it takes for the result of the instruction to
36
;; be computed, or for its side-effects to occur.
37
38
(define_cpu_unit "mf_iwmmxt_MD" "marvell_f_iwmmxt")
39
(define_cpu_unit "mf_iwmmxt_MI" "marvell_f_iwmmxt")
40
(define_cpu_unit "mf_iwmmxt_ME1" "marvell_f_iwmmxt")
41
(define_cpu_unit "mf_iwmmxt_ME2" "marvell_f_iwmmxt")
42
(define_cpu_unit "mf_iwmmxt_ME3" "marvell_f_iwmmxt")
43
(define_cpu_unit "mf_iwmmxt_ME4" "marvell_f_iwmmxt")
44
(define_cpu_unit "mf_iwmmxt_MW" "marvell_f_iwmmxt")
45
46
(define_reservation "mf_iwmmxt_ME"
47
      "mf_iwmmxt_ME1,mf_iwmmxt_ME2,mf_iwmmxt_ME3,mf_iwmmxt_ME4"
48
)
49
50
(define_reservation "mf_iwmmxt_pipeline"
51
      "mf_iwmmxt_MD, mf_iwmmxt_MI, mf_iwmmxt_ME, mf_iwmmxt_MW"
52
)
53
54
;; An attribute to indicate whether our reservations are applicable.
55
(define_attr "marvell_f_iwmmxt" "yes,no"
56
  (const (if_then_else (symbol_ref "arm_arch_iwmmxt")
57
                       (const_string "yes") (const_string "no"))))
58
59
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
60
;; instruction classes
61
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
62
63
;; An attribute appended to instructions for classification
64
65
(define_attr "wmmxt_shift" "yes,no"
66
  (if_then_else (eq_attr "wtype" "wror, wsll, wsra, wsrl")
67
		(const_string "yes") (const_string "no"))
68
)
69
70
(define_attr "wmmxt_pack" "yes,no"
71
  (if_then_else (eq_attr "wtype" "waligni, walignr, wmerge, wpack, wshufh, wunpckeh, wunpckih, wunpckel, wunpckil")
72
		(const_string "yes") (const_string "no"))
73
)
74
75
(define_attr "wmmxt_mult_c1" "yes,no"
76
  (if_then_else (eq_attr "wtype" "wmac, wmadd, wmiaxy, wmiawxy, wmulw, wqmiaxy, wqmulwm")
77
		(const_string "yes") (const_string "no"))
78
)
79
80
(define_attr "wmmxt_mult_c2" "yes,no"
81
  (if_then_else (eq_attr "wtype" "wmul, wqmulm")
82
		(const_string "yes") (const_string "no"))
83
)
84
85
(define_attr "wmmxt_alu_c1" "yes,no"
86
  (if_then_else (eq_attr "wtype" "wabs, wabsdiff, wand, wandn, wmov, wor, wxor")
87
	        (const_string "yes") (const_string "no"))
88
)
89
90
(define_attr "wmmxt_alu_c2" "yes,no"
91
  (if_then_else (eq_attr "wtype" "wacc, wadd, waddsubhx, wavg2, wavg4, wcmpeq, wcmpgt, wmax, wmin, wsub, waddbhus, wsubaddhx")
92
		(const_string "yes") (const_string "no"))
93
)
94
95
(define_attr "wmmxt_alu_c3" "yes,no"
96
  (if_then_else (eq_attr "wtype" "wsad")
97
	        (const_string "yes") (const_string "no"))
98
)
99
100
(define_attr "wmmxt_transfer_c1" "yes,no"
101
  (if_then_else (eq_attr "wtype" "tbcst, tinsr, tmcr, tmcrr")
102
                (const_string "yes") (const_string "no"))
103
)
104
105
(define_attr "wmmxt_transfer_c2" "yes,no"
106
  (if_then_else (eq_attr "wtype" "textrm, tmovmsk, tmrc, tmrrc")
107
	        (const_string "yes") (const_string "no"))
108
)
109
110
(define_attr "wmmxt_transfer_c3" "yes,no"
111
  (if_then_else (eq_attr "wtype" "tmia, tmiaph, tmiaxy")
112
	        (const_string "yes") (const_string "no"))
113
)
114
115
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
116
;; Main description
117
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
118
119
(define_insn_reservation "marvell_f_iwmmxt_alu_c1" 1
120
  (and (eq_attr "marvell_f_iwmmxt" "yes")
121
       (eq_attr "wmmxt_alu_c1" "yes"))
122
  "mf_iwmmxt_pipeline")
123
124
(define_insn_reservation "marvell_f_iwmmxt_pack" 1
125
  (and (eq_attr "marvell_f_iwmmxt" "yes")
126
       (eq_attr "wmmxt_pack" "yes"))
127
  "mf_iwmmxt_pipeline")
128
129
(define_insn_reservation "marvell_f_iwmmxt_shift" 1
130
  (and (eq_attr "marvell_f_iwmmxt" "yes")
131
       (eq_attr "wmmxt_shift" "yes"))
132
  "mf_iwmmxt_pipeline")
133
134
(define_insn_reservation "marvell_f_iwmmxt_transfer_c1" 1
135
  (and (eq_attr "marvell_f_iwmmxt" "yes")
136
       (eq_attr "wmmxt_transfer_c1" "yes"))
137
  "mf_iwmmxt_pipeline")
138
139
(define_insn_reservation "marvell_f_iwmmxt_transfer_c2" 5
140
  (and (eq_attr "marvell_f_iwmmxt" "yes")
141
       (eq_attr "wmmxt_transfer_c2" "yes"))
142
  "mf_iwmmxt_pipeline")
143
144
(define_insn_reservation "marvell_f_iwmmxt_alu_c2" 2
145
  (and (eq_attr "marvell_f_iwmmxt" "yes")
146
       (eq_attr "wmmxt_alu_c2" "yes"))
147
  "mf_iwmmxt_pipeline")
148
149
(define_insn_reservation "marvell_f_iwmmxt_alu_c3" 3
150
  (and (eq_attr "marvell_f_iwmmxt" "yes")
151
       (eq_attr "wmmxt_alu_c3" "yes"))
152
  "mf_iwmmxt_pipeline")
153
154
(define_insn_reservation "marvell_f_iwmmxt_transfer_c3" 4
155
  (and (eq_attr "marvell_f_iwmmxt" "yes")
156
       (eq_attr "wmmxt_transfer_c3" "yes"))
157
  "mf_iwmmxt_pipeline")
158
159
(define_insn_reservation "marvell_f_iwmmxt_mult_c1" 4
160
  (and (eq_attr "marvell_f_iwmmxt" "yes")
161
       (eq_attr "wmmxt_mult_c1" "yes"))
162
  "mf_iwmmxt_pipeline")
163
164
;There is a forwarding path from ME3 stage
165
(define_insn_reservation "marvell_f_iwmmxt_mult_c2" 3
166
  (and (eq_attr "marvell_f_iwmmxt" "yes")
167
       (eq_attr "wmmxt_mult_c2" "yes"))
168
  "mf_iwmmxt_pipeline")
169
170
(define_insn_reservation "marvell_f_iwmmxt_wstr" 0
171
  (and (eq_attr "marvell_f_iwmmxt" "yes")
172
       (eq_attr "wtype" "wstr"))
173
  "mf_iwmmxt_pipeline")
174
175
;There is a forwarding path from MW stage
176
(define_insn_reservation "marvell_f_iwmmxt_wldr" 5
177
  (and (eq_attr "marvell_f_iwmmxt" "yes")
178
       (eq_attr "wtype" "wldr"))
179
  "mf_iwmmxt_pipeline")
(-)gcc/config/arm/mmintrin.h (-38 / +613 lines)
Lines 1-4 Link Here
1
/* Copyright (C) 2002, 2003, 2004, 2009 Free Software Foundation, Inc.
1
/* Copyright (C) 2002, 2003, 2004, 2009, 2012 Free Software Foundation, Inc.
2
2
3
   This file is part of GCC.
3
   This file is part of GCC.
4
4
Lines 24-39 Link Here
24
#ifndef _MMINTRIN_H_INCLUDED
24
#ifndef _MMINTRIN_H_INCLUDED
25
#define _MMINTRIN_H_INCLUDED
25
#define _MMINTRIN_H_INCLUDED
26
26
27
#ifndef __IWMMXT__
28
#error mmintrin.h included without enabling WMMX/WMMX2 instructions (e.g. -march=iwmmxt or -march=iwmmxt2)
29
#endif
30
31
32
#if defined __cplusplus
33
extern "C" {
34
/* Intrinsics use C name-mangling.  */
35
#endif /* __cplusplus */
36
27
/* The data type intended for user use.  */
37
/* The data type intended for user use.  */
28
typedef unsigned long long __m64, __int64;
38
typedef unsigned long long __m64, __int64;
29
39
30
/* Internal data types for implementing the intrinsics.  */
40
/* Internal data types for implementing the intrinsics.  */
31
typedef int __v2si __attribute__ ((vector_size (8)));
41
typedef int __v2si __attribute__ ((vector_size (8)));
32
typedef short __v4hi __attribute__ ((vector_size (8)));
42
typedef short __v4hi __attribute__ ((vector_size (8)));
33
typedef char __v8qi __attribute__ ((vector_size (8)));
43
typedef signed char __v8qi __attribute__ ((vector_size (8)));
34
44
35
/* "Convert" __m64 and __int64 into each other.  */
45
/* "Convert" __m64 and __int64 into each other.  */
36
static __inline __m64 
46
static __inline __m64
37
_mm_cvtsi64_m64 (__int64 __i)
47
_mm_cvtsi64_m64 (__int64 __i)
38
{
48
{
39
  return __i;
49
  return __i;
Lines 54-60 Link Here
54
static __inline __int64
64
static __inline __int64
55
_mm_cvtsi32_si64 (int __i)
65
_mm_cvtsi32_si64 (int __i)
56
{
66
{
57
  return __i;
67
  return (__i & 0xffffffff);
58
}
68
}
59
69
60
/* Pack the four 16-bit values from M1 into the lower four 8-bit values of
70
/* Pack the four 16-bit values from M1 into the lower four 8-bit values of
Lines 603-609 Link Here
603
static __inline __m64
613
static __inline __m64
604
_mm_andnot_si64 (__m64 __m1, __m64 __m2)
614
_mm_andnot_si64 (__m64 __m1, __m64 __m2)
605
{
615
{
606
  return __builtin_arm_wandn (__m1, __m2);
616
  return __builtin_arm_wandn (__m2, __m1);
607
}
617
}
608
618
609
/* Bit-wise inclusive OR the 64-bit values in M1 and M2.  */
619
/* Bit-wise inclusive OR the 64-bit values in M1 and M2.  */
Lines 935-941 Link Here
935
static __inline __m64
945
static __inline __m64
936
_mm_sad_pu8 (__m64 __A, __m64 __B)
946
_mm_sad_pu8 (__m64 __A, __m64 __B)
937
{
947
{
938
  return (__m64) __builtin_arm_wsadb ((__v8qi)__A, (__v8qi)__B);
948
  return (__m64) __builtin_arm_wsadbz ((__v8qi)__A, (__v8qi)__B);
949
}
950
951
static __inline __m64
952
_mm_sada_pu8 (__m64 __A, __m64 __B, __m64 __C)
953
{
954
  return (__m64) __builtin_arm_wsadb ((__v2si)__A, (__v8qi)__B, (__v8qi)__C);
939
}
955
}
940
956
941
/* Compute the sum of the absolute differences of the unsigned 16-bit
957
/* Compute the sum of the absolute differences of the unsigned 16-bit
Lines 944-952 Link Here
944
static __inline __m64
960
static __inline __m64
945
_mm_sad_pu16 (__m64 __A, __m64 __B)
961
_mm_sad_pu16 (__m64 __A, __m64 __B)
946
{
962
{
947
  return (__m64) __builtin_arm_wsadh ((__v4hi)__A, (__v4hi)__B);
963
  return (__m64) __builtin_arm_wsadhz ((__v4hi)__A, (__v4hi)__B);
964
}
965
966
static __inline __m64
967
_mm_sada_pu16 (__m64 __A, __m64 __B, __m64 __C)
968
{
969
  return (__m64) __builtin_arm_wsadh ((__v2si)__A, (__v4hi)__B, (__v4hi)__C);
948
}
970
}
949
971
972
950
/* Compute the sum of the absolute differences of the unsigned 8-bit
973
/* Compute the sum of the absolute differences of the unsigned 8-bit
951
   values in A and B.  Return the value in the lower 16-bit word; the
974
   values in A and B.  Return the value in the lower 16-bit word; the
952
   upper words are cleared.  */
975
   upper words are cleared.  */
Lines 965-975 Link Here
965
  return (__m64) __builtin_arm_wsadhz ((__v4hi)__A, (__v4hi)__B);
988
  return (__m64) __builtin_arm_wsadhz ((__v4hi)__A, (__v4hi)__B);
966
}
989
}
967
990
968
static __inline __m64
991
#define _mm_align_si64(__A,__B, N) \
969
_mm_align_si64 (__m64 __A, __m64 __B, int __C)
992
  (__m64) __builtin_arm_walign ((__v8qi) (__A),(__v8qi) (__B), (N))
970
{
971
  return (__m64) __builtin_arm_walign ((__v8qi)__A, (__v8qi)__B, __C);
972
}
973
993
974
/* Creates a 64-bit zero.  */
994
/* Creates a 64-bit zero.  */
975
static __inline __m64
995
static __inline __m64
Lines 987-1028 Link Here
987
{
1007
{
988
  switch (__regno)
1008
  switch (__regno)
989
    {
1009
    {
990
    case 0:  __builtin_arm_setwcx (__value, 0); break;
1010
    case 0:
991
    case 1:  __builtin_arm_setwcx (__value, 1); break;
1011
      __asm __volatile ("tmcr wcid, %0" :: "r"(__value));
992
    case 2:  __builtin_arm_setwcx (__value, 2); break;
1012
      break;
993
    case 3:  __builtin_arm_setwcx (__value, 3); break;
1013
    case 1:
994
    case 8:  __builtin_arm_setwcx (__value, 8); break;
1014
      __asm __volatile ("tmcr wcon, %0" :: "r"(__value));
995
    case 9:  __builtin_arm_setwcx (__value, 9); break;
1015
      break;
996
    case 10: __builtin_arm_setwcx (__value, 10); break;
1016
    case 2:
997
    case 11: __builtin_arm_setwcx (__value, 11); break;
1017
      __asm __volatile ("tmcr wcssf, %0" :: "r"(__value));
998
    default: break;
1018
      break;
1019
    case 3:
1020
      __asm __volatile ("tmcr wcasf, %0" :: "r"(__value));
1021
      break;
1022
    case 8:
1023
      __builtin_arm_setwcgr0 (__value);
1024
      break;
1025
    case 9:
1026
      __builtin_arm_setwcgr1 (__value);
1027
      break;
1028
    case 10:
1029
      __builtin_arm_setwcgr2 (__value);
1030
      break;
1031
    case 11:
1032
      __builtin_arm_setwcgr3 (__value);
1033
      break;
1034
    default:
1035
      break;
999
    }
1036
    }
1000
}
1037
}
1001
1038
1002
static __inline int
1039
static __inline int
1003
_mm_getwcx (const int __regno)
1040
_mm_getwcx (const int __regno)
1004
{
1041
{
1042
  int __value;
1005
  switch (__regno)
1043
  switch (__regno)
1006
    {
1044
    {
1007
    case 0:  return __builtin_arm_getwcx (0);
1045
    case 0:
1008
    case 1:  return __builtin_arm_getwcx (1);
1046
      __asm __volatile ("tmrc %0, wcid" : "=r"(__value));
1009
    case 2:  return __builtin_arm_getwcx (2);
1047
      break;
1010
    case 3:  return __builtin_arm_getwcx (3);
1048
    case 1:
1011
    case 8:  return __builtin_arm_getwcx (8);
1049
      __asm __volatile ("tmrc %0, wcon" : "=r"(__value));
1012
    case 9:  return __builtin_arm_getwcx (9);
1050
      break;
1013
    case 10: return __builtin_arm_getwcx (10);
1051
    case 2:
1014
    case 11: return __builtin_arm_getwcx (11);
1052
      __asm __volatile ("tmrc %0, wcssf" : "=r"(__value));
1015
    default: return 0;
1053
      break;
1054
    case 3:
1055
      __asm __volatile ("tmrc %0, wcasf" : "=r"(__value));
1056
      break;
1057
    case 8:
1058
      return __builtin_arm_getwcgr0 ();
1059
    case 9:
1060
      return __builtin_arm_getwcgr1 ();
1061
    case 10:
1062
      return __builtin_arm_getwcgr2 ();
1063
    case 11:
1064
      return __builtin_arm_getwcgr3 ();
1065
    default:
1066
      break;
1016
    }
1067
    }
1068
  return __value;
1017
}
1069
}
1018
1070
1019
/* Creates a vector of two 32-bit values; I0 is least significant.  */
1071
/* Creates a vector of two 32-bit values; I0 is least significant.  */
1020
static __inline __m64
1072
static __inline __m64
1021
_mm_set_pi32 (int __i1, int __i0)
1073
_mm_set_pi32 (int __i1, int __i0)
1022
{
1074
{
1023
  union {
1075
  union
1076
  {
1024
    __m64 __q;
1077
    __m64 __q;
1025
    struct {
1078
    struct
1079
    {
1026
      unsigned int __i0;
1080
      unsigned int __i0;
1027
      unsigned int __i1;
1081
      unsigned int __i1;
1028
    } __s;
1082
    } __s;
Lines 1038-1047 Link Here
1038
static __inline __m64
1092
static __inline __m64
1039
_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0)
1093
_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0)
1040
{
1094
{
1041
  unsigned int __i1 = (unsigned short)__w3 << 16 | (unsigned short)__w2;
1095
  unsigned int __i1 = (unsigned short) __w3 << 16 | (unsigned short) __w2;
1042
  unsigned int __i0 = (unsigned short)__w1 << 16 | (unsigned short)__w0;
1096
  unsigned int __i0 = (unsigned short) __w1 << 16 | (unsigned short) __w0;
1097
1043
  return _mm_set_pi32 (__i1, __i0);
1098
  return _mm_set_pi32 (__i1, __i0);
1044
		       
1045
}
1099
}
1046
1100
1047
/* Creates a vector of eight 8-bit values; B0 is least significant.  */
1101
/* Creates a vector of eight 8-bit values; B0 is least significant.  */
Lines 1108-1118 Link Here
1108
  return _mm_set1_pi32 (__i);
1162
  return _mm_set1_pi32 (__i);
1109
}
1163
}
1110
1164
1111
/* Convert an integer to a __m64 object.  */
1165
#ifdef __IWMMXT2__
1166
static __inline __m64
1167
_mm_abs_pi8 (__m64 m1)
1168
{
1169
  return (__m64) __builtin_arm_wabsb ((__v8qi)m1);
1170
}
1171
1172
static __inline __m64
1173
_mm_abs_pi16 (__m64 m1)
1174
{
1175
  return (__m64) __builtin_arm_wabsh ((__v4hi)m1);
1176
1177
}
1178
1179
static __inline __m64
1180
_mm_abs_pi32 (__m64 m1)
1181
{
1182
  return (__m64) __builtin_arm_wabsw ((__v2si)m1);
1183
1184
}
1185
1186
static __inline __m64
1187
_mm_addsubhx_pi16 (__m64 a, __m64 b)
1188
{
1189
  return (__m64) __builtin_arm_waddsubhx ((__v4hi)a, (__v4hi)b);
1190
}
1191
1192
static __inline __m64
1193
_mm_absdiff_pu8 (__m64 a, __m64 b)
1194
{
1195
  return (__m64) __builtin_arm_wabsdiffb ((__v8qi)a, (__v8qi)b);
1196
}
1197
1198
static __inline __m64
1199
_mm_absdiff_pu16 (__m64 a, __m64 b)
1200
{
1201
  return (__m64) __builtin_arm_wabsdiffh ((__v4hi)a, (__v4hi)b);
1202
}
1203
1204
static __inline __m64
1205
_mm_absdiff_pu32 (__m64 a, __m64 b)
1206
{
1207
  return (__m64) __builtin_arm_wabsdiffw ((__v2si)a, (__v2si)b);
1208
}
1209
1210
static __inline __m64
1211
_mm_addc_pu16 (__m64 a, __m64 b)
1212
{
1213
  __m64 result;
1214
  __asm__ __volatile__ ("waddhc	%0, %1, %2" : "=y" (result) : "y" (a),  "y" (b));
1215
  return result;
1216
}
1217
1218
static __inline __m64
1219
_mm_addc_pu32 (__m64 a, __m64 b)
1220
{
1221
  __m64 result;
1222
  __asm__ __volatile__ ("waddwc	%0, %1, %2" : "=y" (result) : "y" (a),  "y" (b));
1223
  return result;
1224
}
1225
1226
static __inline __m64
1227
_mm_avg4_pu8 (__m64 a, __m64 b)
1228
{
1229
  return (__m64) __builtin_arm_wavg4 ((__v8qi)a, (__v8qi)b);
1230
}
1231
1232
static __inline __m64
1233
_mm_avg4r_pu8 (__m64 a, __m64 b)
1234
{
1235
  return (__m64) __builtin_arm_wavg4r ((__v8qi)a, (__v8qi)b);
1236
}
1237
1238
static __inline __m64
1239
_mm_maddx_pi16 (__m64 a, __m64 b)
1240
{
1241
  return (__m64) __builtin_arm_wmaddsx ((__v4hi)a, (__v4hi)b);
1242
}
1243
1244
static __inline __m64
1245
_mm_maddx_pu16 (__m64 a, __m64 b)
1246
{
1247
  return (__m64) __builtin_arm_wmaddux ((__v4hi)a, (__v4hi)b);
1248
}
1249
1250
static __inline __m64
1251
_mm_msub_pi16 (__m64 a, __m64 b)
1252
{
1253
  return (__m64) __builtin_arm_wmaddsn ((__v4hi)a, (__v4hi)b);
1254
}
1255
1256
static __inline __m64
1257
_mm_msub_pu16 (__m64 a, __m64 b)
1258
{
1259
  return (__m64) __builtin_arm_wmaddun ((__v4hi)a, (__v4hi)b);
1260
}
1261
1262
static __inline __m64
1263
_mm_mulhi_pi32 (__m64 a, __m64 b)
1264
{
1265
  return (__m64) __builtin_arm_wmulwsm ((__v2si)a, (__v2si)b);
1266
}
1267
1268
static __inline __m64
1269
_mm_mulhi_pu32 (__m64 a, __m64 b)
1270
{
1271
  return (__m64) __builtin_arm_wmulwum ((__v2si)a, (__v2si)b);
1272
}
1273
1274
static __inline __m64
1275
_mm_mulhir_pi16 (__m64 a, __m64 b)
1276
{
1277
  return (__m64) __builtin_arm_wmulsmr ((__v4hi)a, (__v4hi)b);
1278
}
1279
1280
static __inline __m64
1281
_mm_mulhir_pi32 (__m64 a, __m64 b)
1282
{
1283
  return (__m64) __builtin_arm_wmulwsmr ((__v2si)a, (__v2si)b);
1284
}
1285
1286
static __inline __m64
1287
_mm_mulhir_pu16 (__m64 a, __m64 b)
1288
{
1289
  return (__m64) __builtin_arm_wmulumr ((__v4hi)a, (__v4hi)b);
1290
}
1291
1292
static __inline __m64
1293
_mm_mulhir_pu32 (__m64 a, __m64 b)
1294
{
1295
  return (__m64) __builtin_arm_wmulwumr ((__v2si)a, (__v2si)b);
1296
}
1297
1298
static __inline __m64
1299
_mm_mullo_pi32 (__m64 a, __m64 b)
1300
{
1301
  return (__m64) __builtin_arm_wmulwl ((__v2si)a, (__v2si)b);
1302
}
1303
1304
static __inline __m64
1305
_mm_qmulm_pi16 (__m64 a, __m64 b)
1306
{
1307
  return (__m64) __builtin_arm_wqmulm ((__v4hi)a, (__v4hi)b);
1308
}
1309
1310
static __inline __m64
1311
_mm_qmulm_pi32 (__m64 a, __m64 b)
1312
{
1313
  return (__m64) __builtin_arm_wqmulwm ((__v2si)a, (__v2si)b);
1314
}
1315
1112
static __inline __m64
1316
static __inline __m64
1113
_m_from_int (int __a)
1317
_mm_qmulmr_pi16 (__m64 a, __m64 b)
1114
{
1318
{
1115
  return (__m64)__a;
1319
  return (__m64) __builtin_arm_wqmulmr ((__v4hi)a, (__v4hi)b);
1320
}
1321
1322
static __inline __m64
1323
_mm_qmulmr_pi32 (__m64 a, __m64 b)
1324
{
1325
  return (__m64) __builtin_arm_wqmulwmr ((__v2si)a, (__v2si)b);
1326
}
1327
1328
static __inline __m64
1329
_mm_subaddhx_pi16 (__m64 a, __m64 b)
1330
{
1331
  return (__m64) __builtin_arm_wsubaddhx ((__v4hi)a, (__v4hi)b);
1332
}
1333
1334
static __inline __m64
1335
_mm_addbhusl_pu8 (__m64 a, __m64 b)
1336
{
1337
  return (__m64) __builtin_arm_waddbhusl ((__v4hi)a, (__v8qi)b);
1338
}
1339
1340
static __inline __m64
1341
_mm_addbhusm_pu8 (__m64 a, __m64 b)
1342
{
1343
  return (__m64) __builtin_arm_waddbhusm ((__v4hi)a, (__v8qi)b);
1344
}
1345
1346
#define _mm_qmiabb_pi32(acc, m1, m2) \
1347
  ({\
1348
   __m64 _acc = acc;\
1349
   __m64 _m1 = m1;\
1350
   __m64 _m2 = m2;\
1351
   _acc = (__m64) __builtin_arm_wqmiabb ((__v2si)_acc, (__v4hi)_m1, (__v4hi)_m2);\
1352
   _acc;\
1353
   })
1354
1355
#define _mm_qmiabbn_pi32(acc, m1, m2) \
1356
  ({\
1357
   __m64 _acc = acc;\
1358
   __m64 _m1 = m1;\
1359
   __m64 _m2 = m2;\
1360
   _acc = (__m64) __builtin_arm_wqmiabbn ((__v2si)_acc, (__v4hi)_m1, (__v4hi)_m2);\
1361
   _acc;\
1362
   })
1363
1364
#define _mm_qmiabt_pi32(acc, m1, m2) \
1365
  ({\
1366
   __m64 _acc = acc;\
1367
   __m64 _m1 = m1;\
1368
   __m64 _m2 = m2;\
1369
   _acc = (__m64) __builtin_arm_wqmiabt ((__v2si)_acc, (__v4hi)_m1, (__v4hi)_m2);\
1370
   _acc;\
1371
   })
1372
1373
#define _mm_qmiabtn_pi32(acc, m1, m2) \
1374
  ({\
1375
   __m64 _acc=acc;\
1376
   __m64 _m1=m1;\
1377
   __m64 _m2=m2;\
1378
   _acc = (__m64) __builtin_arm_wqmiabtn ((__v2si)_acc, (__v4hi)_m1, (__v4hi)_m2);\
1379
   _acc;\
1380
   })
1381
1382
#define _mm_qmiatb_pi32(acc, m1, m2) \
1383
  ({\
1384
   __m64 _acc = acc;\
1385
   __m64 _m1 = m1;\
1386
   __m64 _m2 = m2;\
1387
   _acc = (__m64) __builtin_arm_wqmiatb ((__v2si)_acc, (__v4hi)_m1, (__v4hi)_m2);\
1388
   _acc;\
1389
   })
1390
1391
#define _mm_qmiatbn_pi32(acc, m1, m2) \
1392
  ({\
1393
   __m64 _acc = acc;\
1394
   __m64 _m1 = m1;\
1395
   __m64 _m2 = m2;\
1396
   _acc = (__m64) __builtin_arm_wqmiatbn ((__v2si)_acc, (__v4hi)_m1, (__v4hi)_m2);\
1397
   _acc;\
1398
   })
1399
1400
#define _mm_qmiatt_pi32(acc, m1, m2) \
1401
  ({\
1402
   __m64 _acc = acc;\
1403
   __m64 _m1 = m1;\
1404
   __m64 _m2 = m2;\
1405
   _acc = (__m64) __builtin_arm_wqmiatt ((__v2si)_acc, (__v4hi)_m1, (__v4hi)_m2);\
1406
   _acc;\
1407
   })
1408
1409
#define _mm_qmiattn_pi32(acc, m1, m2) \
1410
  ({\
1411
   __m64 _acc = acc;\
1412
   __m64 _m1 = m1;\
1413
   __m64 _m2 = m2;\
1414
   _acc = (__m64) __builtin_arm_wqmiattn ((__v2si)_acc, (__v4hi)_m1, (__v4hi)_m2);\
1415
   _acc;\
1416
   })
1417
1418
#define _mm_wmiabb_si64(acc, m1, m2) \
1419
  ({\
1420
   __m64 _acc = acc;\
1421
   __m64 _m1 = m1;\
1422
   __m64 _m2 = m2;\
1423
   _acc = (__m64) __builtin_arm_wmiabb (_acc, (__v4hi)_m1, (__v4hi)_m2);\
1424
   _acc;\
1425
   })
1426
1427
#define _mm_wmiabbn_si64(acc, m1, m2) \
1428
  ({\
1429
   __m64 _acc = acc;\
1430
   __m64 _m1 = m1;\
1431
   __m64 _m2 = m2;\
1432
   _acc = (__m64) __builtin_arm_wmiabbn (_acc, (__v4hi)_m1, (__v4hi)_m2);\
1433
   _acc;\
1434
   })
1435
1436
#define _mm_wmiabt_si64(acc, m1, m2) \
1437
  ({\
1438
   __m64 _acc = acc;\
1439
   __m64 _m1 = m1;\
1440
   __m64 _m2 = m2;\
1441
   _acc = (__m64) __builtin_arm_wmiabt (_acc, (__v4hi)_m1, (__v4hi)_m2);\
1442
   _acc;\
1443
   })
1444
1445
#define _mm_wmiabtn_si64(acc, m1, m2) \
1446
  ({\
1447
   __m64 _acc = acc;\
1448
   __m64 _m1 = m1;\
1449
   __m64 _m2 = m2;\
1450
   _acc = (__m64) __builtin_arm_wmiabtn (_acc, (__v4hi)_m1, (__v4hi)_m2);\
1451
   _acc;\
1452
   })
1453
1454
#define _mm_wmiatb_si64(acc, m1, m2) \
1455
  ({\
1456
   __m64 _acc = acc;\
1457
   __m64 _m1 = m1;\
1458
   __m64 _m2 = m2;\
1459
   _acc = (__m64) __builtin_arm_wmiatb (_acc, (__v4hi)_m1, (__v4hi)_m2);\
1460
   _acc;\
1461
   })
1462
1463
#define _mm_wmiatbn_si64(acc, m1, m2) \
1464
  ({\
1465
   __m64 _acc = acc;\
1466
   __m64 _m1 = m1;\
1467
   __m64 _m2 = m2;\
1468
   _acc = (__m64) __builtin_arm_wmiatbn (_acc, (__v4hi)_m1, (__v4hi)_m2);\
1469
   _acc;\
1470
   })
1471
1472
#define _mm_wmiatt_si64(acc, m1, m2) \
1473
  ({\
1474
   __m64 _acc = acc;\
1475
   __m64 _m1 = m1;\
1476
   __m64 _m2 = m2;\
1477
   _acc = (__m64) __builtin_arm_wmiatt (_acc, (__v4hi)_m1, (__v4hi)_m2);\
1478
   _acc;\
1479
   })
1480
1481
#define _mm_wmiattn_si64(acc, m1, m2) \
1482
  ({\
1483
   __m64 _acc = acc;\
1484
   __m64 _m1 = m1;\
1485
   __m64 _m2 = m2;\
1486
   _acc = (__m64) __builtin_arm_wmiattn (_acc, (__v4hi)_m1, (__v4hi)_m2);\
1487
   _acc;\
1488
   })
1489
1490
#define _mm_wmiawbb_si64(acc, m1, m2) \
1491
  ({\
1492
   __m64 _acc = acc;\
1493
   __m64 _m1 = m1;\
1494
   __m64 _m2 = m2;\
1495
   _acc = (__m64) __builtin_arm_wmiawbb (_acc, (__v2si)_m1, (__v2si)_m2);\
1496
   _acc;\
1497
   })
1498
1499
#define _mm_wmiawbbn_si64(acc, m1, m2) \
1500
  ({\
1501
   __m64 _acc = acc;\
1502
   __m64 _m1 = m1;\
1503
   __m64 _m2 = m2;\
1504
   _acc = (__m64) __builtin_arm_wmiawbbn (_acc, (__v2si)_m1, (__v2si)_m2);\
1505
   _acc;\
1506
   })
1507
1508
#define _mm_wmiawbt_si64(acc, m1, m2) \
1509
  ({\
1510
   __m64 _acc = acc;\
1511
   __m64 _m1 = m1;\
1512
   __m64 _m2 = m2;\
1513
   _acc = (__m64) __builtin_arm_wmiawbt (_acc, (__v2si)_m1, (__v2si)_m2);\
1514
   _acc;\
1515
   })
1516
1517
#define _mm_wmiawbtn_si64(acc, m1, m2) \
1518
  ({\
1519
   __m64 _acc = acc;\
1520
   __m64 _m1 = m1;\
1521
   __m64 _m2 = m2;\
1522
   _acc = (__m64) __builtin_arm_wmiawbtn (_acc, (__v2si)_m1, (__v2si)_m2);\
1523
   _acc;\
1524
   })
1525
1526
#define _mm_wmiawtb_si64(acc, m1, m2) \
1527
  ({\
1528
   __m64 _acc = acc;\
1529
   __m64 _m1 = m1;\
1530
   __m64 _m2 = m2;\
1531
   _acc = (__m64) __builtin_arm_wmiawtb (_acc, (__v2si)_m1, (__v2si)_m2);\
1532
   _acc;\
1533
   })
1534
1535
#define _mm_wmiawtbn_si64(acc, m1, m2) \
1536
  ({\
1537
   __m64 _acc = acc;\
1538
   __m64 _m1 = m1;\
1539
   __m64 _m2 = m2;\
1540
   _acc = (__m64) __builtin_arm_wmiawtbn (_acc, (__v2si)_m1, (__v2si)_m2);\
1541
   _acc;\
1542
   })
1543
1544
#define _mm_wmiawtt_si64(acc, m1, m2) \
1545
  ({\
1546
   __m64 _acc = acc;\
1547
   __m64 _m1 = m1;\
1548
   __m64 _m2 = m2;\
1549
   _acc = (__m64) __builtin_arm_wmiawtt (_acc, (__v2si)_m1, (__v2si)_m2);\
1550
   _acc;\
1551
   })
1552
1553
#define _mm_wmiawttn_si64(acc, m1, m2) \
1554
  ({\
1555
   __m64 _acc = acc;\
1556
   __m64 _m1 = m1;\
1557
   __m64 _m2 = m2;\
1558
   _acc = (__m64) __builtin_arm_wmiawttn (_acc, (__v2si)_m1, (__v2si)_m2);\
1559
   _acc;\
1560
   })
1561
1562
/* The third arguments should be an immediate.  */
1563
#define _mm_merge_si64(a, b, n) \
1564
  ({\
1565
   __m64 result;\
1566
   result = (__m64) __builtin_arm_wmerge ((__m64) (a), (__m64) (b), (n));\
1567
   result;\
1568
   })
1569
#endif  /* __IWMMXT2__ */
1570
1571
static __inline __m64
1572
_mm_alignr0_si64 (__m64 a, __m64 b)
1573
{
1574
  return (__m64) __builtin_arm_walignr0 ((__v8qi) a, (__v8qi) b);
1575
}
1576
1577
static __inline __m64
1578
_mm_alignr1_si64 (__m64 a, __m64 b)
1579
{
1580
  return (__m64) __builtin_arm_walignr1 ((__v8qi) a, (__v8qi) b);
1581
}
1582
1583
static __inline __m64
1584
_mm_alignr2_si64 (__m64 a, __m64 b)
1585
{
1586
  return (__m64) __builtin_arm_walignr2 ((__v8qi) a, (__v8qi) b);
1587
}
1588
1589
static __inline __m64
1590
_mm_alignr3_si64 (__m64 a, __m64 b)
1591
{
1592
  return (__m64) __builtin_arm_walignr3 ((__v8qi) a, (__v8qi) b);
1593
}
1594
1595
static __inline void
1596
_mm_tandcb ()
1597
{
1598
  __asm __volatile ("tandcb r15");
1599
}
1600
1601
static __inline void
1602
_mm_tandch ()
1603
{
1604
  __asm __volatile ("tandch r15");
1605
}
1606
1607
static __inline void
1608
_mm_tandcw ()
1609
{
1610
  __asm __volatile ("tandcw r15");
1611
}
1612
1613
#define _mm_textrcb(n) \
1614
  ({\
1615
   __asm__ __volatile__ (\
1616
     "textrcb r15, %0" : : "i" (n));\
1617
   })
1618
1619
#define _mm_textrch(n) \
1620
  ({\
1621
   __asm__ __volatile__ (\
1622
     "textrch r15, %0" : : "i" (n));\
1623
   })
1624
1625
#define _mm_textrcw(n) \
1626
  ({\
1627
   __asm__ __volatile__ (\
1628
     "textrcw r15, %0" : : "i" (n));\
1629
   })
1630
1631
static __inline void
1632
_mm_torcb ()
1633
{
1634
  __asm __volatile ("torcb r15");
1635
}
1636
1637
static __inline void
1638
_mm_torch ()
1639
{
1640
  __asm __volatile ("torch r15");
1641
}
1642
1643
static __inline void
1644
_mm_torcw ()
1645
{
1646
  __asm __volatile ("torcw r15");
1647
}
1648
1649
#ifdef __IWMMXT2__
1650
static __inline void
1651
_mm_torvscb ()
1652
{
1653
  __asm __volatile ("torvscb r15");
1654
}
1655
1656
static __inline void
1657
_mm_torvsch ()
1658
{
1659
  __asm __volatile ("torvsch r15");
1660
}
1661
1662
static __inline void
1663
_mm_torvscw ()
1664
{
1665
  __asm __volatile ("torvscw r15");
1666
}
1667
#endif /* __IWMMXT2__ */
1668
1669
static __inline __m64
1670
_mm_tbcst_pi8 (int value)
1671
{
1672
  return (__m64) __builtin_arm_tbcstb ((signed char) value);
1673
}
1674
1675
static __inline __m64
1676
_mm_tbcst_pi16 (int value)
1677
{
1678
  return (__m64) __builtin_arm_tbcsth ((short) value);
1679
}
1680
1681
static __inline __m64
1682
_mm_tbcst_pi32 (int value)
1683
{
1684
  return (__m64) __builtin_arm_tbcstw (value);
1116
}
1685
}
1117
1686
1118
#define _m_packsswb _mm_packs_pi16
1687
#define _m_packsswb _mm_packs_pi16
Lines 1250-1254 Link Here
1250
#define _m_paligniq _mm_align_si64
1819
#define _m_paligniq _mm_align_si64
1251
#define _m_cvt_si2pi _mm_cvtsi64_m64
1820
#define _m_cvt_si2pi _mm_cvtsi64_m64
1252
#define _m_cvt_pi2si _mm_cvtm64_si64
1821
#define _m_cvt_pi2si _mm_cvtm64_si64
1822
#define _m_from_int _mm_cvtsi32_si64
1823
#define _m_to_int _mm_cvtsi64_si32
1824
1825
#if defined __cplusplus
1826
}; /* End "C" */
1827
#endif /* __cplusplus */
1253
1828
1254
#endif /* _MMINTRIN_H_INCLUDED */
1829
#endif /* _MMINTRIN_H_INCLUDED */
(-)gcc/config/arm/predicates.md (-1 / +6 lines)
Lines 1-5 Link Here
1
;; Predicate definitions for ARM and Thumb
1
;; Predicate definitions for ARM and Thumb
2
;; Copyright (C) 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
2
;; Copyright (C) 2004, 2007, 2008, 2010, 2012 Free Software Foundation, Inc.
3
;; Contributed by ARM Ltd.
3
;; Contributed by ARM Ltd.
4
4
5
;; This file is part of GCC.
5
;; This file is part of GCC.
Lines 619-624 Link Here
619
  (and (match_code "const_int")
619
  (and (match_code "const_int")
620
       (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)) < 64")))
620
       (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)) < 64")))
621
621
622
;; iWMMXt predicates
623
624
(define_predicate "imm_or_reg_operand"
625
  (ior (match_operand 0 "immediate_operand")
626
       (match_operand 0 "register_operand")))
622
627
623
;; Neon predicates
628
;; Neon predicates
624
629
(-)gcc/config/arm/t-arm (-1 / +3 lines)
Lines 1-6 Link Here
1
# Rules common to all arm targets
1
# Rules common to all arm targets
2
#
2
#
3
# Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011
3
# Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
4
# Free Software Foundation, Inc.
4
# Free Software Foundation, Inc.
5
#
5
#
6
# This file is part of GCC.
6
# This file is part of GCC.
Lines 49-55 Link Here
49
		$(srcdir)/config/arm/fpa.md \
49
		$(srcdir)/config/arm/fpa.md \
50
		$(srcdir)/config/arm/iterators.md \
50
		$(srcdir)/config/arm/iterators.md \
51
		$(srcdir)/config/arm/iwmmxt.md \
51
		$(srcdir)/config/arm/iwmmxt.md \
52
		$(srcdir)/config/arm/iwmmxt2.md \
52
		$(srcdir)/config/arm/ldmstm.md \
53
		$(srcdir)/config/arm/ldmstm.md \
54
		$(srcdir)/config/arm/marvell-f-iwmmxt.md \
53
		$(srcdir)/config/arm/neon.md \
55
		$(srcdir)/config/arm/neon.md \
54
		$(srcdir)/config/arm/predicates.md \
56
		$(srcdir)/config/arm/predicates.md \
55
		$(srcdir)/config/arm/sync.md \
57
		$(srcdir)/config/arm/sync.md \

Return to bug 453294