summaryrefslogtreecommitdiff
path: root/gcc/fortran/intrinsic.c
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-31 18:56:46 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-31 18:56:46 +0000
commit41cbc93c61d605afd4022223f791b3f20f341e65 (patch)
treee145f27a4197eb4dadc10cca9f891e62a370f50d /gcc/fortran/intrinsic.c
parentc61794d6be23943b09b6ab2b98d723c75ab5ffcb (diff)
downloadgcc-41cbc93c61d605afd4022223f791b3f20f341e65.tar.gz
PR fortran/38282
* f95-lang.c (gfc_init_builtin_functions): Define popcount{,l,ll} and parity{,l,ll} builtins. * trans-intrinsic.c (gfc_conv_intrinsic_popcnt_poppar): New function. (gfc_conv_intrinsic_function): Call above new functions. * simplify.c (gfc_simplify_popcnt, gfc_simplify_poppar): New functions. * intrinsic.texi: Document POPCNT and POPPAR. * gfortran.dg/popcnt_poppar_1.F90: New test. * gfortran.dg/popcnt_poppar_2.F90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163691 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/intrinsic.c')
-rw-r--r--gcc/fortran/intrinsic.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 2ce3482e3a1..c14e14d75cd 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -2299,6 +2299,20 @@ add_functions (void)
make_generic ("parity", GFC_ISYM_PARITY, GFC_STD_F2008);
+ add_sym_1 ("popcnt", GFC_ISYM_POPCNT, CLASS_ELEMENTAL, ACTUAL_NO,
+ BT_INTEGER, di, GFC_STD_F2008,
+ gfc_check_i, gfc_simplify_popcnt, NULL,
+ i, BT_INTEGER, di, REQUIRED);
+
+ make_generic ("popcnt", GFC_ISYM_POPCNT, GFC_STD_F2008);
+
+ add_sym_1 ("poppar", GFC_ISYM_POPPAR, CLASS_ELEMENTAL, ACTUAL_NO,
+ BT_INTEGER, di, GFC_STD_F2008,
+ gfc_check_i, gfc_simplify_poppar, NULL,
+ i, BT_INTEGER, di, REQUIRED);
+
+ make_generic ("poppar", GFC_ISYM_POPPAR, GFC_STD_F2008);
+
add_sym_1 ("precision", GFC_ISYM_PRECISION, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
gfc_check_precision, gfc_simplify_precision, NULL,
x, BT_UNKNOWN, 0, REQUIRED);