public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work043)] Move denormal warning for XXSPLTID built-in function.
@ 2021-03-30 20:27 Michael Meissner
0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2021-03-30 20:27 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:ba9996cf1f45653475d06344ec9ad26d71c4a36a
commit ba9996cf1f45653475d06344ec9ad26d71c4a36a
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Tue Mar 30 16:27:04 2021 -0400
Move denormal warning for XXSPLTID built-in function.
This patch moves the place where the warning is given if the user tries to
use XXSPLTID to load up values that are denormal 32-bit values. I felt
that this warning was better in the built-in function expansion code
than in the middle of RTL generation.
gcc/
2021-03-30 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/altivec.md (xxspltidp_v2df): Call the RTL
generation function directly, instead of using a middle man
function.
* config/rs6000/rs6000-call.c (rs6000_expand_unop_builtin): Move
warning hear about using the XXSPLTID instruction with a denormal
immediate value.
* config/rs6000/rs6000-protos.c (rs6000_emit_xxspltidp_v2df):
Delete.
* config/rs6000/rs6000.c (rs6000_emit_xxspltidp_v2df): Delete.
Diff:
---
gcc/config/rs6000/altivec.md | 2 +-
gcc/config/rs6000/rs6000-call.c | 9 +++++++++
gcc/config/rs6000/rs6000-protos.h | 2 --
gcc/config/rs6000/rs6000.c | 10 ----------
4 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 9e151f033c3..228d88210bf 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -881,7 +881,7 @@
"TARGET_POWER10"
{
long value = rs6000_const_f32_to_i32 (operands[1]);
- rs6000_emit_xxspltidp_v2df (operands[0], value);
+ emit_insn (gen_xxspltidp_v2df_inst (operands[0], GEN_INT (value)));
DONE;
})
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index f5676255387..c18b8209e36 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -9440,6 +9440,15 @@ rs6000_expand_unop_builtin (enum insn_code icode, tree exp, rtx target)
}
}
+ /* The XXSPLTIDP instruction is undefined if the 32-bit float value is
+ denormal. Warn the user that this might produce an undefined value at
+ runtime. */
+ else if (icode == CODE_FOR_xxspltidp_v2df
+ && !xxspltidp_operand (op0, mode0))
+ inform (input_location,
+ "the result for the xxspltidp instruction is undefined for "
+ "subnormal input values");
+
if (target == 0
|| GET_MODE (target) != tmode
|| ! (*insn_data[icode].operand[0].predicate) (target, tmode))
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 9fd38abe8d4..63d6c1c9c2c 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -319,6 +319,4 @@ extern bool rs6000_sum_of_two_registers_p (const_rtx expr);
extern bool rs6000_quadword_masked_address_p (const_rtx exp);
extern rtx rs6000_gen_lvx (enum machine_mode, rtx, rtx);
extern rtx rs6000_gen_stvx (enum machine_mode, rtx, rtx);
-
-extern void rs6000_emit_xxspltidp_v2df (rtx, long value);
#endif /* rs6000-protos.h */
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 6b004ff1f34..9d5fe4f2bd4 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -27852,16 +27852,6 @@ rs6000_const_f32_to_i32 (rtx operand)
return value;
}
-void
-rs6000_emit_xxspltidp_v2df (rtx dst, long value)
-{
- if (((value & 0x7F800000) == 0) && ((value & 0x7FFFFF) != 0))
- inform (input_location,
- "the result for the xxspltidp instruction "
- "is undefined for subnormal input values");
- emit_insn( gen_xxspltidp_v2df_inst (dst, GEN_INT (value)));
-}
-
/* Implement TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC. */
static bool
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-30 20:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 20:27 [gcc(refs/users/meissner/heads/work043)] Move denormal warning for XXSPLTID built-in function Michael Meissner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).