diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2024-10-29 21:08:59 +0100 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2024-11-02 19:20:07 +0100 |
commit | 10c75e2a2a15e35bd6e70503ef7e3e119ae90775 (patch) | |
tree | e9da79b9ad9258b286b966cefbccf127ebb4b7d8 /gcc/fortran/iresolve.cc | |
parent | 36a9e2b22596711455e702ea5a5a3f26e145321c (diff) | |
download | gcc-10c75e2a2a15e35bd6e70503ef7e3e119ae90775.zip gcc-10c75e2a2a15e35bd6e70503ef7e3e119ae90775.tar.gz gcc-10c75e2a2a15e35bd6e70503ef7e3e119ae90775.tar.bz2 |
Add UMASKR and UMASKL intrinsics.
gcc/fortran/ChangeLog:
* check.cc (gfc_check_mask): Handle BT_INSIGNED.
* gfortran.h (enum gfc_isym_id): Add GFC_ISYM_UMASKL and
GFC_ISYM_UMASKR.
* gfortran.texi: List UMASKL and UMASKR, remove unsigned future
unsigned arguments for MASKL and MASKR.
* intrinsic.cc (add_functions): Add UMASKL and UMASKR.
* intrinsic.h (gfc_simplify_umaskl): New function.
(gfc_simplify_umaskr): New function.
(gfc_resolve_umasklr): New function.
* intrinsic.texi: Document UMASKL and UMASKR.
* iresolve.cc (gfc_resolve_umasklr): New function.
* simplify.cc (gfc_simplify_umaskr): New function.
(gfc_simplify_umaskl): New function.
gcc/testsuite/ChangeLog:
* gfortran.dg/unsigned_39.f90: New test.
Diffstat (limited to 'gcc/fortran/iresolve.cc')
-rw-r--r-- | gcc/fortran/iresolve.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/iresolve.cc b/gcc/fortran/iresolve.cc index d8b216b..6adc630 100644 --- a/gcc/fortran/iresolve.cc +++ b/gcc/fortran/iresolve.cc @@ -2012,6 +2012,20 @@ gfc_resolve_mask (gfc_expr *f, gfc_expr *i ATTRIBUTE_UNUSED, f->value.function.name = gfc_get_string ("__maskr_i%d", f->ts.kind); } +void +gfc_resolve_umasklr (gfc_expr *f, gfc_expr *i ATTRIBUTE_UNUSED, + gfc_expr *kind) +{ + f->ts.type = BT_UNSIGNED; + f->ts.kind = kind ? mpz_get_si (kind->value.integer) + : gfc_default_unsigned_kind; + + if (f->value.function.isym->id == GFC_ISYM_UMASKL) + f->value.function.name = gfc_get_string ("__maskl_m%d", f->ts.kind); + else + f->value.function.name = gfc_get_string ("__maskr_m%d", f->ts.kind); +} + void gfc_resolve_merge (gfc_expr *f, gfc_expr *tsource, |