From 1b4bda70e5c1fecb9fea6e2fc985f1dc61318f61 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 27 Jan 2004 14:29:26 +0100 Subject: re PR target/10904 (invalid (misaligned) FP register at -O2) PR target/10904 PR target/13058 * config/sparc/sparc.h (CANNOT_CHANGE_MODE_CLASS): New. Forbid mode changes from SImode for lower FP regs if ARCH64. From-SVN: r76702 --- gcc/config/sparc/sparc.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'gcc/config/sparc') diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 06fd5ee..eeab3c6 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1264,6 +1264,20 @@ enum reg_class { NO_REGS, FPCC_REGS, I64_REGS, GENERAL_REGS, FP_REGS, {-1, -1, -1, 0x20}, /* GENERAL_OR_EXTRA_FP_REGS */ \ {-1, -1, -1, 0x3f}} /* ALL_REGS */ +/* Defines invalid mode changes. Borrowed from pa64-regs.h. + + SImode loads to floating-point registers are not zero-extended. + The definition for LOAD_EXTEND_OP specifies that integer loads + narrower than BITS_PER_WORD will be zero-extended. As a result, + we inhibit changes from SImode unless they are to a mode that is + identical in size. */ + +#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ + (TARGET_ARCH64 \ + && (FROM) == SImode \ + && GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ + ? reg_classes_intersect_p (CLASS, FP_REGS) : 0) + /* The same information, inverted: Return the class number of the smallest class containing reg number REGNO. This could be a conditional expression -- cgit v1.1