aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/nds32/nds32-intrinsic.c
diff options
context:
space:
mode:
authorMonk Chiang <sh.chiang04@gmail.com>2018-03-11 07:48:48 +0000
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>2018-03-11 07:48:48 +0000
commit3999578cc522eb57d65c00c9293ca88cfbd901c2 (patch)
tree5284f2146018d62182694d1337d2f35d0c85d39c /gcc/config/nds32/nds32-intrinsic.c
parentd8c12d24bf07594e9ea37ca120b7385152497f98 (diff)
downloadgcc-3999578cc522eb57d65c00c9293ca88cfbd901c2.zip
gcc-3999578cc522eb57d65c00c9293ca88cfbd901c2.tar.gz
gcc-3999578cc522eb57d65c00c9293ca88cfbd901c2.tar.bz2
[NDS32] Add intrinsic function for ffb, ffmism and flmism.
gcc/ * config/nds32/constants.md (unspec_element): Add UNSPEC_FFB, UNSPEC_FFMISM and UNSPEC_FLMISM. * config/nds32/nds32-intrinsic.c (bdesc_2arg): Add builtin description for ffb, ffmism and flmism. * config/nds32/nds32-intrinsic.md (unspec_ffb): Define new pattern. (unspec_ffmism): Ditto. (unspec_flmism): Ditto. (nds32_expand_builtin_impl): Check if string extension is available. * config/nds32/nds32.h (nds32_builtins): Add NDS32_BUILTIN_FFB, NDS32_BUILTIN_FFMISM and NDS32_BUILTIN_FLMISM. Co-Authored-By: Chung-Ju Wu <jasonwucj@gmail.com> Co-Authored-By: Kito Cheng <kito.cheng@gmail.com> From-SVN: r258424
Diffstat (limited to 'gcc/config/nds32/nds32-intrinsic.c')
-rw-r--r--gcc/config/nds32/nds32-intrinsic.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/config/nds32/nds32-intrinsic.c b/gcc/config/nds32/nds32-intrinsic.c
index bf51154..636b1d1 100644
--- a/gcc/config/nds32/nds32-intrinsic.c
+++ b/gcc/config/nds32/nds32-intrinsic.c
@@ -257,6 +257,9 @@ static struct builtin_description bdesc_1argimm[] =
/* Intrinsics that take two arguments. */
static struct builtin_description bdesc_2arg[] =
{
+ NDS32_BUILTIN(unspec_ffb, "ffb", FFB)
+ NDS32_BUILTIN(unspec_ffmism, "ffmsim", FFMISM)
+ NDS32_BUILTIN(unspec_flmism, "flmism", FLMISM)
NDS32_NO_TARGET_BUILTIN(unspec_volatile_mtsr, "mtsr", MTSR)
NDS32_NO_TARGET_BUILTIN(unspec_volatile_mtusr, "mtusr", MTUSR)
NDS32_NO_TARGET_BUILTIN(unaligned_store_hw, "unaligned_store_hw", UASTORE_HW)
@@ -277,6 +280,23 @@ nds32_expand_builtin_impl (tree exp,
unsigned i;
struct builtin_description *d;
+ switch (fcode)
+ {
+ /* String Extension */
+ case NDS32_BUILTIN_FFB:
+ case NDS32_BUILTIN_FFMISM:
+ case NDS32_BUILTIN_FLMISM:
+ if (!TARGET_EXT_STRING)
+ {
+ error ("don't support string extension instructions");
+ return NULL_RTX;
+ }
+ break;
+
+ default:
+ break;
+ }
+
/* Since there are no result and operands, we can simply emit this rtx. */
switch (fcode)
{