diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-09 19:38:19 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-09 19:38:19 +0000 |
commit | 704fcf2b9d7511389ff2c4ddfeb3ce433893aabd (patch) | |
tree | 007d8955d8f74b1e7c64f0f507a20f7bbffd6a3c | |
parent | c546c45af332e456b660f6d01c8f351422b18d6a (diff) | |
download | gcc-704fcf2b9d7511389ff2c4ddfeb3ce433893aabd.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43869 138bc75d-0d04-0410-961f-82ee72b054a4
-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 807f1096d4d..3dbc4517763 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 61c2b9baf12..5a1cb92861e 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 4187468538d..42137bf776d 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. */ diff --git a/gcc/rtl.h b/gcc/rtl.h index 13edabdd8ac..64d9f202e68 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -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, |