diff options
author | Jan Hubicka <jh@suse.cz> | 2001-07-09 21:38:19 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-07-09 19:38:19 +0000 |
commit | 5222e47075dd80a3ada4a34c2231aef6f7a3231f (patch) | |
tree | 007d8955d8f74b1e7c64f0f507a20f7bbffd6a3c /gcc | |
parent | c6c222a89a7a9f5d76b785b394a500f6c9565a9e (diff) | |
download | gcc-5222e47075dd80a3ada4a34c2231aef6f7a3231f.zip gcc-5222e47075dd80a3ada4a34c2231aef6f7a3231f.tar.gz gcc-5222e47075dd80a3ada4a34c2231aef6f7a3231f.tar.bz2 |
emit-rtl.c (gen_highpart_mode): New.
* emit-rtl.c (gen_highpart_mode): New.
* rtl.h (gen_highpart_mode): Declare.
* sparc.md (insn splitters): Use gen_highpart_mode, whenever the
operand can be VOIDmode constant.
From-SVN: r43869
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.md | 17 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 17 | ||||
-rw-r--r-- | gcc/rtl.h | 2 |
4 files changed, 35 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 807f109..3dbc451 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Mon Jul 9 21:36:00 CEST 2001 Jan Hubicka <jh@suse.cz> + + * emit-rtl.c (gen_highpart_mode): New. + * rtl.h (gen_highpart_mode): Declare. + * sparc.md (insn splitters): Use gen_highpart_mode, whenever the + operand can be VOIDmode constant. + Mon Jul 9 17:23:10 CEST 2001 Jan Hubicka <jh@suse.cz> * flow.c (redirect_edge_and_branch_force): New. diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index 61c2b9b..5a1cb92 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -5633,7 +5633,7 @@ operands[4] = gen_lowpart (SImode, operands[1]); operands[5] = gen_lowpart (SImode, operands[2]); operands[6] = gen_highpart (SImode, operands[0]); - operands[7] = gen_highpart (SImode, operands[1]); + operands[7] = gen_highpart_mode (SImode, DImode, operands[1]); #if HOST_BITS_PER_WIDE_INT == 32 if (GET_CODE (operands[2]) == CONST_INT) { @@ -5644,7 +5644,7 @@ } else #endif - operands[8] = gen_highpart (SImode, operands[2]); + operands[8] = gen_highpart_mode (SImode, DImode, operands[2]); }") (define_split @@ -5680,7 +5680,7 @@ } else #endif - operands[8] = gen_highpart (SImode, operands[2]); + operands[8] = gen_highpart_mode (SImode, DImode, operands[2]); }") ;; LTU here means "carry set" @@ -5714,7 +5714,7 @@ (ltu:SI (reg:CC_NOOV 100) (const_int 0)))) (set (match_dup 4) (const_int 0))] "operands[3] = gen_lowpart (SImode, operands[0]); - operands[4] = gen_highpart (SImode, operands[1]);") + operands[4] = gen_highpart_mode (SImode, DImode, operands[1]);") (define_insn "*addx_extend_sp64" [(set (match_operand:DI 0 "register_operand" "=r") @@ -5929,7 +5929,7 @@ { rtx highp, lowp; - highp = gen_highpart (SImode, operands[2]); + highp = gen_highpart_mode (SImode, DImode, operands[2]); lowp = gen_lowpart (SImode, operands[2]); if ((lowp == const0_rtx) && (operands[0] == operands[1])) @@ -5937,7 +5937,8 @@ emit_insn (gen_rtx_SET (VOIDmode, gen_highpart (SImode, operands[0]), gen_rtx_MINUS (SImode, - gen_highpart (SImode, operands[1]), + gen_highpart_mode (SImode, DImode, + operands[1]), highp))); } else @@ -5946,7 +5947,7 @@ gen_lowpart (SImode, operands[1]), lowp)); emit_insn (gen_subx (gen_highpart (SImode, operands[0]), - gen_highpart (SImode, operands[1]), + gen_highpart_mode (SImode, DImode, operands[1]), highp)); } DONE; @@ -6800,7 +6801,7 @@ } else #endif - operands[8] = gen_highpart (SImode, operands[3]); + operands[8] = gen_highpart_mode (SImode, DImode, operands[3]); operands[9] = gen_lowpart (SImode, operands[3]); }") diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 4187468..42137bf 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1146,6 +1146,23 @@ gen_highpart (mode, x) abort (); return result; } + +/* Like gen_highpart_mode, but accept mode of EXP operand in case EXP can + be VOIDmode constant. */ +rtx +gen_highpart_mode (outermode, innermode, exp) + enum machine_mode outermode, innermode; + rtx exp; +{ + if (GET_MODE (exp) != VOIDmode) + { + if (GET_MODE (exp) != innermode) + abort (); + return gen_highpart (outermode, exp); + } + return simplify_gen_subreg (outermode, exp, innermode, + subreg_highpart_offset (outermode, innermode)); +} /* Return offset in bytes to get OUTERMODE low part of the value in mode INNERMODE stored in memory in target format. */ @@ -1190,6 +1190,8 @@ extern rtx gen_lowpart_if_possible PARAMS ((enum machine_mode, rtx)); /* In emit-rtl.c */ extern rtx gen_highpart PARAMS ((enum machine_mode, rtx)); +extern rtx gen_highpart_mode PARAMS ((enum machine_mode, + enum machine_mode, rtx)); extern rtx gen_realpart PARAMS ((enum machine_mode, rtx)); extern rtx gen_imagpart PARAMS ((enum machine_mode, rtx)); extern rtx operand_subword PARAMS ((rtx, unsigned int, int, |