From 615792b72e34b084e4aa69aad7789f2ee30e2eed Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Wed, 3 Apr 2019 11:26:09 +0000 Subject: [PATCH] S/390: Reject long disp for vector load/store early The vector memory instructions only support short displacements. Reject invalid displacements early to prevent plenty of lay instructions to be generated later which then cannot be merged properly. gcc/ChangeLog: 2019-04-03 Andreas Krebbel * config/s390/s390.c (s390_legitimate_address_p): Reject long displacement addresses for vector mode operands. From-SVN: r270122 --- gcc/ChangeLog | 5 +++++ gcc/config/s390/s390.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 48b224af02d..a280b6c2cc6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-04-03 Andreas Krebbel + + * config/s390/s390.c (s390_legitimate_address_p): Reject long + displacement addresses for vector mode operands. + 2019-04-03 Claudiu Zissulescu * config/arc/arc.c (GMASK_LEN): Define. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index bceaca3fbc8..e0b62b741f2 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -4677,6 +4677,17 @@ s390_legitimate_address_p (machine_mode mode, rtx addr, bool strict) if (!s390_decompose_address (addr, &ad)) return false; + /* The vector memory instructions only support short displacements. + Reject invalid displacements early to prevent plenty of lay + instructions to be generated later which then cannot be merged + properly. */ + if (TARGET_VX + && VECTOR_MODE_P (mode) + && ad.disp != NULL_RTX + && CONST_INT_P (ad.disp) + && !SHORT_DISP_IN_RANGE (INTVAL (ad.disp))) + return false; + if (strict) { if (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) -- 2.30.2