diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
index 88cb36576b..10fd6bbffc 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
@@ -45,12 +45,22 @@ routines += ieee128-vfwprintf_chk
 routines += ieee128-vswprintf_chk
 routines += ieee128-vwprintf_chk
 
+routines += ieee128-fscanf
+routines += ieee128-scanf
+routines += ieee128-sscanf
+
+routines += ieee128-vfscanf
+routines += ieee128-vscanf
+routines += ieee128-vsscanf
+
 # Printing long double values with IEEE binary128 format reuses part
 # of the internal float128 implementation (__printf_fp, __printf_fphex,
-# and __float128 variables and union members).  Thus, the compilation of
-# the following functions, must have -mfloat128 passed to the compiler.
+# and __float128 variables and union members).  Likewise, reading these
+# values reuses __strtof128_internal.  Thus, the compilation of the
+# following functions, must have -mfloat128 passed to the compiler.
 CFLAGS-vfprintf-internal.c += -mfloat128
 CFLAGS-vfwprintf-internal.c += -mfloat128
+CFLAGS-vfscanf-internal.c += -mfloat128
 
 # Basic tests for the implementation of long double with IEEE binary128
 # format and for the related redirections in installed headers.
@@ -70,6 +80,12 @@ tests-internal += test-wprintf-chk-ieee128 test-wprintf-chk-ibm128
 CFLAGS-test-wprintf-chk-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
 CFLAGS-test-wprintf-chk-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
 
+tests-internal += test-scanf-ieee128 test-scanf-ibm128
+CFLAGS-test-scanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
+CFLAGS-test-scanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
+
+$(objpfx)test-scanf-ieee128: gnulib-tests += $(f128-loader-link)
+
 ifeq ($(run-built-tests),yes)
 tests-special += $(objpfx)test-printf-ieee128.out
 tests-special += $(objpfx)test-printf-ibm128.out
@@ -82,6 +98,9 @@ tests-special += $(objpfx)test-printf-chk-ibm128.out
 
 tests-special += $(objpfx)test-wprintf-chk-ieee128.out
 tests-special += $(objpfx)test-wprintf-chk-ibm128.out
+
+tests-special += $(objpfx)test-scanf-ieee128.out
+tests-special += $(objpfx)test-scanf-ibm128.out
 endif
 
 $(objpfx)test-printf-ieee128.out: \
@@ -131,4 +150,16 @@ $(objpfx)test-wprintf-chk-ibm128.out: \
   $(objpfx)test-wprintf-chk-ibm128
 	$(SHELL) $^ '$(test-program-prefix)' $@; \
 	$(evaluate-test)
