aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2013-02-12 14:55:16 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2013-02-12 14:55:16 +0000
commite68a4ef6eaebf615da649555260e9c12e5ffb9bc (patch)
treee055712e464d68ce4f4fcf5947a000fa7cba7a84 /gcc
parent2597da229a2261de8576099213ffdef4bf946a7c (diff)
downloadgcc-e68a4ef6eaebf615da649555260e9c12e5ffb9bc.zip
gcc-e68a4ef6eaebf615da649555260e9c12e5ffb9bc.tar.gz
gcc-e68a4ef6eaebf615da649555260e9c12e5ffb9bc.tar.bz2
re PR target/54222 ([avr] Implement fixed-point support)
gcc/ PR target/54222 * config/avr/avr-dimode.md (umulsidi3, mulsidi3): New expanders. (umulsidi3_insn, mulsidi3_insn): New insns. libgcc/ PR target/54222 * config/avr/t-avr (LIB2FUNCS_EXCLUDE): Add: _usmulUHA, _usmulUSA, _ssmulHA, _ssmulSA. (LIB1ASMFUNCS): Add: _muldi3_6, _mulsidi3, _umulsidi3, _usmuluha3, _ssmulha3, _usmulusa3, _ssmulsa3. * config/avr/lib1funcs.S (__muldi3_6): Break out of __muldi3. (__muldi3): XCALL __muldi3_6 instead of rcall. (__umulsidi3, __mulsidi3): New functions. (do_prologue_saves, do_epilogue_restores): New .macros. (__divdi3_moddi3): Use them. * config/avr/lib1funcs-fixed.S (__usmuluha3, __ssmulha3) (__usmulusa3, __ssmulsa3): New functions. From-SVN: r195978
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/avr/avr-dimode.md31
2 files changed, 37 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0be8139..e354b93 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-12 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/54222
+ * config/avr/avr-dimode.md (umulsidi3, mulsidi3): New expanders.
+ (umulsidi3_insn, mulsidi3_insn): New insns.
+
2013-02-12 Christophe Lyon <christophe.lyon@linaro.org>
* config/arm/arm-protos.h (struct cpu_vec_costs): New struct type.
diff --git a/gcc/config/avr/avr-dimode.md b/gcc/config/avr/avr-dimode.md
index 71793fd..c96ba6e 100644
--- a/gcc/config/avr/avr-dimode.md
+++ b/gcc/config/avr/avr-dimode.md
@@ -446,3 +446,34 @@
"%~call __<code_stdname>di3"
[(set_attr "adjust_len" "call")
(set_attr "cc" "clobber")])
+
+;; "umulsidi3"
+;; "mulsidi3"
+(define_expand "<extend_u>mulsidi3"
+ [(parallel [(match_operand:DI 0 "register_operand" "")
+ (match_operand:SI 1 "general_operand" "")
+ (match_operand:SI 2 "general_operand" "")
+ ;; Just to mention the iterator
+ (clobber (any_extend:SI (match_dup 1)))])]
+ "avr_have_dimode"
+ {
+ emit_move_insn (gen_rtx_REG (SImode, 22), operands[1]);
+ emit_move_insn (gen_rtx_REG (SImode, 18), operands[2]);
+ emit_insn (gen_<extend_u>mulsidi3_insn());
+ // Use emit_move_insn and not open-coded expand because of missing movdi
+ emit_move_insn (operands[0], gen_rtx_REG (DImode, ACC_A));
+ DONE;
+ })
+
+;; "umulsidi3_insn"
+;; "mulsidi3_insn"
+(define_insn "<extend_u>mulsidi3_insn"
+ [(set (reg:DI ACC_A)
+ (mult:DI (any_extend:DI (reg:SI 18))
+ (any_extend:DI (reg:SI 22))))
+ (clobber (reg:HI REG_X))
+ (clobber (reg:HI REG_Z))]
+ "avr_have_dimode"
+ "%~call __<extend_u>mulsidi3"
+ [(set_attr "adjust_len" "call")
+ (set_attr "cc" "clobber")])