+
+$(objpfx)test-scanf-ieee128.out: \
+  ../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
+  $(objpfx)test-scanf-ieee128
+	$(SHELL) $^ '$(test-program-prefix)' $@; \
+	$(evaluate-test)
+
+$(objpfx)test-scanf-ibm128.out: \
+  ../sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh \
+  $(objpfx)test-scanf-ibm128
+	$(SHELL) $^ '$(test-program-prefix)' $@; \
+	$(evaluate-test)
 endif
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions
index 583c05cca7..26cb9aa692 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/Versions
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions
@@ -156,5 +156,13 @@ libc {
     __vfwprintf_chkieee128;
     __vswprintf_chkieee128;
     __vwprintf_chkieee128;
+
+    __fscanfieee128;
+    __scanfieee128;
+    __sscanfieee128;
+
+    __vfscanfieee128;
+    __vscanfieee128;
+    __vsscanfieee128;
   }
 }
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fscanf.c
new file mode 100644
index 0000000000..f51e822094
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-fscanf.c
@@ -0,0 +1,34 @@
+/* Wrapper for fscanf.  IEEE128 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdarg.h>
+#include <libio/libioP.h>
+
+extern int
+___ieee128_fscanf (FILE *fp, const char *format, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, format);
+  done = __vfscanf_internal (fp, format, arg, SCANF_LDBL_USES_FLOAT128);
+  va_end (arg);
+
+  return done;
+}
+strong_alias (___ieee128_fscanf, __fscanfieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-scanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-scanf.c
new file mode 100644
index 0000000000..571cf7d75d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-scanf.c
@@ -0,0 +1,34 @@
+/* Wrapper for scanf.  IEEE128 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdarg.h>
+#include <libio/libioP.h>
+
+extern int
+___ieee128_scanf (const char *format, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, format);
+  done = __vfscanf_internal (stdin, format, arg, SCANF_LDBL_USES_FLOAT128);
+  va_end (arg);
+
+  return done;
+}
+strong_alias (___ieee128_scanf, __scanfieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sscanf.c
new file mode 100644
index 0000000000..7c932955f6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-sscanf.c
@@ -0,0 +1,38 @@
+/* Wrapper for sscanf.  IEEE128 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdarg.h>
+#include <strfile.h>
+#include <libioP.h>
+
+extern int
+___ieee128_sscanf (const char *string, const char *format, ...)
+{
+  va_list arg;
+  int done;
+
+  _IO_strfile sf;
+  FILE *fp = _IO_strfile_read (&sf, string);
+
+  va_start (arg, format);
+  done = __vfscanf_internal (fp, format, arg, SCANF_LDBL_USES_FLOAT128);
+  va_end (arg);
+
+  return done;
+}
+strong_alias (___ieee128_sscanf, __sscanfieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vfscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vfscanf.c
new file mode 100644
index 0000000000..d6654e05f5
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vfscanf.c
@@ -0,0 +1,26 @@
+/* Wrapper for vfscanf.  IEEE128 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <libio/libioP.h>
+
+extern int
+___ieee128_vfscanf (FILE *fp, const char *format, va_list ap)
+{
+  return __vfscanf_internal (fp, format, ap, SCANF_LDBL_USES_FLOAT128);
+}
+strong_alias (___ieee128_vfscanf, __vfscanfieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vscanf.c
new file mode 100644
index 0000000000..5780c062bb
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vscanf.c
@@ -0,0 +1,26 @@
+/* Wrapper for vscanf.  IEEE128 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <libio/libioP.h>
+
+extern int
+___ieee128_vscanf (const char *format, va_list ap)
+{
+  return __vfscanf_internal (stdin, format, ap, SCANF_LDBL_USES_FLOAT128);
+}
+strong_alias (___ieee128_vscanf, __vscanfieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsscanf.c b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsscanf.c
new file mode 100644
index 0000000000..8ff43a95c2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-vsscanf.c
@@ -0,0 +1,29 @@
+/* Wrapper for vsscanf.  IEEE128 version.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <strfile.h>
+#include <libioP.h>
+
+extern int
+___ieee128_vsscanf (const char *string, const char *format, va_list ap)
+{
+  _IO_strfile sf;
+  FILE *fp = _IO_strfile_read (&sf, string);
+  return __vfscanf_internal (fp, format, ap, SCANF_LDBL_USES_FLOAT128);
+}
+strong_alias (___ieee128_vsscanf, __vsscanfieee128)
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ibm128.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ibm128.c
new file mode 100644
index 0000000000..8cdee601f2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ibm128.c
@@ -0,0 +1 @@
+#include <test-scanf-ldbl-compat.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ieee128.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ieee128.c
new file mode 100644
index 0000000000..8cdee601f2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ieee128.c
@@ -0,0 +1 @@
+#include <test-scanf-ldbl-compat.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat-template.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat-template.c
new file mode 100644
index 0000000000..f766897da4
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat-template.c
@@ -0,0 +1,117 @@
+/* Test for the long double variants of *scanf functions.
+   Copyright (C) 2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+
+#include <support/check.h>
+
+#define CLEAR								\
+  va_start (args, format);						\
+  ld = va_arg (args, long double *);					\
+  *ld = 0;								\
+  va_end (args);
+
+#define CLEAR_VALUE value = 0;
+
+#define CHECK								\
+  va_start (args, format);						\
+  ld = va_arg (args, long double *);					\
+  va_end (args);							\
+  if (*ld == -1)							\
+    printf ("OK");							\
+  else									\
+    printf ("ERROR (%.60Lf)", *ld);					\
+  printf ("\n");
+
+#define CHECK_VALUE							\
+  if (value == -1)							\
+    printf ("OK");							\
+  else									\
+    printf ("ERROR (%.60Lf)", value);					\
+  printf ("\n");
+
+static void
+do_test_call (FILE *stream, CHAR *string, const CHAR *format, ...)
+{
+  long double value;
+  long double *ld;
+  va_list args;
+
+  CLEAR_VALUE
+  printf ("fscanf: ");
+  FSCANF (stream, format, &value);
+  CHECK_VALUE
+
+  CLEAR_VALUE
+  printf ("scanf: ");
+  SCANF (format, &value);
+  CHECK_VALUE
+
+  CLEAR_VALUE
+  printf ("sscanf: ");
+  SSCANF (string, format, &value);
+  CHECK_VALUE
+
+  CLEAR
+  printf ("vfscanf: ");
+  va_start (args, format);
+  VFSCANF (stream, format, args);
+  va_end (args);
+  CHECK
+
+  CLEAR
+  printf ("vscanf: ");
+  va_start (args, format);
+  VSCANF (format, args);
+  va_end (args);
+  CHECK
+
+  CLEAR
+  printf ("vsscanf: ");
+  va_start (args, format);
+  VSSCANF (string, format, args);
+  va_end (args);
+  CHECK
+}
+
+static int
+do_test (void)
+{
+  CHAR string[256];
+  long double ld;
+
+  /* Scan in decimal notation.  */
+  STRCPY (string,
+	  L ("-1.0\n")
+	  L ("-1.0\n") );
+  do_test_call (stdin, string, L("%Lf"), &ld);
+
+  /* Scan in hexadecimal notation.  */
+  STRCPY (string,
+	  L ("-0x1.0p+0\n")
+	  L ("-0x1.0p+0\n") );
+  do_test_call (stdin, string, L("%La"), &ld);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.c
new file mode 100644
index 0000000000..0759d8afab
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.c
@@ -0,0 +1,10 @@
+#define CHAR char
+#define L(x) x
+#define FSCANF fscanf
+#define SSCANF sscanf
+#define SCANF scanf
+#define VFSCANF vfscanf
+#define VSSCANF vsscanf
+#define VSCANF vscanf
+#define STRCPY strcpy
+#include <test-scanf-ldbl-compat-template.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh
new file mode 100644
index 0000000000..822b4c3607
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+# Testing of *scanf.  IEEE binary128 for powerpc64le version.
+# Copyright (C) 2018 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <http://www.gnu.org/licenses/>.
+
+set -e
+
+test_program=$1; shift
+test_program_prefix=$1; shift
+test_program_output=$1; shift
+
+status=0
+
+cat <<'EOF' |
+-1.000000000000000000000000000000000000000000000000000000000000
+-1.000000000000000000000000000000000000000000000000000000000000
+-1.000000000000000000000000000000000000000000000000000000000000
+-1.000000000000000000000000000000000000000000000000000000000000
+-0x1.000000000000000000000000000000000000000000000000000000000000p+0
+-0x1.000000000000000000000000000000000000000000000000000000000000p+0
+-0x1.000000000000000000000000000000000000000000000000000000000000p+0
+-0x1.000000000000000000000000000000000000000000000000000000000000p+0
+EOF
+${test_program_prefix} \
+  ${test_program} \
+  - \
+  > ${test_program_output} || status=1
+
+cat <<'EOF' |
+fscanf: OK
+scanf: OK
+sscanf: OK
+vfscanf: OK
+vscanf: OK
+vsscanf: OK
+fscanf: OK
+scanf: OK
+sscanf: OK
+vfscanf: OK
+vscanf: OK
+vsscanf: OK
+EOF
+cmp - ${test_program_output} > /dev/null 2>&1 ||
+{
+  status=1
+  echo "*** output comparison failed"
+}
+
+exit $status
