remove picochip
contrib/ChangeLog: 2014-09-08 Trevor Saunders <tsaunders@mozilla.com> * compare-all-tests: Don't test picochip. * config-list.mk: Likewise. gcc/ChangeLog: 2014-09-08 Trevor Saunders <tsaunders@mozilla.com> * common/config/picochip/picochip-common.c: Remove. * config.gcc: Remove support for picochip. * config/picochip/constraints.md: Remove. * config/picochip/dfa_space.md: Remove. * config/picochip/dfa_speed.md: Remove. * config/picochip/picochip-protos.h: Remove. * config/picochip/picochip.c: Remove. * config/picochip/picochip.h: Remove. * config/picochip/picochip.md: Remove. * config/picochip/picochip.opt: Remove. * config/picochip/predicates.md: Remove. * config/picochip/t-picochip: Remove. * doc/md.texi: Don't document picochi. libgcc/ChangeLog: 2014-09-08 Trevor Saunders <tsaunders@mozilla.com> * config.host: Remove picochip support. * config/picochip/adddi3.S: Remove. * config/picochip/ashlsi3.S: Remove. * config/picochip/ashlsi3.c: Remove. * config/picochip/ashrsi3.S: Remove. * config/picochip/ashrsi3.c: Remove. * config/picochip/clzsi2.S: Remove. * config/picochip/cmpsi2.S: Remove. * config/picochip/divmod15.S: Remove. * config/picochip/divmodhi4.S: Remove. * config/picochip/divmodsi4.S: Remove. * config/picochip/lib1funcs.S: Remove. * config/picochip/longjmp.S: Remove. * config/picochip/lshrsi3.S: Remove. * config/picochip/lshrsi3.c: Remove. * config/picochip/parityhi2.S: Remove. * config/picochip/popcounthi2.S: Remove. * config/picochip/setjmp.S: Remove. * config/picochip/subdi3.S: Remove. * config/picochip/t-picochip: Remove. * config/picochip/ucmpsi2.S: Remove. * config/picochip/udivmodhi4.S: Remove. * config/picochip/udivmodsi4.S: Remove. From-SVN: r215039
This commit is contained in:
parent
b9e76e8054
commit
157e859ffe
58 changed files with 67 additions and 12541 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-09-08 Trevor Saunders <tsaunders@mozilla.com>
|
||||
|
||||
* compare-all-tests: Don't test picochip.
|
||||
* config-list.mk: Likewise.
|
||||
|
||||
2014-08-11 Mingjie Xing <mingjie.xing@gmail.com>
|
||||
|
||||
* texi2pod.pl (postprocess): Move command process for '@sc' to the
|
||||
|
|
|
@ -36,7 +36,7 @@ sh64_opts='-m5-32media -m5-32media-nofpu -m5-64media -m5-64media-nofpu -m5-compa
|
|||
sh_opts='-m3 -m3e -m4 -m4a -m4al -m4/-mieee -m1 -m1/-mno-cbranchdi -m2a -m2a/-mieee -m2e -m2e/-mieee'
|
||||
sparc_opts='-mcpu=v8/-m32 -mcpu=v9/-m32 -m64'
|
||||
|
||||
all_targets='alpha arm avr bfin cris fr30 frv h8300 ia64 iq2000 m32c m32r m68k mcore mips mmix mn10300 pa pdp11 picochip ppc score sh sh64 sparc spu v850 vax xstormy16 xtensa' # e500
|
||||
all_targets='alpha arm avr bfin cris fr30 frv h8300 ia64 iq2000 m32c m32r m68k mcore mips mmix mn10300 pa pdp11 ppc score sh sh64 sparc spu v850 vax xstormy16 xtensa' # e500
|
||||
|
||||
test_one_file ()
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ LIST = aarch64-elf aarch64-linux-gnu \
|
|||
msp430-elf \
|
||||
nds32le-elf nds32be-elf \
|
||||
nios2-elf nios2-linux-gnu \
|
||||
pdp11-aout picochip-elfOPT-enable-obsolete \
|
||||
pdp11-aout \
|
||||
powerpc-darwin8 \
|
||||
powerpc-darwin7 powerpc64-darwin powerpc-freebsd6 powerpc-netbsd \
|
||||
powerpc-eabispe powerpc-eabisimaltivec powerpc-eabisim ppc-elf \
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
2014-09-08 Trevor Saunders <tsaunders@mozilla.com>
|
||||
|
||||
* common/config/picochip/picochip-common.c: Remove.
|
||||
* config.gcc: Remove support for picochip.
|
||||
* config/picochip/constraints.md: Remove.
|
||||
* config/picochip/dfa_space.md: Remove.
|
||||
* config/picochip/dfa_speed.md: Remove.
|
||||
* config/picochip/picochip-protos.h: Remove.
|
||||
* config/picochip/picochip.c: Remove.
|
||||
* config/picochip/picochip.h: Remove.
|
||||
* config/picochip/picochip.md: Remove.
|
||||
* config/picochip/picochip.opt: Remove.
|
||||
* config/picochip/predicates.md: Remove.
|
||||
* config/picochip/t-picochip: Remove.
|
||||
* doc/md.texi: Don't document picochi.
|
||||
|
||||
2014-09-08 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* basic-block.h (control_flow_insn_p): Strengthen param from
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
/* Common hooks for picoChip.
|
||||
Copyright (C) 2001-2014 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "common/common-target.h"
|
||||
#include "common/common-target-def.h"
|
||||
|
||||
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
|
||||
static const struct default_options picochip_option_optimization_table[] =
|
||||
{
|
||||
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
|
||||
{ OPT_LEVELS_NONE, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
#undef TARGET_OPTION_OPTIMIZATION_TABLE
|
||||
#define TARGET_OPTION_OPTIMIZATION_TABLE picochip_option_optimization_table
|
||||
|
||||
#undef TARGET_EXCEPT_UNWIND_INFO
|
||||
#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
|
||||
|
||||
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
|
|
@ -236,8 +236,7 @@ md_file=
|
|||
|
||||
# Obsolete configurations.
|
||||
case ${target} in
|
||||
picochip-* \
|
||||
| score-* \
|
||||
score-* \
|
||||
)
|
||||
if test "x$enable_obsolete" != xyes; then
|
||||
echo "*** Configuration ${target} is obsolete." >&2
|
||||
|
@ -420,9 +419,6 @@ nios2-*-*)
|
|||
cpu_type=nios2
|
||||
extra_options="${extra_options} g.opt"
|
||||
;;
|
||||
picochip-*-*)
|
||||
cpu_type=picochip
|
||||
;;
|
||||
powerpc*-*-*)
|
||||
cpu_type=rs6000
|
||||
extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h"
|
||||
|
@ -2154,11 +2150,6 @@ pdp11-*-*)
|
|||
tm_file="${tm_file} newlib-stdint.h"
|
||||
use_gcc_stdint=wrap
|
||||
;;
|
||||
picochip-*)
|
||||
tm_file="${tm_file} newlib-stdint.h"
|
||||
use_gcc_stdint=wrap
|
||||
tmake_file="picochip/t-picochip t-pnt16-warn"
|
||||
;;
|
||||
# port not yet contributed
|
||||
#powerpc-*-openbsd*)
|
||||
# tmake_file="${tmake_file} rs6000/t-fprules"
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
;; GCC machine description for picochip
|
||||
;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
||||
;; Contributed by Picochip Ltd (http://www.picochip.com)
|
||||
;; Maintained by Daniel Towner (dant@picochip.com) and Hariharan
|
||||
;; Sandanagobalane (hariharan@picochip.com)
|
||||
;;
|
||||
;; This file is part of GCC.
|
||||
;;
|
||||
;; GCC is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
;;
|
||||
;; GCC is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with GCC; see the file COPYING3. If not, see
|
||||
;; <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define_constraint "I"
|
||||
"4-bits signed value"
|
||||
(and (match_code "const_int")
|
||||
(match_test " ival >= -8 && ival< 8")))
|
||||
|
||||
(define_constraint "J"
|
||||
"4-bits unsigned value"
|
||||
(and (match_code "const_int")
|
||||
(match_test "ival>=0 && ival < 16")))
|
||||
|
||||
(define_constraint "K"
|
||||
"8-bits signed value"
|
||||
(and (match_code "const_int")
|
||||
(match_test " ival >= -128 && ival < 128")))
|
||||
|
||||
(define_constraint "M"
|
||||
"4-bits magnitude"
|
||||
(and (match_code "const_int")
|
||||
(match_test " abs(ival) < 16")))
|
||||
|
||||
(define_constraint "N"
|
||||
"10-bits signed value"
|
||||
(and (match_code "const_int")
|
||||
(match_test "ival >= -512 && ival < 512")))
|
||||
|
||||
(define_constraint "O"
|
||||
"16-bits signed value"
|
||||
(and (match_code "const_int")
|
||||
(match_test " ival >= -32768 && ival < 32768 ")))
|
||||
|
||||
(define_constraint "a"
|
||||
"See if this is an absolute address in memory"
|
||||
(and (match_code "mem")
|
||||
(match_test "picochip_absolute_memory_operand(op,mode) == 1")))
|
||||
|
||||
(define_register_constraint "k" "FRAME_REGS"
|
||||
"Frame regs")
|
||||
(define_register_constraint "f" "PTR_REGS"
|
||||
"Pointer regs")
|
||||
(define_register_constraint "t" "TWIN_REGS"
|
||||
"Twin regs")
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
;; GCC machine description for picochip
|
||||
;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
||||
;; Contributed by Picochip Ltd (http://www.picochip.com)
|
||||
;; Maintained by Daniel Towner (dant@picochip.com) and Hariharan
|
||||
;; Sandanagobalane (hariharan@picochip.com)
|
||||
;;
|
||||
;; This file is part of GCC.
|
||||
;;
|
||||
;; GCC is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
;;
|
||||
;; GCC is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with GCC; see the file COPYING3. If not, see
|
||||
;; <http://www.gnu.org/licenses/>.
|
||||
|
||||
;; The following DFA description schedules instructions for space. The
|
||||
;; schedule seeks to avoid stall cycles (e.g., memory load), but the
|
||||
;; instructions are not VLIW packed (whenever instructions are packed
|
||||
;; together, an additional byte is used to denote this, which
|
||||
;; increases the code size).
|
||||
|
||||
;; No special handling of the long constants is necessary (as in
|
||||
;; dfa_speed.md), since VLIW packing is not used.
|
||||
|
||||
;; Memory instructions stall for one cycle. All other instructions
|
||||
;; complete ready for the next cycle.
|
||||
|
||||
(define_insn_reservation "nonStallInsn" 1
|
||||
(and (eq_attr "schedType" "space")
|
||||
(eq_attr "type" "!mem"))
|
||||
"slot0+slot1+slot2")
|
||||
|
||||
(define_insn_reservation "stallInsn" 2
|
||||
(and (eq_attr "schedType" "space")
|
||||
(eq_attr "type" "mem"))
|
||||
"slot0+slot1+slot2")
|
|
@ -1,123 +0,0 @@
|
|||
;; GCC machine description for picochip
|
||||
;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
||||
;; Contributed by Picochip Ltd (http://www.picochip.com)
|
||||
;; Maintained by Daniel Towner (dant@picochip.com) and Hariharan
|
||||
;; Sandanagobalane (hariharan@picochip.com).
|
||||
;;
|
||||
;; This file is part of GCC.
|
||||
;;
|
||||
;; GCC is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
;;
|
||||
;; GCC is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with GCC; see the file COPYING3. If not, see
|
||||
;; <http://www.gnu.org/licenses/>.
|
||||
|
||||
;; The following DFA description schedules instructions for speed. In
|
||||
;; addition to the scheduling of instructions to remove stall cycles
|
||||
;; (e.g., memory load), the scheduler will also pack multiple
|
||||
;; instructions into a single cycle, using VLIW.
|
||||
|
||||
;; Each instruction comes in forms with and without long
|
||||
;; constants. The long constant is treated as though it were also an
|
||||
;; instruction. Thus, an instruction which used slot0, will use slot0
|
||||
;; plus one of the other slots for the constant. This mechanism
|
||||
;; ensures that it is impossible for 3 instructions to be issued, if
|
||||
;; one of them has a long constant. This is necessary, because the
|
||||
;; encoding of 3 instructions, plus a constant, will overrun the
|
||||
;; 64-bit limit.
|
||||
|
||||
; Extended ALU - Slot 0
|
||||
(define_insn_reservation "picoAluInsn" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "picoAlu") (eq_attr "longConstant" "false")))
|
||||
"slot0")
|
||||
(define_insn_reservation "picoAluInsnWithConst" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "picoAlu") (eq_attr "longConstant" "true")))
|
||||
"(slot0+slot1)|(slot0+slot2)")
|
||||
|
||||
; Basic ALU - Slot 0 or 1
|
||||
(define_insn_reservation "basicAluInsn" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "basicAlu") (eq_attr "longConstant" "false")))
|
||||
"(slot0|slot1)")
|
||||
(define_insn_reservation "basicAluInsnWithConst" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "basicAlu") (eq_attr "longConstant" "true")))
|
||||
"(slot0+slot1) | (slot1+slot2) | (slot0+slot2)")
|
||||
|
||||
; ALU which must not set flags - Slot 1
|
||||
(define_insn_reservation "nonCcAluInsn" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "nonCcAlu") (eq_attr "longConstant" "false")))
|
||||
"slot1")
|
||||
(define_insn_reservation "nonCcAluInsnWithConst" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "nonCcAlu") (eq_attr "longConstant" "true")))
|
||||
"(slot1+slot0) | (slot1+slot2)")
|
||||
|
||||
; Memory - Slot 1
|
||||
(define_insn_reservation "memInsn" 2
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "mem") (eq_attr "longConstant" "false")))
|
||||
"slot1,nothing")
|
||||
(define_insn_reservation "memInsnWithConst" 2
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "mem") (eq_attr "longConstant" "true")))
|
||||
"slot1+(slot0|slot2),nothing")
|
||||
|
||||
; Multiply - Slot 2
|
||||
(define_insn_reservation "mulInsn" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "mul") (eq_attr "longConstant" "false")))
|
||||
"slot2")
|
||||
(define_insn_reservation "mulInsnWithConst" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "mul") (eq_attr "longConstant" "true")))
|
||||
"(slot2+slot0)|(slot2+slot1)")
|
||||
|
||||
; MAC - Slot 2
|
||||
(define_insn_reservation "macInsn" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "mac") (eq_attr "longConstant" "false")))
|
||||
"slot2")
|
||||
(define_insn_reservation "macInsnWithConst" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "mac") (eq_attr "longConstant" "true")))
|
||||
"(slot2+slot0)|(slot2+slot1)")
|
||||
|
||||
; Branch - Real branches use slot2, while macro branches use unknown
|
||||
; resources.
|
||||
(define_insn_reservation "branchInsn" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "realBranch") (eq_attr "longConstant" "false")))
|
||||
"slot2")
|
||||
(define_insn_reservation "branchInsnWithConst" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(and (eq_attr "type" "realBranch") (eq_attr "longConstant" "true")))
|
||||
"(slot2+slot0)|(slot2+slot1)")
|
||||
(define_insn_reservation "branchInsnMacro" 1
|
||||
(and (eq_attr "schedType" "speed")
|
||||
(eq_attr "type" "realBranch"))
|
||||
"(slot0+slot1+slot2)")
|
||||
|
||||
; Call instructions use all slots to prevent inadvertent scheduling
|
||||
; alongside instructions which set R12.
|
||||
|
||||
(define_insn_reservation "callInsn" 1
|
||||
(and (eq_attr "schedType" "speed") (eq_attr "type" "call"))
|
||||
"slot0+slot1+slot2")
|
||||
|
||||
; Communications - Slot 1
|
||||
(define_insn_reservation "commsInsn" 1
|
||||
(and (eq_attr "schedType" "speed") (eq_attr "type" "comms"))
|
||||
"slot1")
|
||||
|
|
@ -1,129 +0,0 @@
|
|||
/* Prototypes for exported functions defined in picochip.c
|
||||
|
||||
Copyright (C) 2000-2014 Free Software Foundation, Inc.
|
||||
Contributed by Picochip Ltd. (http://www.picochip.com)
|
||||
Maintained by Daniel Towner (daniel.towner@picochip.com) and
|
||||
Hariharan Sandanagobalane (hariharan@picochip.com).
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
extern void picochip_function_prologue (FILE *, HOST_WIDE_INT);
|
||||
extern void picochip_function_epilogue (FILE *, HOST_WIDE_INT);
|
||||
|
||||
extern enum reg_class picochip_reg_class_from_letter (unsigned);
|
||||
extern int picochip_const_ok_for_letter_p (unsigned HOST_WIDE_INT value, unsigned c);
|
||||
|
||||
#ifdef RTX_CODE /* inside TREE_CODE */
|
||||
|
||||
extern int picochip_reg_mode_ok_for_base_p (int mode, rtx x, unsigned strict);
|
||||
extern void picochip_print_operand (FILE * file, rtx op, int letter);
|
||||
extern void picochip_print_operand_address (FILE * file, rtx operand);
|
||||
|
||||
extern const char *picochip_output_cbranch (rtx operands[]);
|
||||
extern const char *picochip_output_branch (rtx operands[], rtx insn);
|
||||
extern const char *picochip_output_compare (rtx operands[]);
|
||||
extern const char *picochip_output_jump (rtx insn);
|
||||
|
||||
extern const char *picochip_output_put_array (int alternative,
|
||||
rtx operands[]);
|
||||
extern const char *picochip_output_get_array (int alternative,
|
||||
rtx operands[]);
|
||||
extern const char *picochip_output_testport_array (int alternative,
|
||||
rtx operands[]);
|
||||
|
||||
extern int picochip_expand_movmemhi (rtx *operands);
|
||||
|
||||
extern rtx gen_SImode_mem(rtx opnd1,rtx opnd2);
|
||||
extern bool ok_to_peephole_stw(rtx opnd0, rtx opnd1, rtx opnd2, rtx opnd3);
|
||||
extern bool ok_to_peephole_ldw(rtx opnd0, rtx opnd1, rtx opnd2, rtx opnd3);
|
||||
|
||||
extern rtx gen_min_reg(rtx opnd1,rtx opnd2);
|
||||
|
||||
extern int picochip_regno_nregs (int regno, enum machine_mode mode);
|
||||
extern int picochip_class_max_nregs (int klass, enum machine_mode mode);
|
||||
|
||||
extern void picochip_order_regs_for_local_alloc (void);
|
||||
|
||||
extern int picochip_word_aligned_memory_reference (rtx operand);
|
||||
extern int picochip_alignable_memory_operand (rtx operand, enum machine_mode mode);
|
||||
extern int picochip_absolute_memory_operand (rtx op, enum machine_mode mode);
|
||||
|
||||
extern rtx picochip_function_value (const_tree valtype, const_tree func, bool outgoing);
|
||||
extern int picochip_symbol_offset (rtx operand);
|
||||
|
||||
extern void picochip_get_hi_aligned_mem (rtx ref, rtx * paligned_mem, rtx * pbitnum);
|
||||
|
||||
extern rtx picochip_get_low_const (rtx value);
|
||||
extern rtx picochip_get_high_const (rtx value);
|
||||
|
||||
extern void picochip_expand_prologue (void);
|
||||
extern void picochip_expand_epilogue (int is_sibling_call);
|
||||
|
||||
extern void picochip_final_prescan_insn (rtx_insn *insn, rtx * operand,
|
||||
int num_operands);
|
||||
extern const char *picochip_asm_output_opcode (FILE * f, const char *ptr);
|
||||
|
||||
extern int picochip_check_conditional_copy (rtx * operands);
|
||||
|
||||
extern rtx picochip_return_addr_rtx(int count, rtx frameaddr);
|
||||
extern rtx picochip_struct_value_rtx(tree fntype ATTRIBUTE_UNUSED,
|
||||
int incoming ATTRIBUTE_UNUSED);
|
||||
|
||||
#endif /* RTX_CODE inside TREE_CODE */
|
||||
|
||||
extern int picochip_legitimize_reload_address (rtx *x, enum machine_mode mode,
|
||||
int opnum, int type, int ind_levels);
|
||||
|
||||
|
||||
void picochip_output_ascii (FILE * file, const char *str, int length);
|
||||
|
||||
extern int picochip_hard_regno_mode_ok (int regno, enum machine_mode mode);
|
||||
extern void picochip_generate_internal_label (char *str, const char *prefix,
|
||||
long num);
|
||||
|
||||
extern bool picochip_return_in_memory(const_tree type,
|
||||
const_tree fntype ATTRIBUTE_UNUSED);
|
||||
|
||||
extern int initial_elimination_offset (int from, int to);
|
||||
|
||||
extern void picochip_output_aligned_common (FILE * stream, const char *name,
|
||||
unsigned size, unsigned align);
|
||||
|
||||
extern void picochip_output_global (FILE * stream, const char *name);
|
||||
|
||||
extern void picochip_output_aligned_local (FILE * stream, const char *name,
|
||||
unsigned size, unsigned alignment);
|
||||
|
||||
extern void picochip_output_label (FILE * stream, const char name[]);
|
||||
extern void picochip_output_labelref (FILE * stream, const char name[]);
|
||||
extern void picochip_weaken_label (FILE * stream, const char name[]);
|
||||
extern void picochip_output_internal_label (FILE * stream, const char *prefix,
|
||||
unsigned long num);
|
||||
|
||||
extern void warn_of_byte_access (void);
|
||||
|
||||
/* True if VLIW scheduling is enabled (i.e., second scheduling pass). */
|
||||
extern int picochip_flag_schedule_insns2;
|
||||
|
||||
extern void picochip_asm_output_anchor (rtx symbol);
|
||||
|
||||
/* Instruction set capability flags. These are initialised to the
|
||||
appropriate values by picochip_option_override, once the user has
|
||||
selected a CPU type. */
|
||||
extern bool picochip_has_mul_unit;
|
||||
extern bool picochip_has_mac_unit;
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,661 +0,0 @@
|
|||
/* Definitions of target machine for GNU compiler for picoChip
|
||||
Copyright (C) 2001-2014 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Picochip Ltd. (http://www.picochip.com)
|
||||
Maintained by Daniel Towner (daniel.towner@picochip.com) and
|
||||
Hariharan Sandanagobalane (hariharan@picochip.com).
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Which type of DFA scheduling to use - schedule for speed (VLIW), or
|
||||
schedule for space. When scheduling for space, attempt to schedule
|
||||
into stall cycles, but don't pack instructions. */
|
||||
|
||||
enum picochip_dfa_type
|
||||
{
|
||||
DFA_TYPE_NONE,
|
||||
DFA_TYPE_SPACE,
|
||||
DFA_TYPE_SPEED
|
||||
};
|
||||
|
||||
extern enum picochip_dfa_type picochip_schedule_type;
|
||||
|
||||
/* Controlling the Compilation Driver */
|
||||
|
||||
/* Pass through the save-temps command option. */
|
||||
#define LINK_SPEC " %{save-temps:--save-temps}"
|
||||
|
||||
/* This is an embedded processor, and only supports a cut-down version of
|
||||
* the standard C library. */
|
||||
#define LIB_SPEC "-lpicoC"
|
||||
|
||||
/* The start file is automatically provided by the linker. */
|
||||
#define STARTFILE_SPEC ""
|
||||
|
||||
/* Run-time Target Specification */
|
||||
|
||||
/* Define some additional pre-processor macros. */
|
||||
#define TARGET_CPU_CPP_BUILTINS() \
|
||||
do \
|
||||
{ \
|
||||
builtin_define ("NO_TRAMPOLINES"); \
|
||||
builtin_define ("PICOCHIP"); \
|
||||
builtin_define ("__PICOCHIP__"); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Translate requests for particular AEs into their respective ISA
|
||||
options. Note that byte access is enabled by default. */
|
||||
#define DRIVER_SELF_SPECS \
|
||||
"%{mae=ANY:-mmul-type=none -mno-byte-access} %<mae=ANY", \
|
||||
"%{mae=ANY2:-mmul-type=none -mno-byte-access} %<mae=ANY2", \
|
||||
"%{mae=ANY3:-mmul-type=none} %<mae=ANY3", \
|
||||
"%{mae=STAN:-mmul-type=none -mno-byte-access} %<mae=STAN", \
|
||||
"%{mae=STAN2:-mmul-type=mac -mno-byte-access} %<mae=STAN2", \
|
||||
"%{mae=STAN3:-mmul-type=mac} %<mae=STAN3", \
|
||||
"%{mae=MAC:-mmul-type=mac -mno-byte-access} %<mae=MAC", \
|
||||
"%{mae=MUL:-mmul-type=mul} %<mae=MUL", \
|
||||
"%{mae=MEM:-mmul-type=mul} %<mae=MEM", \
|
||||
"%{mae=MEM2:-mmul-type=mul} %<mae=MEM2", \
|
||||
"%{mae=CTRL:-mmul-type=mul} %<mae=CTRL", \
|
||||
"%{mae=CTRL2:-mmul-type=mul} %<mae=CTRL2"
|
||||
|
||||
/* Specify the default options, so that the multilib build doesn't
|
||||
need to provide special cases for the defaults. */
|
||||
#define MULTILIB_DEFAULTS \
|
||||
{ "mmul-type=mul", "mbyte-access"}
|
||||
|
||||
#define TARGET_HAS_BYTE_ACCESS (picochip_has_byte_access)
|
||||
#define TARGET_HAS_MUL_UNIT (picochip_has_mul_unit)
|
||||
#define TARGET_HAS_MAC_UNIT (picochip_has_mac_unit)
|
||||
#define TARGET_HAS_MULTIPLY (picochip_has_mac_unit || picochip_has_mul_unit)
|
||||
|
||||
/* Storage Layout */
|
||||
|
||||
/* picoChip processors are 16-bit machines, little endian. */
|
||||
|
||||
#define BITS_BIG_ENDIAN 0
|
||||
#define BYTES_BIG_ENDIAN 0
|
||||
#define WORDS_BIG_ENDIAN 0
|
||||
|
||||
#define BITS_PER_WORD 16
|
||||
#define UNITS_PER_WORD (BITS_PER_WORD / BITS_PER_UNIT)
|
||||
|
||||
#define POINTER_SIZE BITS_PER_WORD
|
||||
|
||||
/* Promote those modes that are smaller than an int, to int mode. */
|
||||
#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
|
||||
((GET_MODE_CLASS (MODE) == MODE_INT \
|
||||
&& GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
|
||||
? (MODE) = HImode : 0)
|
||||
|
||||
/* All parameters are at least this aligned. Parameters are passed
|
||||
one-per-register. */
|
||||
#define PARM_BOUNDARY BITS_PER_WORD
|
||||
|
||||
/* The main stack pointer is guaranteed to be aligned to the most
|
||||
strict data alignment. */
|
||||
#define STACK_BOUNDARY 32
|
||||
|
||||
/* Function entry point is byte aligned. */
|
||||
#define FUNCTION_BOUNDARY 8
|
||||
|
||||
/* This is the biggest alignment that can be allowed on this machine.
|
||||
Since the STANs have only 256 byte memory, it doesn't make sense
|
||||
to have alignments greater than 32 bytes. Hence the value */
|
||||
#define MAX_OFILE_ALIGNMENT 32*8
|
||||
|
||||
/* The strictest data object alignment, which repesents a register pair. */
|
||||
#define BIGGEST_ALIGNMENT 32
|
||||
|
||||
/* The hardware doesn't allow unaligned memory access. */
|
||||
#define STRICT_ALIGNMENT 1
|
||||
|
||||
/* We want the 'unix' style bitfield packing algorithm. */
|
||||
#define PCC_BITFIELD_TYPE_MATTERS 1
|
||||
|
||||
/* Support up to 64-bit integers. */
|
||||
#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
|
||||
|
||||
/* We don't support floating point, but give it a sensible definition. */
|
||||
#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
|
||||
|
||||
/* Layout of Source Language Data Types. */
|
||||
|
||||
#define INT_TYPE_SIZE BITS_PER_WORD
|
||||
|
||||
/* The normal sizes for C scalar data. */
|
||||
#define CHAR_TYPE_SIZE 8
|
||||
#define SHORT_TYPE_SIZE 16
|
||||
#define LONG_TYPE_SIZE 32
|
||||
#define LONG_LONG_TYPE_SIZE 64
|
||||
|
||||
/* We don't support the following data types, but still give them
|
||||
sensible values. */
|
||||
#define FLOAT_TYPE_SIZE 32
|
||||
#define DOUBLE_TYPE_SIZE 32
|
||||
#define LONG_DOUBLE_TYPE_SIZE 32
|
||||
|
||||
/* Plain `char' is a signed type, since the hardware sign-extends
|
||||
bytes when loading them from memory into a register. */
|
||||
#define DEFAULT_SIGNED_CHAR 1
|
||||
|
||||
/* Note that the names of the types used in the following macros must
|
||||
be precisely the same as those defined internally in gcc. For
|
||||
example, `unsigned short' wouldn't work as a type string, since gcc
|
||||
doesn't define any type with this exact string. The correct string
|
||||
to use is `short unsigned int'. */
|
||||
|
||||
#define SIZE_TYPE "unsigned int"
|
||||
|
||||
#define PTRDIFF_TYPE "int"
|
||||
|
||||
#define WCHAR_TYPE "short unsigned int"
|
||||
#define WCHAR_TYPE_SIZE 16
|
||||
|
||||
#define WINT_TYPE "unsigned int"
|
||||
|
||||
/* Register Usage */
|
||||
|
||||
/* Picochip has 16 16-bit registers, a condition code register and an
|
||||
(inaccessible) instruction pointer. One of these registers (r15) is
|
||||
special, and is either used to load a constant anywhere a register
|
||||
can normally be used, or is used to specify a dummy destination
|
||||
(e.g., when setting condition flags). We also define some pseudo
|
||||
registers to represent condition codes, the frame pointer and the
|
||||
argument pointer. The latter two are eliminated wherever possible.
|
||||
|
||||
Pairs of general registers may be combined to form 32-bit registers.
|
||||
|
||||
The picoChip registers are as follows:
|
||||
|
||||
0..1 - function return value
|
||||
0..5 - first 6 function parameters
|
||||
6..11 - General purpose
|
||||
12 - link register
|
||||
13 - stack pointer
|
||||
14 - specialized pointer
|
||||
15 - long constant or /dev/null
|
||||
(16) acc0
|
||||
(17) pseudo condition code
|
||||
(18) pseudo frame pointer
|
||||
(19) pseudo arg pointer
|
||||
|
||||
Registers 0..6, 12, 13, 14, 15 are caller save
|
||||
Registers 0..12, 14 are available to the register allocator.
|
||||
|
||||
In addition, the DSP variant of the ISA allows extra accumulator
|
||||
registers to be accessed. These are special purpose registers,
|
||||
which are not currently used by the compiler.
|
||||
|
||||
*/
|
||||
|
||||
/* Basic Characteristics of Registers */
|
||||
|
||||
/* We have 16 hard registers plus 3 pseudo hard registers and an accumulator. */
|
||||
#define FIRST_PSEUDO_REGISTER 20
|
||||
|
||||
/* The first non-hard register. Only used internally by the picoChip port. */
|
||||
#define FIRST_NONHARD_REGISTER 18
|
||||
|
||||
/* Cannot use SP, CST, CC, FP, AP */
|
||||
#define FIXED_REGISTERS {0,0,0,0,0,0,0,0, 0,0,0,0,0,1,0,1, 1,1,1,1}
|
||||
|
||||
/* Those that are clobbered by a function call (includes pseudo-regs) */
|
||||
#define CALL_USED_REGISTERS {1,1,1,1,1,1,0,0, 0,0,0,0,1,1,0,1, 1,1,1,1}
|
||||
#define CALL_REALLY_USED_REGISTERS {1,1,1,1,1,1,0,0, 0,0,0,0,1,1,0,0, 0,1,0,0}
|
||||
|
||||
/* Define the number of the picoChip link and condition pseudo registers. */
|
||||
#define LINK_REGNUM 12
|
||||
#define CC_REGNUM 17
|
||||
#define ACC_REGNUM 16
|
||||
|
||||
/* Order of Allocation of Registers */
|
||||
|
||||
/* The registers are allocated starting with the caller-clobbered
|
||||
registers, in reverse order. The registers are then listed in an
|
||||
order which means that they are efficiently saved in pairs (i.e.,
|
||||
one 32-bit store can be used instead of two 16-bit stores to save
|
||||
the registers into the stack). The exception to this is the use of
|
||||
r14 (AP) register, which also appears early on. This is because the
|
||||
AP register can be used to encode memory operations more
|
||||
efficiently than other registers. Some code can be made more
|
||||
compact as a result. */
|
||||
/* My current feeling is that r14 should go to the end and maybe even r12.
|
||||
It seems like the overhead of store/load that will occur since we cant
|
||||
pair anything up with r14 will be higher than the advantage of smaller
|
||||
encoding.
|
||||
Also r12 is put towards the end for leaf functions. Since leaf functions
|
||||
do not have any calls, the prologue/epilogue for them wouldnt save up/
|
||||
restore its value. So, it doesn't make sense for us to use it in the middle,
|
||||
if we can avoid it. */
|
||||
#define REG_ALLOC_ORDER {5,4,3,2,1,0,12,6,7,8,9,10,11,14,16,0,0,0,0,0}
|
||||
#define LEAF_REG_ALLOC_ORDER {5,4,3,2,1,0,6,7,8,9,10,11,14,12,16,0,0,0,0,0}
|
||||
|
||||
/* We can dynamically change the REG_ALLOC_ORDER using the following hook.
|
||||
It would be desirable to change it for leaf functions so we can put
|
||||
r12 at the end of this list.*/
|
||||
#define ADJUST_REG_ALLOC_ORDER picochip_order_regs_for_local_alloc ()
|
||||
|
||||
/* How Values Fit in Registers */
|
||||
|
||||
/* Number of consecutive hard regs needed starting at reg REGNO
|
||||
to hold something of mode MODE. */
|
||||
#define HARD_REGNO_NREGS(REGNO, MODE) picochip_regno_nregs((REGNO), (MODE))
|
||||
|
||||
/* Is it ok to place MODE in REGNO? Require that the register number
|
||||
be aligned. */
|
||||
#define HARD_REGNO_MODE_OK(REGNO, MODE) picochip_hard_regno_mode_ok(REGNO, MODE)
|
||||
|
||||
#define MODES_TIEABLE_P(MODE1,MODE2) 1
|
||||
|
||||
/* Don't copy the cc register ('cos you can't put it back). */
|
||||
#define AVOID_CCMODE_COPIES 1
|
||||
|
||||
/* Register Classes */
|
||||
|
||||
enum reg_class
|
||||
{
|
||||
NO_REGS, /* no registers in set */
|
||||
FRAME_REGS, /* registers with a long offset */
|
||||
PTR_REGS, /* registers without an offset */
|
||||
CONST_REGS, /* registers for long constants */
|
||||
NULL_REGS, /* registers which ignore writes */
|
||||
CC_REGS, /* condition code registers */
|
||||
ACC_REGS, /* Accumulator registers */
|
||||
TWIN_REGS, /* registers which can be paired */
|
||||
GR_REGS, /* general purpose registers */
|
||||
ALL_REGS, /* all registers */
|
||||
LIM_REG_CLASSES, /* max value + 1 */
|
||||
|
||||
/* Some aliases */
|
||||
GENERAL_REGS = GR_REGS
|
||||
};
|
||||
|
||||
#define N_REG_CLASSES (int) LIM_REG_CLASSES
|
||||
|
||||
|
||||
/* The names of the register classes */
|
||||
#define REG_CLASS_NAMES \
|
||||
{ \
|
||||
"NO_REGS", \
|
||||
"FRAME_REGS", \
|
||||
"PTR_REGS", \
|
||||
"CONST_REGS", \
|
||||
"NULL_REGS", \
|
||||
"CC_REGS", \
|
||||
"ACC_REGS", \
|
||||
"TWIN_REGS", \
|
||||
"GR_REGS", \
|
||||
"ALL_REGS" \
|
||||
}
|
||||
|
||||
/* Each reg class is an array of 32-bit integers. Each array must be
|
||||
long enough to store one bit for every pseudo register. Thus in the
|
||||
following code, each array only stores one 32-bit value. */
|
||||
#define REG_CLASS_CONTENTS \
|
||||
{ \
|
||||
{0x00000000}, /* no registers */ \
|
||||
{0x00002000}, /* frame */ \
|
||||
{0x00004000}, /* pointer */ \
|
||||
{0x00008000}, /* const */ \
|
||||
{0x00008000}, /* null */ \
|
||||
{0x00020000}, /* cc */ \
|
||||
{0x00010000}, /* acc0 */ \
|
||||
{0x00000FFF}, /* twin */ \
|
||||
{0x000CFFFF}, /* general registers - includes pseudo-arg */ \
|
||||
{0x000FFFFF} /* all registers - includes pseudo-arg */ \
|
||||
}
|
||||
|
||||
/* The earliest register class containing the given register. */
|
||||
extern const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER];
|
||||
#define REGNO_REG_CLASS(REGNO) picochip_regno_reg_class[REGNO]
|
||||
|
||||
/* Any register can be a base pointer. */
|
||||
#define BASE_REG_CLASS GR_REGS
|
||||
|
||||
/* Any register can be an index. */
|
||||
#define INDEX_REG_CLASS GR_REGS
|
||||
|
||||
#define REGNO_OK_FOR_BASE_P(REGNO) \
|
||||
(REGNO_REG_CLASS (REGNO) != CC_REGS && REGNO_REG_CLASS (REGNO) != ACC_REGS)
|
||||
|
||||
#define REGNO_OK_FOR_INDEX_P(REGNO) 0
|
||||
|
||||
#define CLASS_MAX_NREGS(CLASS, MODE) picochip_class_max_nregs(CLASS, MODE)
|
||||
|
||||
|
||||
/* Stack Layout and Calling Conventions */
|
||||
|
||||
#define STACK_GROWS_DOWNWARD 1
|
||||
|
||||
/* The frame pointer points to the outgoing argument area, so the
|
||||
locals are above that. */
|
||||
#define STARTING_FRAME_OFFSET 0
|
||||
|
||||
#define FIRST_PARM_OFFSET(FNDECL) 0
|
||||
|
||||
/* Specify where the return address lives before entry to the
|
||||
prologue. This is required to enable DWARF debug information to be
|
||||
generated. */
|
||||
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, LINK_REGNUM)
|
||||
|
||||
#define RETURN_ADDR_RTX(count,frameaddr) picochip_return_addr_rtx(count,frameaddr)
|
||||
|
||||
#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LINK_REGNUM)
|
||||
|
||||
/* Registers that Address the Stack Frame */
|
||||
|
||||
#define STACK_POINTER_REGNUM 13
|
||||
#define FRAME_POINTER_REGNUM 18
|
||||
#define ARG_POINTER_REGNUM 19
|
||||
|
||||
/* Eliminating Frame Pointer and Arg Pointer. The frame and argument
|
||||
pointers are eliminated wherever possible, by replacing them with
|
||||
offsets from the stack pointer. */
|
||||
|
||||
#define ELIMINABLE_REGS \
|
||||
{{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
|
||||
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
|
||||
|
||||
#define INITIAL_ELIMINATION_OFFSET(FROM,TO,OFFSET) \
|
||||
OFFSET = initial_elimination_offset(FROM, TO);
|
||||
|
||||
#define ACCUMULATE_OUTGOING_ARGS 1
|
||||
|
||||
#define PUSH_ARGS 0
|
||||
|
||||
/* Passing Arguments in Registers */
|
||||
|
||||
/* Store the offset of the next argument. */
|
||||
#define CUMULATIVE_ARGS unsigned
|
||||
|
||||
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED_ARGS) \
|
||||
((CUM) = 0)
|
||||
|
||||
/* The first 6 registers can hold parameters. */
|
||||
#define FUNCTION_ARG_REGNO_P(REGNO) ((REGNO) < 6)
|
||||
|
||||
/* How Scalar Function Values are Returned
|
||||
Do we need this?? */
|
||||
#define FUNCTION_VALUE(VALTYPE,FUNC) picochip_function_value(VALTYPE, FUNC, 0)
|
||||
|
||||
#define LIBCALL_VALUE(MODE) (gen_rtx_REG (MODE, 0))
|
||||
|
||||
/* Results are in register zero. If an SImode register is returned,
|
||||
reg0 will suffice to mean R[0:1]. */
|
||||
#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == 0)
|
||||
|
||||
/* Don't automatically pass struct's in memory - use the
|
||||
* RETURN_IN_MEMORY macro to determine when structs are returned in
|
||||
* memory, and when in registers. */
|
||||
#define DEFAULT_PCC_STRUCT_RETURN 0
|
||||
|
||||
/* Function Entry and Exit */
|
||||
|
||||
/* The epilogue doesn't clobber anything. */
|
||||
#define EPILOGUE_USES(REGNO) 0
|
||||
|
||||
/* Generating Code for Profiling. No profiling implemented */
|
||||
|
||||
#define FUNCTION_PROFILER(FILE,LABELNO)
|
||||
|
||||
/* Trampolines for Nested Functions */
|
||||
|
||||
/* No trampolines. */
|
||||
#define TRAMPOLINE_SIZE 0
|
||||
|
||||
/* Addressing Modes */
|
||||
|
||||
#define MAX_REGS_PER_ADDRESS 1
|
||||
|
||||
/* Legitimize reload address tries machine dependent means of
|
||||
reloading addresses. There seems to be a strange error in gcc,
|
||||
which necessitates this macro. Consider:
|
||||
|
||||
set (reg A) (symbol_ref)
|
||||
set (reg B) (plus (reg A) (const_int))
|
||||
|
||||
A symbol_ref is a valid constant, so the symbol_ref is propagated
|
||||
into the second instruction to generate the instruction:
|
||||
|
||||
set (reg B) (plus (symbol_ref) (const_int))
|
||||
|
||||
This is an invalid address, and find_reloads_address correctly
|
||||
determines this. However, that function doesn't generate a valid
|
||||
replacement for the now invalid address, and the invalid address is
|
||||
output into the assembly language. To fix the problem without
|
||||
changing gcc itself, the following macro tests when such an invalid
|
||||
address has been computed, and wraps it up inside a constant rtx. A
|
||||
constant rtx can be correctly reloaded by the function, and hence
|
||||
correct code is generated. */
|
||||
|
||||
#define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \
|
||||
do { \
|
||||
if (picochip_legitimize_reload_address(&X,MODE,OPNUM,TYPE,IND_LEVELS)) \
|
||||
goto WIN; \
|
||||
} while(0); \
|
||||
|
||||
|
||||
/* Condition Code Status */
|
||||
|
||||
#define CC_STATUS_MDEP unsigned
|
||||
#define CC_STATUS_MDEP_INIT (cc_status.mdep = 0)
|
||||
|
||||
/* Describing Relative Costs of Operations */
|
||||
|
||||
/* Bytes are no faster than words. */
|
||||
#define SLOW_BYTE_ACCESS 1
|
||||
|
||||
/* The assembler is often able to optimise function call branches, so
|
||||
don't try to CSE them in the compiler. This was the thinking before.
|
||||
But now, we realise that the benefits from CSE would mostly outweigh
|
||||
the disadvantages. */
|
||||
#define NO_FUNCTION_CSE
|
||||
|
||||
|
||||
/* Dividing the Output into Sections */
|
||||
|
||||
#define TEXT_SECTION_ASM_OP ".section .text\n"
|
||||
#define DATA_SECTION_ASM_OP ".section .data\n"
|
||||
#define BSS_SECTION_ASM_OP ".section .bss\n"
|
||||
/* picoChip is Harvard (separate data/instruction memories), so
|
||||
read-only data must go into the data section. */
|
||||
#define READONLY_DATA_SECTION_ASM_OP ".section .data\n"
|
||||
|
||||
/* Defining the Output Assembler Language */
|
||||
|
||||
/* The Overall Framework of an Assembler File */
|
||||
|
||||
#define ASM_FILE_COMMENT "// "
|
||||
|
||||
#define ASM_APP_ON "// High-level ASM start\n"
|
||||
#define ASM_APP_OFF "// High-level ASM end\n"
|
||||
|
||||
#undef TARGET_ASM_OUTPUT_IDENT
|
||||
#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
|
||||
|
||||
/* Output of Data */
|
||||
|
||||
#define ASM_OUTPUT_ASCII(FILE, PTR, LEN) picochip_output_ascii(FILE, PTR, LEN);
|
||||
|
||||
/* Output of Uninitialized Variables */
|
||||
#define ASM_OUTPUT_ALIGNED_COMMON(FILE,NAME,SIZE,ALIGN) \
|
||||
picochip_output_aligned_common(FILE, NAME, SIZE, ALIGN)
|
||||
|
||||
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE,NAME,SIZE,ALIGN) \
|
||||
picochip_output_aligned_local(FILE, NAME, SIZE, ALIGN)
|
||||
|
||||
/* Output and Generation of Labels */
|
||||
|
||||
#define ASM_OUTPUT_LABEL(STREAM,NAME) \
|
||||
do { picochip_output_label(STREAM, NAME); } while (0);
|
||||
|
||||
#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
|
||||
{ picochip_output_labelref(STREAM, NAME); }
|
||||
|
||||
/* Format must match that of picochip_output_label. */
|
||||
#define ASM_GENERATE_INTERNAL_LABEL(STRING,PREFIX,NUM) \
|
||||
picochip_generate_internal_label(STRING,PREFIX,(long)NUM)
|
||||
|
||||
#define ASM_WEAKEN_LABEL(STREAM,NAME) picochip_weaken_label(STREAM,NAME);
|
||||
|
||||
/* Store in OUTPUT a string (made with alloca) containing an
|
||||
assembler-name for a local static variable named NAME. LABELNO is
|
||||
an integer which is different for each call. The assembler can't
|
||||
use periods to generate the name, so we use a ___ separator
|
||||
instead. */
|
||||
|
||||
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
|
||||
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 15), \
|
||||
sprintf ((OUTPUT), "%s___%lu", (NAME), (unsigned long)(LABELNO)))
|
||||
|
||||
/* Macros Controlling Initialization Routines */
|
||||
|
||||
/* By defining this, the main function won't try to call `__main'. */
|
||||
#define HAS_INIT_SECTION
|
||||
|
||||
/* Output of Assembler Instructions */
|
||||
|
||||
#define REGISTER_NAMES \
|
||||
{"R0", "R1", "R2", "R3", \
|
||||
"R4", "R5", "R6", "R7", \
|
||||
"R8", "R9", "R10", "R11", \
|
||||
"R12", "FP", "R14", "R15", \
|
||||
"acc0", "pseudoCC", "pseudoFP", "pseudoAP"}
|
||||
|
||||
#define ADDITIONAL_REGISTER_NAMES \
|
||||
{ \
|
||||
{ "R0", 0}, \
|
||||
{ "R1", 1}, \
|
||||
{ "R2", 2}, \
|
||||
{ "R3", 3}, \
|
||||
{ "R4", 4}, \
|
||||
{ "R5", 5}, \
|
||||
{ "R6", 6}, \
|
||||
{ "R7", 7}, \
|
||||
{ "R8", 8}, \
|
||||
{ "R9", 9}, \
|
||||
{ "R10", 10}, \
|
||||
{ "R11", 11}, \
|
||||
{ "R12", 12}, \
|
||||
{ "FP", 13}, \
|
||||
{ "R14", 14}, \
|
||||
{ "R15", 15}, \
|
||||
{ "acc0", 16}, \
|
||||
{ "sp", 12}, /* ABI stack pointer */ \
|
||||
{ "ln", 13}, /* arch link register */ \
|
||||
{ "ptr", 14}, /* arch constant pointer */ \
|
||||
{ "rc", 15}, /* arch constant register */ \
|
||||
{ "rz", 15}, /* arch zero */ \
|
||||
}
|
||||
|
||||
/* Final prescan insn is called just before an instruction is
|
||||
output. In our case, we use this to detect the VLIW slot to which
|
||||
the instruction has been assigned, preparatory to generating the
|
||||
VLIW output in ASM_OUTPUT_OPCODE. */
|
||||
#define FINAL_PRESCAN_INSN(insn, operand, nop) \
|
||||
picochip_final_prescan_insn (insn, operand,nop)
|
||||
|
||||
#define ASM_OUTPUT_OPCODE(FILE,PTR) \
|
||||
{ PTR = picochip_asm_output_opcode(FILE, PTR); }
|
||||
|
||||
#define PRINT_OPERAND(STREAM,X,CODE) \
|
||||
picochip_print_operand(STREAM, X, CODE)
|
||||
|
||||
#define PRINT_OPERAND_PUNCT_VALID_P(code) \
|
||||
(((code) == '|') || ((code) == '#') || ((code) == '>'))
|
||||
|
||||
#define PRINT_OPERAND_ADDRESS(STREAM,X) \
|
||||
picochip_print_operand_address(STREAM,X)
|
||||
|
||||
/* Output of Dispatch Tables */
|
||||
|
||||
/* Initialise a data memory location to an absolute code label. Used
|
||||
for building switch statement jump tables. Note - the format of the
|
||||
label must match that of the function picochip_output_label. */
|
||||
#define ASM_OUTPUT_ADDR_VEC_ELT(stream, value) \
|
||||
fprintf (stream, ".initWord _L%d\n", value);
|
||||
|
||||
/* Assembler Commands for Alignment */
|
||||
|
||||
#define ASM_OUTPUT_SKIP(STREAM,BYTES) \
|
||||
fprintf(STREAM, ".skip "HOST_WIDE_INT_PRINT_UNSIGNED"\n", BYTES);
|
||||
#define ASM_OUTPUT_ALIGN(STREAM,POWER) \
|
||||
fprintf(STREAM, ".align %u\n", 1 << POWER);
|
||||
|
||||
/* The elaborator doesn't output zero bytes in the text section. */
|
||||
#define ASM_NO_SKIP_IN_TEXT 1
|
||||
|
||||
/* Controlling Debugging Information Format */
|
||||
|
||||
/* Macros Affecting All Debugging Formats */
|
||||
|
||||
#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
|
||||
|
||||
#define DWARF2_DEBUGGING_INFO
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
||||
#define DWARF2_FRAME_INFO 1
|
||||
|
||||
/* Generate .file/.loc directives, so that the assembler generates the
|
||||
line table. */
|
||||
#define DWARF2_ASM_LINE_DEBUG_INFO 1
|
||||
|
||||
/* Miscellaneous Parameters */
|
||||
|
||||
#define CASE_VECTOR_MODE HImode
|
||||
#define WORD_REGISTER_OPERATIONS
|
||||
#define LOAD_EXTEND_OP(MODE) ((MODE) == QImode ? SIGN_EXTEND : ZERO_EXTEND)
|
||||
#define MOVE_MAX 4
|
||||
#define SHIFT_COUNT_TRUNCATED 1
|
||||
#define Pmode HImode
|
||||
#define FUNCTION_MODE QImode
|
||||
#define TRULY_NOOP_TRUNCATION(OUTPREC,INPREC) 1
|
||||
|
||||
#define ASM_LONG ":TODO:.word\t"
|
||||
|
||||
/* Define builtins for selected special-purpose instructions. */
|
||||
enum picochip_builtins
|
||||
{
|
||||
PICOCHIP_BUILTIN_SBC,
|
||||
PICOCHIP_BUILTIN_PUT,
|
||||
PICOCHIP_BUILTIN_GET,
|
||||
PICOCHIP_BUILTIN_TESTPORT,
|
||||
PICOCHIP_BUILTIN_COPYSW,
|
||||
PICOCHIP_BUILTIN_ADDS,
|
||||
PICOCHIP_BUILTIN_SUBS,
|
||||
PICOCHIP_BUILTIN_BREV,
|
||||
PICOCHIP_BUILTIN_BYTESWAP,
|
||||
PICOCHIP_BUILTIN_GET_ARRAY,
|
||||
PICOCHIP_BUILTIN_PUT_ARRAY,
|
||||
PICOCHIP_BUILTIN_TESTPORT_ARRAY,
|
||||
PICOCHIP_BUILTIN_ASRI,
|
||||
PICOCHIP_BUILTIN_HALT
|
||||
};
|
||||
|
||||
#define NO_DOLLAR_IN_LABEL 1
|
||||
#define NO_DOT_IN_LABEL 1
|
||||
|
||||
/* The assembler does support LEB128, despite the auto-configure test
|
||||
not detecting this. */
|
||||
#define HAVE_AS_LEB128 1
|
||||
|
||||
/* picochip-unknown-none target has no support of C99 runtime */
|
||||
#undef TARGET_LIBC_HAS_FUNCTION
|
||||
#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
|
||||
|
||||
/* The End */
|
File diff suppressed because it is too large
Load diff
|
@ -1,46 +0,0 @@
|
|||
; Options for the picoChip port of the compiler.
|
||||
|
||||
; Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
||||
;
|
||||
; This file is part of GCC.
|
||||
;
|
||||
; GCC is free software; you can redistribute it and/or modify it under
|
||||
; the terms of the GNU General Public License as published by the Free
|
||||
; Software Foundation; either version 3, or (at your option) any later
|
||||
; version.
|
||||
;
|
||||
; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
; WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
; for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with GCC; see the file COPYING3. If not, see
|
||||
; <http://www.gnu.org/licenses/>.
|
||||
|
||||
mae=
|
||||
Target RejectNegative Joined Var(picochip_ae_type_string)
|
||||
Specify which type of AE to target. This option sets the mul-type and byte-access.
|
||||
|
||||
mmul-type=
|
||||
Target RejectNegative Undocumented Joined Var(picochip_mul_type_string)
|
||||
Specify which type of multiplication to use. Can be mem, mac or none.
|
||||
|
||||
mbyte-access
|
||||
Target Undocumented Var(picochip_has_byte_access,1) Init(1)
|
||||
Specify whether the byte access instructions should be used. Enabled by default.
|
||||
|
||||
mdebug
|
||||
Target RejectNegative Undocumented Mask(DEBUG)
|
||||
Enable debug output to be generated.
|
||||
|
||||
msymbol-as-address
|
||||
Target Mask(SYMBOL_AS_ADDRESS)
|
||||
Allow a symbol value to be used as an immediate value in an instruction.
|
||||
|
||||
minefficient-warnings
|
||||
Target Mask(INEFFICIENT_WARNINGS)
|
||||
Generate warnings when inefficient code is known to be generated.
|
||||
|
||||
minefficient
|
||||
Target Mask(INEFFICIENT_WARNINGS) Undocumented
|
|
@ -1,72 +0,0 @@
|
|||
;; GCC machine description for picochip
|
||||
;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
||||
;; Contributed by Picochip Ltd (http://www.picochip.com)
|
||||
;; Maintained by Daniel Towner (dant@picochip.com) and Hariharan
|
||||
;; Sandanagobalane (hariharan@picochip.com)
|
||||
;;
|
||||
;; This file is part of GCC.
|
||||
;;
|
||||
;; GCC is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
;;
|
||||
;; GCC is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with GCC; see the file COPYING3. If not, see
|
||||
;; <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define_predicate "picochip_register_or_immediate_operand"
|
||||
(ior (match_operand 0 "register_operand")
|
||||
(match_operand 0 "immediate_operand")))
|
||||
|
||||
(define_predicate "power_of_2_imm_operand"
|
||||
(match_code "const_int")
|
||||
{
|
||||
if (GET_CODE (op) == CONST_INT)
|
||||
{
|
||||
if (exact_log2 (INTVAL (op)) <= 16 && exact_log2 (INTVAL (op)) > 0)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
})
|
||||
|
||||
;; Limit the comparison operators to a selected subset.
|
||||
(define_predicate "picochip_supported_comparison_operator"
|
||||
(and (match_operand 0 "comparison_operator")
|
||||
(match_code "ne,eq,ge,geu,lt,ltu")))
|
||||
(define_predicate "picochip_peephole_comparison_operator"
|
||||
(and (match_operand 0 "comparison_operator")
|
||||
(match_code "ne,eq")))
|
||||
|
||||
;; Allow selected arithmetic operators to apply a shift to their first
|
||||
;; operands
|
||||
|
||||
(define_predicate "picochip_first_op_shift_operator"
|
||||
(match_code "and,plus,minus,ior,xor"))
|
||||
|
||||
;; The same as the previous predicate, but only allowing those
|
||||
;; operators which can accept an immediate.
|
||||
(define_predicate "picochip_first_op_shift_operator_imm"
|
||||
(match_code "plus,minus"))
|
||||
|
||||
;; Predicate on a J type integer.
|
||||
(define_predicate "picochip_J_operand"
|
||||
(match_operand 0 "immediate_operand")
|
||||
{
|
||||
return (CONST_INT == GET_CODE(op) &&
|
||||
picochip_const_ok_for_letter_p (INTVAL(op), 'J'));
|
||||
})
|
||||
|
||||
;; Is the operand suitable for use in a compare?
|
||||
|
||||
(define_predicate "picochip_comparison_operand"
|
||||
(ior (match_operand 0 "register_operand")
|
||||
(and (match_operand 0 "immediate_operand")
|
||||
(match_test "picochip_const_ok_for_letter_p(INTVAL(op), 'O')"))))
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GCC.
|
||||
#
|
||||
# GCC is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GCC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GCC; see the file COPYING3. If not see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Build all combinations of library for different multiply units, and
|
||||
# presence/absence of byte access.
|
||||
MULTILIB_OPTIONS = mmul-type=none/mmul-type=mac/mmul-type=mul mno-byte-access/mbyte-access
|
||||
|
||||
# Using a mul unit (currently) implies that byte access is available.
|
||||
MULTILIB_EXCEPTIONS = mmul-type=mul/mno-byte-access
|
|
@ -2066,46 +2066,6 @@ A memory operand for floating-point loads and stores
|
|||
A register indirect memory operand
|
||||
@end table
|
||||
|
||||
@item picoChip family---@file{picochip.h}
|
||||
@table @code
|
||||
@item k
|
||||
Stack register.
|
||||
|
||||
@item f
|
||||
Pointer register. A register which can be used to access memory without
|
||||
supplying an offset. Any other register can be used to access memory,
|
||||
but will need a constant offset. In the case of the offset being zero,
|
||||
it is more efficient to use a pointer register, since this reduces code
|
||||
size.
|
||||
|
||||
@item t
|
||||
A twin register. A register which may be paired with an adjacent
|
||||
register to create a 32-bit register.
|
||||
|
||||
@item a
|
||||
Any absolute memory address (e.g., symbolic constant, symbolic
|
||||
constant + offset).
|
||||
|
||||
@item I
|
||||
4-bit signed integer.
|
||||
|
||||
@item J
|
||||
4-bit unsigned integer.
|
||||
|
||||
@item K
|
||||
8-bit signed integer.
|
||||
|
||||
@item M
|
||||
Any constant whose absolute value is no greater than 4-bits.
|
||||
|
||||
@item N
|
||||
10-bit signed integer
|
||||
|
||||
@item O
|
||||
16-bit signed integer.
|
||||
|
||||
@end table
|
||||
|
||||
@item PowerPC and IBM RS6000---@file{config/rs6000/constraints.md}
|
||||
@table @code
|
||||
@item b
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-skip-if "too complex for avr and picochip" { picochip-*-* avr-*-* } { "*" } { "" } } */
|
||||
/* { dg-skip-if "too complex for avr" { avr-*-* } { "*" } { "" } } */
|
||||
/* { dg-timeout-factor 4.0 } */
|
||||
#define LIM1(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9,
|
||||
#define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-skip-if "Array too big" { avr-*-* picochip-*-* m32c-*-* pdp11-*-* msp430-*-* } { "*" } { "" } } */
|
||||
/* { dg-skip-if "Array too big" { avr-*-* m32c-*-* pdp11-*-* msp430-*-* } { "*" } { "" } } */
|
||||
|
||||
#define STR2 "012345678901234567890123456789012345678901234567890123456789\
|
||||
0123456789012345678901234567890123456789"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
|
||||
/* { dg-do compile } */
|
||||
/* The MMIX port always switches to the .data section at the end of a file. */
|
||||
/* { dg-final { scan-assembler-not "\\.data(?!\\.rel\\.ro)" { xfail powerpc*-*-aix* mmix-*-* x86_64-*-mingw* picochip--*-* } } } */
|
||||
/* { dg-final { scan-assembler-not "\\.data(?!\\.rel\\.ro)" { xfail powerpc*-*-aix* mmix-*-* x86_64-*-mingw* } } } */
|
||||
static const int a[2] = { 1, 2 };
|
||||
const int a1[2] = { 1, 2 };
|
||||
typedef const int ci;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Setting LOGICAL_OP_NON_SHORT_CIRCUIT to 0 leads to two conditional jumps
|
||||
when evaluating an && condition. VRP is not able to optimize this. */
|
||||
/* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* } } } } } */
|
||||
/* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* } } } } } */
|
||||
/* { dg-options "-O2 -fdump-tree-forwprop1" } */
|
||||
|
||||
extern char *frob (void);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-*"} } } */
|
||||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-*"} } } */
|
||||
|
||||
/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*"} } } */
|
||||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*"} } } */
|
||||
|
||||
/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*"} } } */
|
||||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*"} } } */
|
||||
|
||||
/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*"} } } */
|
||||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*"} } } */
|
||||
|
||||
/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*"} } } */
|
||||
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*"} } } */
|
||||
|
||||
/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
|
||||
/* { dg-options "-O2 -g -fdump-tree-optimized" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
|
||||
/* { dg-options "-O2 -g -fdump-tree-optimized" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
|
||||
/* { dg-options "-O2 -g -fdump-tree-optimized" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
|
||||
/* { dg-options "-O2 -g -fdump-tree-optimized" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
|
||||
/* { dg-options "-O2 -g -fdump-tree-optimized" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
|
||||
|
||||
/* { dg-options "-O2 -g -fdump-tree-optimized" } */
|
||||
/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Setting LOGICAL_OP_NON_SHORT_CIRCUIT to 0 leads to two conditional jumps
|
||||
when evaluating an && condition. VRP is not able to optimize this. */
|
||||
/* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* } } } } } */
|
||||
/* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* } } } } } */
|
||||
|
||||
/* { dg-options "-O2 -fdump-tree-vrp2-details -fdump-tree-cddce2-details" } */
|
||||
|
||||
|
|
|
@ -532,7 +532,6 @@ proc check_profiling_available { test_what } {
|
|||
|| [istarget msp430-*-*]
|
||||
|| [istarget nds32*-*-elf]
|
||||
|| [istarget nios2-*-elf]
|
||||
|| [istarget picochip-*-*]
|
||||
|| [istarget powerpc-*-eabi*]
|
||||
|| [istarget powerpc-*-elf]
|
||||
|| [istarget rx-*-*]
|
||||
|
@ -554,11 +553,7 @@ proc check_profiling_available { test_what } {
|
|||
# in Section 4 of C99 standard. Effectively, it is a target which supports no
|
||||
# extra headers or libraries other than what is considered essential.
|
||||
proc check_effective_target_freestanding { } {
|
||||
if { [istarget picochip-*-*] } then {
|
||||
return 1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
# Return 1 if target has packed layout of structure members by
|
||||
|
|
|
@ -1,3 +1,29 @@
|
|||
2014-09-08 Trevor Saunders <tsaunders@mozilla.com>
|
||||
|
||||
* config.host: Remove picochip support.
|
||||
* config/picochip/adddi3.S: Remove.
|
||||
* config/picochip/ashlsi3.S: Remove.
|
||||
* config/picochip/ashlsi3.c: Remove.
|
||||
* config/picochip/ashrsi3.S: Remove.
|
||||
* config/picochip/ashrsi3.c: Remove.
|
||||
* config/picochip/clzsi2.S: Remove.
|
||||
* config/picochip/cmpsi2.S: Remove.
|
||||
* config/picochip/divmod15.S: Remove.
|
||||
* config/picochip/divmodhi4.S: Remove.
|
||||
* config/picochip/divmodsi4.S: Remove.
|
||||
* config/picochip/lib1funcs.S: Remove.
|
||||
* config/picochip/longjmp.S: Remove.
|
||||
* config/picochip/lshrsi3.S: Remove.
|
||||
* config/picochip/lshrsi3.c: Remove.
|
||||
* config/picochip/parityhi2.S: Remove.
|
||||
* config/picochip/popcounthi2.S: Remove.
|
||||
* config/picochip/setjmp.S: Remove.
|
||||
* config/picochip/subdi3.S: Remove.
|
||||
* config/picochip/t-picochip: Remove.
|
||||
* config/picochip/ucmpsi2.S: Remove.
|
||||
* config/picochip/udivmodhi4.S: Remove.
|
||||
* config/picochip/udivmodsi4.S: Remove.
|
||||
|
||||
2014-09-08 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* libgcc2.c (SF_SIZE): Change all uses to __LIBGCC_SF_MANT_DIG__.
|
||||
|
|
|
@ -928,9 +928,6 @@ nios2-*-*)
|
|||
pdp11-*-*)
|
||||
tmake_file="pdp11/t-pdp11 t-fdpbit"
|
||||
;;
|
||||
picochip-*-*)
|
||||
tmake_file="picochip/t-picochip t-fpbit"
|
||||
;;
|
||||
powerpc-*-darwin*)
|
||||
case ${host} in
|
||||
*-*-darwin9* | *-*-darwin[12][0-9]*)
|
||||
|
|
|
@ -1,194 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 64-bit addition.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Hariharan Sandanagobalane (hariharan@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.align 8
|
||||
.global __adddi3
|
||||
__adddi3:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &__adddi3 = 12 bytes
|
||||
|
||||
// The first operand of add is completely in registers r[2-5]
|
||||
// The second operand of sub is in stack FP(0-3)
|
||||
// and result need to be written pointed to by the register r0.
|
||||
// All we need to do is to load the appropriate values, add them
|
||||
// appropriately (with add or addc ) and then store the values back.
|
||||
|
||||
ldw (FP)0, r1
|
||||
stl r[7:6], (FP)-1
|
||||
add.0 r2, r1, r6
|
||||
ldw (FP)1, r1
|
||||
addc.0 r3, r1, r7
|
||||
ldl (FP)1, r[3:2]
|
||||
stl r[7:6], (r0)0
|
||||
addc.0 r4, r2, r6
|
||||
addc.0 r5, r3, r7
|
||||
stl r[7:6], (r0)1
|
||||
jr (r12)
|
||||
=-> ldl (FP)-1, r[7:6]
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
|
||||
// picoChip Function Epilogue : __adddi3
|
||||
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0xe // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#61# 16#64# 16#64# 16#63# 16#69# 16#33# 16#0# // Function name `_adddi3'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
|
@ -1,193 +0,0 @@
|
|||
// picoChip ASM file
|
||||
// picoChip ASM file
|
||||
//
|
||||
// Support for 32-bit arithmetic shift left.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Hariharan Sandanagobalane (hariharan@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.global ___ashlsi3
|
||||
___ashlsi3:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
// picoChip Function Prologue : &___ashlsi3 = 0 bytes
|
||||
|
||||
// if (R2 > 15) goto _L2
|
||||
SUB.0 15,R2,r15
|
||||
JMPLT _L2
|
||||
=-> SUB.0 16,R2,R5 // R5 := R5 - R4 (HI)
|
||||
|
||||
LSL.0 R1,R2,R1 // R3 := R1 << R2
|
||||
LSL.0 R0,R2,R4 // R2 := R0 << R2
|
||||
|
||||
LSR.0 R0,R5,R5 // R5 := R12 >> R5 NEED TO CHECK - HARI
|
||||
OR.0 R5,R1,R5 // R3 := R5 IOR R0 (HI)
|
||||
SUB.0 R2,0,r15
|
||||
COPYNE R5,R1
|
||||
JR (R12) // Return to caller
|
||||
=-> COPY.0 R4,R0
|
||||
|
||||
_L2:
|
||||
LSL.0 R0,R2,R1 // R3 := R0 << R2
|
||||
JR (R12) // Return to caller
|
||||
=-> COPY.0 0,R0 // R2 := 0 (short constant)
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
|
||||
// picoChip Function Epilogue : __ashlsi3
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#61# 16#73# 16#68# 16#6c# 16#73# 16#69# 16#33# 16#0# // Function name `_ashlsi3'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
|
||||
picoChip GCC support for 32-bit shift left.
|
||||
|
||||
Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
Contributed by Picochip Ltd.
|
||||
Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef PICOCHIP
|
||||
#error "Intended for compilation for PICOCHIP only."
|
||||
#endif
|
||||
|
||||
typedef int HItype __attribute__ ((mode (HI)));
|
||||
typedef unsigned int UHItype __attribute__ ((mode (HI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
|
||||
typedef struct USIstruct {
|
||||
UHItype low, high;
|
||||
} USIstruct;
|
||||
|
||||
typedef union USIunion {
|
||||
USItype l;
|
||||
USIstruct s;
|
||||
} USIunion;
|
||||
|
||||
USItype __ashlsi3(USIunion value, HItype count) {
|
||||
USIunion result;
|
||||
int temp;
|
||||
|
||||
/* Ignore a zero count until we get into the (count < 16)
|
||||
clause. This is slightly slower when shifting by zero, but faster
|
||||
and smaller in all other cases (due to the better scheduling
|
||||
opportunities available by putting the test near computational
|
||||
instructions. */
|
||||
/* if (count == 0) return value.l; */
|
||||
|
||||
if (count < 16) {
|
||||
/* Shift low and high words by the count. */
|
||||
result.s.low = value.s.low << count;
|
||||
result.s.high = value.s.high << count;
|
||||
|
||||
/* There is now a hole in the lower `count' bits of the high
|
||||
word. Shift the upper `count' bits of the low word into the
|
||||
high word. This is only required when the count is non-zero. */
|
||||
if (count != 0) {
|
||||
temp = 16 - count;
|
||||
temp = value.s.low >> temp;
|
||||
result.s.high |= temp;
|
||||
}
|
||||
|
||||
} else {
|
||||
/* Shift the lower word of the source into the upper word of the
|
||||
result, and zero the result's lower word. */
|
||||
count -= 16;
|
||||
result.s.high = value.s.low << count;
|
||||
result.s.low = 0;
|
||||
|
||||
}
|
||||
|
||||
return result.l;
|
||||
|
||||
}
|
||||
|
|
@ -1,202 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 32-bit arithmetic shift right.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Hariharan Sandanagobalane (hariharan@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.global ___ashrsi3
|
||||
___ashrsi3:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &___ashrsi3 = 0 bytes
|
||||
|
||||
// if (R2 > 15) goto _L2
|
||||
SUB.0 15,R2,r15
|
||||
JMPLT _L2
|
||||
=-> COPY.0 R1,R3
|
||||
|
||||
LSR.0 R1,R2,R1 // R1 := R1 >> R2
|
||||
// if (R2 == 0) goto _L4
|
||||
SUB.0 R2,0,r15
|
||||
JMPEQ _L4
|
||||
=-> LSR.0 R0,R2,R0 // R2 := R0 >> R2
|
||||
|
||||
SUB.0 16,R2,R4 // R4 := R4 - R2 (HI)
|
||||
ASR.0 R3,15,R5 // R5 = R1 >>{arith} 15
|
||||
LSL.0 R5,R4,R5 // R5 := R5 << R4
|
||||
LSL.0 R3,R4,R4 // R4 := R1 << R4
|
||||
OR.0 R5,R1,R1 // R3 := R5 IOR R3 (HI)
|
||||
BRA _L4
|
||||
=-> OR.0 R4,R0,R0 // R2 := R4 IOR R0 (HI)
|
||||
_L2:
|
||||
ASR.0 R1,15,R1 // R4 = R1 >>{arith} 15
|
||||
SUB.0 16,R2,R5 // R5 := R5 - R2 (HI)
|
||||
LSR.0 R3,R2,R0 // R2 := R1 >> R2
|
||||
LSL.0 R1,R5,R5 // R5 := R4 << R5
|
||||
OR.0 R5,R0,R5 // R2 := R5 IOR R2 (HI)
|
||||
SUB.0 R2,16,r15 // R5 := R5 - R2 (HI)
|
||||
COPYNE R5,R0
|
||||
_L4:
|
||||
JR (R12) // Return to caller
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
|
||||
// picoChip Function Epilogue : __ashrsi3
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#61# 16#73# 16#68# 16#72# 16#73# 16#69# 16#33# 16#0# // Function name `_ashrsi3'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,113 +0,0 @@
|
|||
/*
|
||||
|
||||
picoChip GCC support for 32-bit arithmetic shift right.
|
||||
|
||||
Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
Contributed by Picochip Ltd.
|
||||
Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
typedef int HItype __attribute__ ((mode (HI)));
|
||||
typedef unsigned int UHItype __attribute__ ((mode (HI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
|
||||
typedef struct USIstruct {
|
||||
UHItype low, high;
|
||||
} USIstruct;
|
||||
|
||||
typedef union USIunion {
|
||||
USItype l;
|
||||
USIstruct s;
|
||||
} USIunion;
|
||||
|
||||
USItype __ashrsi3(USIunion value, HItype count) {
|
||||
USIunion result;
|
||||
int temp;
|
||||
int wordOfSignBits;
|
||||
|
||||
/* Ignore a zero count until we get into the (count < 16)
|
||||
clause. This is slightly slower when shifting by zero, but faster
|
||||
and smaller in all other cases (due to the better scheduling
|
||||
opportunities available by putting the test near computational
|
||||
instructions. */
|
||||
/* if (count == 0) return value.l; */
|
||||
|
||||
if (count < 16) {
|
||||
/* Shift low and high words by the count. The high word must use
|
||||
an arithmetic shift. There is no arithmetic shift-right by
|
||||
variable, so synthesise it. */
|
||||
int signWord;
|
||||
int reverseCount;
|
||||
|
||||
/* Shift low and high parts by the count. The upper word now has
|
||||
invalid signed bits. */
|
||||
result.s.low = value.s.low >> count;
|
||||
result.s.high = value.s.high >> count;
|
||||
|
||||
if (count != 0) {
|
||||
|
||||
reverseCount = 16 - count;
|
||||
|
||||
/* Given a word of sign bits, shift back left to create the
|
||||
destination sign bits. */
|
||||
wordOfSignBits = __builtin_asri(value.s.high, 15);
|
||||
signWord = wordOfSignBits << reverseCount;
|
||||
result.s.high |= signWord;
|
||||
|
||||
/* There is now a hole in the upper `count' bits of the low
|
||||
word. Shift the lower `count' bits of the upper word into the
|
||||
low word. */
|
||||
temp = value.s.high << reverseCount;
|
||||
result.s.low |= temp;
|
||||
}
|
||||
|
||||
} else {
|
||||
int signWord;
|
||||
|
||||
/* Shift is greater than one word, so top word will always be set
|
||||
to sign bits, and bottom word will be shifted from top word. */
|
||||
result.s.low = value.s.high >> count;
|
||||
result.s.high = __builtin_asri(value.s.high, 15);
|
||||
|
||||
if (count != 16) {
|
||||
|
||||
/* Shift the upper word of the source into the lower word of the
|
||||
result. Arithmetically shift the upper word as well, to retain
|
||||
the sign. This shift must be synthesised, as no such shift
|
||||
exists in the instruction set. */
|
||||
int signWord;
|
||||
|
||||
|
||||
/* Given a complete word of sign-bits, shift this back left to
|
||||
create the destination sign bits. */
|
||||
signWord = result.s.high << (16 - count);
|
||||
// signWord = wordOfSignBits << (16 - count);
|
||||
|
||||
/* Insert the sign bits to the result's low word. */
|
||||
result.s.low |= signWord;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result.l;
|
||||
|
||||
}
|
|
@ -1,189 +0,0 @@
|
|||
// Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of GCC.
|
||||
//
|
||||
// GCC is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
// Software Foundation; either version 3, or (at your option) any later
|
||||
// version.
|
||||
//
|
||||
// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
// for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// picoChip ASM file
|
||||
//.file "clzsi2.S"
|
||||
|
||||
.section .text
|
||||
|
||||
.global __clzsi2
|
||||
__clzsi2:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &__clzsi2 = 0 bytes
|
||||
|
||||
// What value should be operated on? If the top word is empty
|
||||
// then count the bits in the bottom word, and add 16. If the
|
||||
// top word is not empty, then count the bits in the top word.
|
||||
|
||||
// R4 stores the constant 0
|
||||
|
||||
sub.0 R1,0,r15 \ copy.1 16,r2
|
||||
copyeq r0,r1
|
||||
copyne 0,r2
|
||||
|
||||
// R1 now stores value to count, and R2 stores current bit offset.
|
||||
sbc r1,r0
|
||||
asr.0 r1,15,r15 \ add.1 r0,1,r0
|
||||
jr (lr) \ copyne 0,r0
|
||||
=-> add.0 r0,r2,r0
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
|
||||
// picoChip Function Epilogue : __clzsi2
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5F# 16#63# 16#6C# 16#7A# 16#73# 16#69# 16#32# 16#0# // Function name `_clzsi2'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,212 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//.file "ucmpsi2.c"
|
||||
//
|
||||
// Support for 32-bit signed compare.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Compiled from the following, and then hand optimised.
|
||||
//
|
||||
// int __cmpsi2 (USItype x, USItype y)
|
||||
// {
|
||||
//
|
||||
// SIunion lx; lx.l = x;
|
||||
// SIunion ly; ly.l = y;
|
||||
//
|
||||
// if (lx.s.high < ly.s.high)
|
||||
// return 0;
|
||||
// else if (lx.s.high > ly.s.high)
|
||||
// return 2;
|
||||
// if (lx.s.low < ly.s.low)
|
||||
// return 0;
|
||||
// else if (lx.s.low > ly.s.low)
|
||||
// return 2;
|
||||
// return 1;
|
||||
// }
|
||||
|
||||
.section .text
|
||||
|
||||
.align 8
|
||||
.global ___cmpsi2
|
||||
___cmpsi2:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &___cmpsi2 = 0 bytes
|
||||
|
||||
SUB.0 R1,R3,r15
|
||||
|
||||
BLT _L1
|
||||
=-> SUB.0 R3,R1,r15 \ COPY.1 0,R5
|
||||
|
||||
BLT _L1
|
||||
=-> SUB.0 R0,R2,r15 \ COPY.1 2,R5
|
||||
|
||||
BLO _L1
|
||||
=-> SUB.0 R2,R0,r15 \ COPY.1 0,R5
|
||||
|
||||
BLO _L1
|
||||
=-> COPY.0 2,R5
|
||||
|
||||
COPY.0 1,R5
|
||||
_L1:
|
||||
JR (R12)
|
||||
=-> COPY.0 R5,R0
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : __cmpsi2
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#5f# 16#63# 16#6d# 16#70# 16#73# 16#69# 16#32# 16#0# // Function name `__cmpsi2'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,261 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 16-bit unsigned division/modulus.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.global __divmod15
|
||||
__divmod15:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &__divmod15 = 0 bytes
|
||||
|
||||
// The picoChip instruction set has a divstep instruction which
|
||||
// is used to perform one iteration of a binary division algorithm.
|
||||
// The instruction allows 16-bit signed division to be implemented.
|
||||
// It does not directly allow 16-bit unsigned division to be
|
||||
// implemented. Thus, this function pulls out the common division
|
||||
// iteration for 15-bits unsigned, and then special wrappers
|
||||
// provide the logic to change this into a 16-bit signed or
|
||||
// unsigned division, as appropriate. This allows the two
|
||||
// versions of division to share a common implementation, reducing
|
||||
// code size when the two are used together. It also reduces
|
||||
// the maintenance overhead.
|
||||
|
||||
// Input:
|
||||
// r0 - dividend
|
||||
// r1 - divisor
|
||||
// Output:
|
||||
// r0 - quotient
|
||||
// r1 - remainder
|
||||
// R5 is unused
|
||||
|
||||
// Check for special cases. The emphasis is on detecting these as
|
||||
// quickly as possible, so that the main division can be started. If
|
||||
// the user requests division by one, division by self, and so on
|
||||
// then they will just have to accept that this won't be particularly
|
||||
// quick (relatively), whereas a real division (e.g., dividing a
|
||||
// large value by a small value) will run as fast as possible
|
||||
// (i.e., special case detection should not slow down the common case)
|
||||
//
|
||||
// Special cases to consider:
|
||||
//
|
||||
// Division by zero.
|
||||
// Division of zero.
|
||||
// Inputs are equal
|
||||
// Divisor is bigger than dividend
|
||||
// Division by power of two (can be shifted instead).
|
||||
// Division by 1 (special case of power of two division)
|
||||
//
|
||||
// Division/modulus by zero is undefined (ISO C:6.5.5), so
|
||||
// don't bother handling this special case.
|
||||
//
|
||||
// The special cases of division by a power of 2 are ignored, since
|
||||
// they cause the general case to slow down. Omitting these
|
||||
// special cases also reduces code size considerably.
|
||||
|
||||
// Handle divisor >= dividend separately. Note that this also handles
|
||||
// the case where the dividend is zero. Note that the flags must be
|
||||
// preserved, since they are also used at the branch destination.
|
||||
sub.0 r1,r0,r15
|
||||
sbc r0,r2 \ bge divisorGeDividend
|
||||
=-> sbc r1,r4
|
||||
|
||||
// Compute the shift count. The amount by which the divisor
|
||||
// must be shifted left to be aligned with the dividend.
|
||||
sub.0 r4,r2,r3
|
||||
|
||||
// Align the divisor to the dividend. Execute a divstep (since at
|
||||
// least one will always be executed). Skip the remaining loop
|
||||
// if the shift count is zero.
|
||||
lsl.0 r1,r3,r1 \ beq skipLoop
|
||||
=-> divstep r0,r1 \ add.1 r3,1,r2
|
||||
|
||||
// Execute the divstep loop until temp is 0. This assumes that the
|
||||
// loop count is at least one.
|
||||
sub.0 r3,1,r4
|
||||
divLoop:
|
||||
divstep r0,r1 \ bne divLoop
|
||||
=-> sub.0 r4,1,r4
|
||||
|
||||
skipLoop:
|
||||
|
||||
// The top bits of the result are the remainder. The bottom
|
||||
// bits are the quotient.
|
||||
lsr.0 r0,r2,r1 \ sub.1 16,r2,r4
|
||||
jr (lr ) \ lsl.0 r0,r4,r0
|
||||
=-> lsr.0 r0,r4,r0
|
||||
|
||||
// Special case.
|
||||
|
||||
divisorGeDividend:
|
||||
// The divisor is greater than or equal to the dividend. The flags
|
||||
// indicate which of these alternatives it is. The COPYNE can be used
|
||||
// to set the result appropriately, without introducing any more
|
||||
// branches.
|
||||
copy.0 r0,r1 \ copy.1 0,r0
|
||||
jr (lr) \ copyeq r0,r1
|
||||
=-> copyeq 1,r0
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : __divmod15
|
||||
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#64# 16#69# 16#76# 16#6d# 16#6f# 16#64# 16#31# 16#35# 16#0# // Function name `_divmod15'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,246 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 16-bit signed division/modulus.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.align 8
|
||||
.global __divmodhi4
|
||||
__divmodhi4:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &__divmodhi4 = 4 bytes
|
||||
|
||||
// 16-bit signed division. Most of the special cases are dealt
|
||||
// with by the 15-bit signed division library (e.g., division by
|
||||
// zero, division by 1, and so on). This wrapper simply inverts
|
||||
// any negative inputs, calls the 15-bit library, and flips any
|
||||
// results as necessary. The
|
||||
// only special cases to be handled here are where either the
|
||||
// divisor or the dividend are the maximum negative values.
|
||||
|
||||
// Encode r5 with a bit pattern which indicates whether the
|
||||
// outputs of the division must be negated. The MSB will be set
|
||||
// to the sign of the dividend (which controls the remainder's
|
||||
// sign), while the LSB will store the XOR of the two signs,
|
||||
// which indicates the quotient's sign. R5 is not modified by the
|
||||
// 15-bit divmod routine.
|
||||
sub.0 r1,16#8000#,r15 \ asr.1 r0,15,r4
|
||||
beq divisorIsLargestNegative \ lsr.0 r1,15,r3
|
||||
=-> sub.0 r0,16#8000#,r15 \ xor.1 r3,r4,r5
|
||||
|
||||
// Handle least negative dividend with a special case. Note that the
|
||||
// absolute value of the divisor is also computed here.
|
||||
add.0 [asr r1,15],r1,r3 \ beq dividendIsLargestNegative
|
||||
=-> xor.0 [asr r1,15],r3,r1 \ stw lr,(fp)-1
|
||||
|
||||
// Compute the absolute value of the dividend, and call the main
|
||||
// divide routine.
|
||||
add.0 r4,r0,r2 \ jl (&__divmod15) // fn_call &__divmod15
|
||||
=-> xor.0 r4,r2,r0
|
||||
|
||||
handleNegatedResults:
|
||||
// Speculatively store the negation of the results.
|
||||
sub.0 0,r0,r2 \ sub.1 0,r1,r3
|
||||
|
||||
// Does the quotient need negating? The LSB indicates this.
|
||||
and.0 r5,1,r15 \ ldw (fp)-1,lr
|
||||
copyne r2,r0
|
||||
|
||||
asr.0 r5,15,r15 \ jr (lr)
|
||||
=-> copyne r3,r1
|
||||
|
||||
dividendIsLargestNegative:
|
||||
|
||||
// Divide the constant -32768. Use the Hacker's Delight
|
||||
// algorithm (i.e., ((dividend / 2) / divisor) * 2) gives
|
||||
// approximate answer). This code is a special case, so no
|
||||
// great effort is made to make it fast, only to make it
|
||||
// small.
|
||||
|
||||
lsr.0 r0,1,r0 \ jl (&__divmod15) // fn_call &__divmod15
|
||||
=-> stw r1,(fp)-2
|
||||
|
||||
// Load the original divisor, and compute the new quotient and
|
||||
// remainder.
|
||||
lsl.0 r0,1,r0 \ ldw (fp)-2,r3
|
||||
lsl.0 r1,1,r1 // Fill stall slot
|
||||
|
||||
// The error in the quotient is 0 or 1. The error can be determined
|
||||
// by comparing the remainder to the original divisor. If the
|
||||
// remainder is bigger, then an error of 1 has been introduced,
|
||||
// which must be fixed.
|
||||
sub.0 r1,r3,r15
|
||||
blo noCompensationForError
|
||||
=-> nop
|
||||
add.0 r0,1,r0 \ sub.1 r1,r3,r1
|
||||
noCompensationForError:
|
||||
bra handleNegatedResults
|
||||
=-> nop
|
||||
|
||||
divisorIsLargestNegative:
|
||||
// The flags indicate whether the dividend is also the maximum negative
|
||||
copy.0 r0,r1 \ copy.1 0,r0
|
||||
copyeq r0,r1 \ jr (lr)
|
||||
=-> copyeq 1,r0
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : __divmodhi4
|
||||
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x4 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#64# 16#69# 16#76# 16#6d# 16#6f# 16#64# 16#68# 16#69# 16#34# 16#0# // Function name `_divmodhi4'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
.section .endFile
|
|
@ -1,233 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 32-bit signed division/modulus.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.align 8
|
||||
.global __divmodsi4
|
||||
__divmodsi4:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
// picoChip Function Prologue : &__divmodsi4 = 8 bytes
|
||||
|
||||
// Note: optimising for size is preferred over optimising for speed.
|
||||
|
||||
// Note: the frame is setup throughout the following instructions,
|
||||
// and is complete at the point the udivmodsi4 function is called.
|
||||
|
||||
// Note that R9 is encoded with a pattern which indicates
|
||||
// whether the remainder and quotient should be negated on
|
||||
// completion. The MSB is set to the sign of the dividend
|
||||
// (i.e., the sign of the remainder), while the LSB encodes
|
||||
// the XOR of the two input's signs (i.e., the sign of the
|
||||
// quotient.
|
||||
|
||||
// If dividend is negative, invert the dividend and flag.
|
||||
ASR.0 r1,15,r4
|
||||
BEQ dividendNotNegative
|
||||
=-> STL R[9:8],(FP)-2
|
||||
|
||||
// Dividend is negative - negate dividend.
|
||||
SUB.0 0,R0,R0
|
||||
SUBB.0 0,R1,R1
|
||||
|
||||
dividendNotNegative:
|
||||
|
||||
// If divisor is negative, invert the divisor.
|
||||
AND.0 [lsr r3,15],1,r5
|
||||
SUB.0 R3,0, r15
|
||||
BGE divisorNotNegative
|
||||
=-> XOR.0 r4,r5,r9
|
||||
|
||||
// Divisor is negative - negate divisor.
|
||||
SUB.0 0,R2,R2
|
||||
SUBB.0 0,R3,R3
|
||||
|
||||
divisorNotNegative:
|
||||
|
||||
STL R[13:12],(FP)-1 \ JL (&__udivmodsi4)
|
||||
=-> SUB.0 FP,8,FP // udivmodsi expects the frame to be valid still.
|
||||
|
||||
// The LSB of R9 indicates whether the quotient should be negated.
|
||||
AND.0 r9,1,r15
|
||||
BEQ skipQuotientNegation
|
||||
=-> LDL (FP)1,R[13:12] // Convenient point to restore link/fp
|
||||
|
||||
SUB.0 0,R4,R4
|
||||
SUBB.0 0,R5,R5
|
||||
|
||||
skipQuotientNegation:
|
||||
|
||||
// The MSB of R9 indicates whether the remainder should be negated.
|
||||
ASR.0 R9,15,r15
|
||||
BEQ epilogue
|
||||
|
||||
SUB.0 0,R6,R6
|
||||
SUBB.0 0,R7,R7
|
||||
|
||||
epilogue:
|
||||
|
||||
JR (R12)
|
||||
=-> LDL (FP)-2,R[9:8]
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : __divmodsi4
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x8 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#64# 16#69# 16#76# 16#6d# 16#6f# 16#64# 16#73# 16#69# 16#34# 16#0# // Function name `_divmodsi4'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,4 +0,0 @@
|
|||
// picoChip ASM file
|
||||
// Fake libgcc asm file. This contains nothing, but is used to prevent gcc
|
||||
// getting upset about the lack of a lib1funcs.S file when LIB1ASMFUNCS is
|
||||
// defined to switch off the compilation of parts of libgcc.
|
|
@ -1,182 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 32-bit arithmetic shift right.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Hariharan Sandanagobalane (hariharan@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.global _longjmp
|
||||
_longjmp:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &_longjmp = 0 bytes
|
||||
|
||||
LDL (R0)0, R[3:2]
|
||||
LDL (R0)1, R[5:4]
|
||||
LDL (R0)2, R[7:6]
|
||||
LDL (R0)3, R[9:8]
|
||||
LDL (R0)4, R[11:10]
|
||||
LDL (R0)5, R[13:12]
|
||||
LDW (R0)12, R14
|
||||
LDW (R0)13, R1
|
||||
JR (R12)
|
||||
=-> COPY.0 1,R0
|
||||
|
||||
// picoChip Function Epilogue : longjmp
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#6c# 16#6f# 16#6e# 16#67# 16#6a# 16#6d# 16#70# 16#0# // Function name `longjmp'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,190 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 32-bit logical shift right.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Hariharan Sandanagobalane (hariharan@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
.section .text
|
||||
|
||||
.global ___lshrsi3
|
||||
___lshrsi3:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &___lshrsi3 = 4 bytes
|
||||
|
||||
// if (R2 > 15) goto _L2
|
||||
SUB.0 15,R2,r15
|
||||
JMPLT _L2
|
||||
=-> SUB.0 16,R2,R5 // R5 := R5 - R2 (HI)
|
||||
|
||||
LSR.0 R0,R2,R0 // R4 := R0 >> R2
|
||||
LSR.0 R1,R2,R3 // R3 := R1 >> R2
|
||||
// if (R2 == 0) goto _L4
|
||||
LSL.0 R1,R5,R5 // R5 := R1 << R5
|
||||
OR.0 R5,R0,R4 // R2 := R5 IOR R2 (HI)
|
||||
SUB.0 R2,0,r15
|
||||
COPYNE R4,R0 // R0 := R2
|
||||
JR (R12) // Return to caller
|
||||
=-> COPY.0 R3,R1 // R1 := R3
|
||||
|
||||
_L2:
|
||||
LSR.0 R1,R2,R0 // R2 := R1 >> R2
|
||||
JR (R12) // Return to caller
|
||||
=-> COPY.0 0,R1 // R3 := 0 (short constant)
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : __lshrsi3
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x4 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#5f# 16#6c# 16#73# 16#68# 16#72# 16#72# 16#73# 16#69# 16#33# 16#0# // Function name `__lshrsi3'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
.section .endFile
|
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
|
||||
picoChip GCC support for 32-bit logical shift right.
|
||||
|
||||
Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
Contributed by Picochip Ltd.
|
||||
Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
typedef int HItype __attribute__ ((mode (HI)));
|
||||
typedef unsigned int UHItype __attribute__ ((mode (HI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
|
||||
typedef struct USIstruct {
|
||||
UHItype low, high;
|
||||
} USIstruct;
|
||||
|
||||
typedef union USIunion {
|
||||
USItype l;
|
||||
USIstruct s;
|
||||
} USIunion;
|
||||
|
||||
USItype __lshrsi3(USIunion value, HItype count) {
|
||||
USIunion result;
|
||||
int temp;
|
||||
|
||||
/* Ignore a zero count until we get into the (count < 16)
|
||||
clause. This is slightly slower when shifting by zero, but faster
|
||||
and smaller in all other cases (due to the better scheduling
|
||||
opportunities available by putting the test near computational
|
||||
instructions. */
|
||||
|
||||
if (count < 16) {
|
||||
/* Shift low and high words by the count. */
|
||||
result.s.low = value.s.low >> count;
|
||||
result.s.high = value.s.high >> count;
|
||||
|
||||
/* There is now a hole in the upper `count' bits of the low
|
||||
word. Shift the lower `count' bits of the upper word into the
|
||||
low word. This only works when count isn't zero. */
|
||||
if (count != 0) {
|
||||
temp = value.s.high << (16 - count);
|
||||
result.s.low |= temp;
|
||||
}
|
||||
|
||||
} else {
|
||||
/* Shift the upper word of the source into the lower word of the
|
||||
result, and zero the result's upper word. Note that we actually
|
||||
ned to shift by (count - 16), but as we are only using the
|
||||
bottom 4 bits, this is equivalent to shifting by count. */
|
||||
result.s.low = value.s.high >> count;
|
||||
result.s.high = 0;
|
||||
|
||||
}
|
||||
|
||||
return result.l;
|
||||
|
||||
}
|
|
@ -1,179 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//.file "ucmpsi2.c"
|
||||
//
|
||||
// Support for parity checks.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.align 8
|
||||
.global ___parityhi2
|
||||
___parityhi2:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &___parityhi2 = 0 bytes
|
||||
XOR.0 [LSR R0,8],R0,R0
|
||||
XOR.0 [LSR R0,4],R0,R0
|
||||
XOR.0 [LSR R0,2],R0,R0
|
||||
JR (R12) \ XOR.0 [LSR R0,1],R0,R0
|
||||
=-> AND.0 R0,1,R0
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : __parityhi2
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#5f# 16#70# 16#61# 16#72# 16#69# 16#74# 16#79# 16#68# 16#69# 16#32# 16#0# // Function name `__parityhi2'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,201 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//.file "popcounthi2.S"
|
||||
//
|
||||
// Support for 16-bit population count.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
// The following code (taken from a newsgroup posting) was compiled, and then
|
||||
// hand assembled (a similar version is given in the Hacker's Delight
|
||||
// book, chapter 5).
|
||||
//
|
||||
// int
|
||||
// popcount (int value)
|
||||
// {
|
||||
// value = ((value & 0xAAAA) >> 1) + (value & 0x5555);
|
||||
// value = ((value & 0xCCCC) >> 2) + (value & 0x3333);
|
||||
// value = ((value & 0xF0F0) >> 4) + (value & 0x0F0F);
|
||||
// return ((value & 0xFF00) >> 8) + (value & 0x00FF);
|
||||
// }
|
||||
//
|
||||
// This assembly function is approx. 20x faster than a naive loop
|
||||
// implementation of the population count, but about 30% bigger
|
||||
// (45 bytes v. 34 bytes).
|
||||
|
||||
.align 8
|
||||
.global ___popcounthi2
|
||||
___popcounthi2:
|
||||
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &___popcounthi2 = 0 bytes
|
||||
|
||||
AND.0 [LSR R0,1],21845,R0 \ AND.1 R0,21845,R5
|
||||
ADD.0 R0,R5,R0
|
||||
AND.0 [LSR R0,2],13107,R0 \ AND.1 R0,13107,R5
|
||||
ADD.0 R0,R5,R0 \ COPY.1 1807,R2
|
||||
AND.0 [LSR R0,4],R2,R0 \ AND.1 R0,3855,R5
|
||||
ADD.0 R0,R5,R0
|
||||
JR (R12) \ AND.0 R0, 255, R5
|
||||
=-> ADD.0 [LSR R0,8],R5,R0
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : ___popcounthi2
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#5f# 16#70# 16#6f# 16#70# 16#63# 16#6f# 16#75# 16#6e# 16#74# 16#68# 16#69# 16#32# 16#0# // Function name `__popcounthi2'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,182 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 32-bit arithmetic shift right.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Hariharan Sandanagobalane (hariharan@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.global _setjmp
|
||||
_setjmp:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &_setjmp = 0 bytes
|
||||
|
||||
STL R[3:2],(R0)0
|
||||
STL R[5:4],(R0)1
|
||||
STL R[7:6],(R0)2
|
||||
STL R[9:8],(R0)3
|
||||
STL R[11:10],(R0)4
|
||||
STL R[13:12],(R0)5
|
||||
STW R14,(R0)12
|
||||
STW R1,(R0)13
|
||||
JR (R12)
|
||||
=-> COPY.0 0,R0
|
||||
|
||||
// picoChip Function Epilogue : setjmp
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#73# 16#65# 16#74# 16#6a# 16#6d# 16#70# 16#0# // Function name `setjmp'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,191 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 64-bit subtraction.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Hariharan Sandanagobalane (hariharan@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.align 8
|
||||
.global __subdi3
|
||||
__subdi3:
|
||||
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
// picoChip Function Prologue : &__subdi3 = 4 bytes
|
||||
|
||||
// The first operand of sub is completely in registers r[2-5]
|
||||
// The second operand of sub is in stack FP(0-3)
|
||||
// and result need to be written pointed to by the register r0.
|
||||
// All we need to do is to load the appropriate values, sub them
|
||||
// appropriately (with sub or subb) and then store the values back.
|
||||
ldw (FP)0, r1
|
||||
stl r[7:6], (FP)-1
|
||||
sub.0 r2, r1, r6
|
||||
ldw (FP)1, r1
|
||||
subb.0 r3, r1, r7
|
||||
ldl (FP)1, r[3:2]
|
||||
stl r[7:6], (r0)0
|
||||
subb.0 r4, r2, r6
|
||||
subb.0 r5, r3, r7
|
||||
stl r[7:6], (r0)1
|
||||
jr (r12)
|
||||
=-> ldl (FP)2, r[7:6]
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : __subdi3
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x4 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#73# 16#75# 16#62# 16#64# 16#69# 16#33# 16#0# // Function name `_subdi3'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
.section .endFile
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
# Prevent some of the more complicated libgcc functions from being
|
||||
# compiled. This is because they are generally too big to fit into an
|
||||
# AE anyway, so there is no point in having them. Also, some don't
|
||||
# compile properly so we'll ignore them for the moment.
|
||||
LIB1ASMSRC = picochip/lib1funcs.S
|
||||
LIB1ASMFUNCS = _mulsc3 _divsc3
|
||||
|
||||
# Compile the extra library functions.
|
||||
LIB2ADD = \
|
||||
$(srcdir)/config/picochip/ashrsi3.S \
|
||||
$(srcdir)/config/picochip/ashlsi3.S \
|
||||
$(srcdir)/config/picochip/divmodhi4.S \
|
||||
$(srcdir)/config/picochip/udivmodhi4.S \
|
||||
$(srcdir)/config/picochip/divmodsi4.S \
|
||||
$(srcdir)/config/picochip/udivmodsi4.S \
|
||||
$(srcdir)/config/picochip/divmod15.S \
|
||||
$(srcdir)/config/picochip/ucmpsi2.S \
|
||||
$(srcdir)/config/picochip/cmpsi2.S \
|
||||
$(srcdir)/config/picochip/clzsi2.S \
|
||||
$(srcdir)/config/picochip/adddi3.S \
|
||||
$(srcdir)/config/picochip/subdi3.S \
|
||||
$(srcdir)/config/picochip/lshrsi3.S \
|
||||
$(srcdir)/config/picochip/parityhi2.S \
|
||||
$(srcdir)/config/picochip/popcounthi2.S
|
||||
|
||||
# Special libgcc setup. Make single/double floating point the same,
|
||||
# and use our own include files.
|
||||
HOST_LIBGCC2_CFLAGS += -DDF=SF -I../../includes/
|
||||
|
||||
# Switch off all debugging for the embedded libraries.
|
||||
# (embedded processors need small libraries by default).
|
||||
# NOTE: If the debug level is increased, turn off instruction scheduling.
|
||||
LIBGCC2_DEBUG_CFLAGS = -g0
|
||||
|
||||
# Turn off the building of exception handling libraries.
|
||||
LIB2ADDEH =
|
||||
|
||||
# Turn off ranlib on target libraries.
|
||||
RANLIB_FOR_TARGET = cat
|
|
@ -1,209 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//.file "ucmpsi2.c"
|
||||
//
|
||||
// Support for 32-bit unsigned compare.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// Compiled from the following, and then hand optimised.
|
||||
//
|
||||
// int __ucmpsi2 (USItype x, USItype y)
|
||||
// {
|
||||
//
|
||||
// USIunion lx; lx.l = x;
|
||||
// USIunion ly; ly.l = y;
|
||||
//
|
||||
// if (lx.s.high < ly.s.high)
|
||||
// return 0;
|
||||
// else if (lx.s.high > ly.s.high)
|
||||
// return 2;
|
||||
// if (lx.s.low < ly.s.low)
|
||||
// return 0;
|
||||
// else if (lx.s.low > ly.s.low)
|
||||
// return 2;
|
||||
// return 1;
|
||||
// }
|
||||
|
||||
.section .text
|
||||
|
||||
.align 8
|
||||
.global ___ucmpsi2
|
||||
___ucmpsi2:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
// picoChip Function Prologue : &___ucmpsi2 = 0 bytes
|
||||
SUB.0 R1,R3,r15
|
||||
|
||||
BLO _L1
|
||||
=-> SUB.0 R3,R1,r15 \ COPY.1 0,R5
|
||||
|
||||
BLO _L1
|
||||
=-> SUB.0 R0,R2,r15 \ COPY.1 2,R5
|
||||
|
||||
BLO _L1
|
||||
=-> SUB.0 R2,R0,r15 \ COPY.1 0,R5
|
||||
|
||||
BLO _L1
|
||||
=-> COPY.0 2,R5
|
||||
|
||||
COPY.0 1,R5
|
||||
_L1:
|
||||
JR (R12)
|
||||
=-> COPY.0 R5,R0 // R0 := R5
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : __ucmpsi2
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#5f# 16#75# 16#63# 16#6d# 16#70# 16#73# 16#69# 16#32# 16#0# // Function name `__ucmpsi2'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,238 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 16-bit unsigned division/modulus.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.global __udivmodhi4
|
||||
__udivmodhi4:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
|
||||
// picoChip Function Prologue : &__udivmodhi4 = 6 bytes
|
||||
|
||||
// 16-bit unsigned division. The divstep function is only capable of
|
||||
// handling 15-bit division (plus a sign to give 16-bits). It is not
|
||||
// capable of handling unsigned division directly. Instead, take
|
||||
// advantage of the special property that
|
||||
// ((divisor / 2) / dividend) * 2 will be almost good enough. The
|
||||
// error in the result is only 0 or 1, and this can be easily
|
||||
// tested and corrected. A full description of the algorithm can
|
||||
// be found in `Hacker's Delight', by Henry Warren, page 146.
|
||||
|
||||
// Input:
|
||||
// r0 - dividend
|
||||
// r1 - divisor
|
||||
// Output:
|
||||
// r0 - quotient
|
||||
// r1 - remainder
|
||||
|
||||
// Note that the lr, and original inputs are speculatively saved. They
|
||||
// will only be restored if the 15-bit division function is called.
|
||||
|
||||
sub.0 r1,0,r15 \ stl r[0:1],(fp)-1
|
||||
bge divisorIs15bit
|
||||
=-> sub.0 r0,r1,r2 \ stw lr,(fp)-3
|
||||
|
||||
// The divisor is >= 2^15.
|
||||
bhs quotientIs1
|
||||
|
||||
// The dividend < divisor. The quotient is thus 0, and the
|
||||
// remainder is the dividend.
|
||||
copy.0 r0,r1 \ jr (lr)
|
||||
=-> copy.0 0,r0
|
||||
|
||||
quotientIs1:
|
||||
// The dividend >= divisor. The quotient is thus 1, and the
|
||||
// remainder can be computed directly by subtraction (i.e., the
|
||||
// result of the comparison already performed to branch here).
|
||||
jr (lr) \ copy.0 r2,r1
|
||||
=-> copy.0 1,r0
|
||||
|
||||
divisorIs15bit:
|
||||
// The divisor is < 2^15.
|
||||
|
||||
// Divide the original dividend by 2, and call the 15-bit division.
|
||||
// Note that the original dividend is stored in r5, which is
|
||||
// known to be unused by the called function, so that
|
||||
// a memory stall isn't introduced immediately after the
|
||||
// function returns, to reload this value from memory.
|
||||
|
||||
jl (&__divmod15) \ copy.0 r0,r5 // fn_call &__divmod15
|
||||
=-> lsr.0 r0,1,r0
|
||||
|
||||
// Compute the new quotient and remainder by multiplying them by 2.
|
||||
// The remainder will be 1 out, if the original dividend was odd.
|
||||
and.0 r5,1,r5 \ ldl (fp)-1,r[2:3]
|
||||
add.0 [lsl r1,1],r5,r1 \ lsl.1 r0,1,r0
|
||||
|
||||
// The error in the quotient is 0 or 1. The error can be determined
|
||||
// by comparing the remainder to the original divisor. If the
|
||||
// remainder is bigger, then an error of 1 has been introduced.
|
||||
sub.0 r1,r3,r15 \ ldw (fp)-3,lr
|
||||
blo noCompensation
|
||||
=-> nop
|
||||
add.0 r0,1,r0 \ sub.1 r1,r3,r1
|
||||
noCompensation:
|
||||
jr (lr)
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
// picoChip Function Epilogue : udivmodhi4
|
||||
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x6 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#75# 16#64# 16#69# 16#76# 16#6d# 16#6f# 16#64# 16#68# 16#69# 16#34# 16#0# // Function name `_udivmodhi4'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
|
@ -1,318 +0,0 @@
|
|||
// picoChip ASM file
|
||||
//
|
||||
// Support for 32-bit unsigned division/modulus.
|
||||
//
|
||||
// Copyright (C) 2003-2014 Free Software Foundation, Inc.
|
||||
// Contributed by Picochip Ltd.
|
||||
// Maintained by Daniel Towner (daniel.towner@picochip.com)
|
||||
//
|
||||
// This file is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 3, or (at your option) any
|
||||
// later version.
|
||||
//
|
||||
// This file is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// Under Section 7 of GPL version 3, you are granted additional
|
||||
// permissions described in the GCC Runtime Library Exception, version
|
||||
// 3.1, as published by the Free Software Foundation.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License and
|
||||
// a copy of the GCC Runtime Library Exception along with this program;
|
||||
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
.section .text
|
||||
|
||||
.align 8
|
||||
.global __udivmodsi4
|
||||
__udivmodsi4:
|
||||
_picoMark_FUNCTION_BEGIN=
|
||||
// picoChip Function Prologue : &__udivmodsi4 = 24 bytes
|
||||
|
||||
// Schedule the register saves alongside the special cases, so that
|
||||
// if the special cases fail, the registers will have already
|
||||
// been stored onto the stack.
|
||||
SUB.0 R3,R1,r15 \ STL R[13:12],(FP)-1
|
||||
BHS skipCommonCase \ STL R[9:8],(FP)-4
|
||||
=-> SUB.0 R2,1,r15 \ STL R[11:10],(FP)-3
|
||||
|
||||
_L2:
|
||||
// Flags set above, and in _L2 caller.
|
||||
BNE restOfCode
|
||||
=-> SUB.0 R3,0,r15
|
||||
BNE restOfCode
|
||||
=-> COPY.0 R0,R4 \ COPY.1 R1,R5
|
||||
JR (R12) // Return to caller
|
||||
=-> COPY.0 0,R6 \ COPY.1 0,R7
|
||||
// Never reach here
|
||||
|
||||
skipCommonCase:
|
||||
SUB.0 R3,R1,r15
|
||||
BNE _L3 // (Reversed branch)
|
||||
=-> SUB.0 R2,R0,r15 // Must be set in delay slot, so ready by _L9
|
||||
|
||||
_L9:
|
||||
BLO _L2 // (Reversed branch)
|
||||
=-> SUB.0 R2,1,r15
|
||||
|
||||
_L3:
|
||||
SUB.0 R2,R0,r15
|
||||
BEQ _L10 // (Reversed branch)
|
||||
=-> SUB.0 R1,R3,r15 // Set flags for branch at _L10
|
||||
|
||||
_L4:
|
||||
// greater than
|
||||
COPY.0 0,R4 \ COPY.1 0,R5 \ JR (R12) // Return to caller
|
||||
=-> COPY.0 R0,R6 \ COPY.1 R1,R7
|
||||
// Doesn't reach here.
|
||||
|
||||
_L10:
|
||||
// Flags set in _L10 call delay slot.
|
||||
BNE _L4
|
||||
=-> COPY.0 1,R4 \ COPY.1 0,R5
|
||||
JR (R12) // Return to caller
|
||||
=-> COPY.0 0,R6 \ COPY.1 0,R7
|
||||
|
||||
restOfCode:
|
||||
|
||||
// Prologue
|
||||
|
||||
// Register saves scheduled alongside special cases above.
|
||||
ADD.0 FP,-20,FP \ STW R14,(FP)-4
|
||||
|
||||
// The following can be scheduled together.
|
||||
// dividend in R[9:8] (from R[1:0])
|
||||
// divisor in R[7:6] (from R[3:2])
|
||||
// R14 := clzsi2 (dividend)
|
||||
// R0 := clzsi2 (divisor)
|
||||
JL (&__clzsi2) \ COPY.0 R0,R8 \ COPY.1 R1,R9
|
||||
=-> COPY.0 R2,R6 \ COPY.1 R3,R7
|
||||
COPY.0 R0,R14 \ JL (&__clzsi2)
|
||||
=-> COPY.0 R6,R0 \ COPY.1 R7,R1
|
||||
|
||||
// R14 := R0 - R14
|
||||
SUB.0 R0,R14,R14
|
||||
|
||||
ADD.0 R14,1,R0 // R0 := R14 + 1 (HI)
|
||||
|
||||
// R[11:10] = R[7,6] << R14
|
||||
SUB.0 15,R14,r15
|
||||
LSL.0 R6,R14,R11 \ BLT setupDivstepLoop
|
||||
=-> SUB.0 0,R14,R4 \ COPY.1 0,R10
|
||||
|
||||
// Zero shift is a special case. Shifting by zero within a 16-bit
|
||||
// source object is fine, but don't execute the OR of the right-shift
|
||||
// into the final result.
|
||||
LSL.0 R7,R14,R11 \ BEQ setupDivstepLoop
|
||||
=-> LSL.0 R6,R14,R10
|
||||
|
||||
LSR.0 R6,R4,R4
|
||||
OR.0 R11,R4,R11
|
||||
|
||||
setupDivstepLoop:
|
||||
|
||||
// R[5:4] := R[9:8] (SI)
|
||||
COPY.0 R8,R4 \ COPY.1 R9,R5
|
||||
COPY.0 0,R6 \ COPY.1 R0,R8
|
||||
|
||||
// Store original value of loopCount for use after the loop.
|
||||
// The Subtraction is handled in the tail of the loop iteration
|
||||
// after this point.
|
||||
SUB.0 R4,R10,R0 \ COPY.1 R8,R14
|
||||
|
||||
// workingResult in R4,5,6
|
||||
// temps in r0,1,2 and r7
|
||||
// alignedDivisor in R10,11
|
||||
// loopCount in r8
|
||||
// r3, r9 scratch, used for renaming.
|
||||
|
||||
loopStart:
|
||||
// R0 := R4 - zeroExtend (R10) - only need 33-bits (i.e., 48-bits)
|
||||
SUBB.0 R5,R11,R1 \ LSR.1 R0,15,R3
|
||||
SUBB.0 R6,0,R2 \ LSR.1 R1,15,R6
|
||||
|
||||
// if (carry) goto shiftOnly
|
||||
SUB.0 R8,1,R8 \ BNE shiftOnly
|
||||
=-> LSR.0 R4,15,R7 \ LSL.1 R1,1,R9
|
||||
|
||||
OR.0 [LSL R0,1],1,R4 \ BNE loopStart
|
||||
=-> SUB.0 R4,R10,R0 \ OR.1 R9,R3,R5
|
||||
|
||||
BRA loopEnd
|
||||
|
||||
shiftOnly:
|
||||
|
||||
OR.0 [LSL R5,1],R7,R5 \ BNE loopStart \ LSR.1 R5,15,R6
|
||||
=-> SUB.0 [LSL R4,1],R10,R0 \LSL.1 R4,1,R4
|
||||
|
||||
// End of loop
|
||||
loopEnd:
|
||||
|
||||
// Schedule the computation of the upper word after shifting
|
||||
// alongside the decision over whether to branch, and the register
|
||||
// restores.
|
||||
// R10 is filled with a useful constant.
|
||||
SUB.0 15,r14,r15 \ LDL (FP)4,R[13:12]
|
||||
SUB.1 0,R14,R1 // Don't set flags!
|
||||
LSL.0 R6,R1,R3 \ LDL (FP)-4,R[9:8]
|
||||
|
||||
BLT remainderHasMoreThan16Bits \ LSR.0 R5,R14,R7 \ COPY.1 -1,R10
|
||||
=-> LSL.0 R5,R1,R2 \ OR.1 R7,R3,R3
|
||||
|
||||
LSR.0 R4,R14,R3 \ COPY.1 R3,R7
|
||||
BRA epilogue \ LSR.0 -1,R1,R0 \ COPY.1 0,R5
|
||||
=-> OR.0 R3,R2,R6 \ AND.1 R0,R4,R4
|
||||
|
||||
remainderHasMoreThan16Bits:
|
||||
|
||||
LSL.0 R10,R14,R1 \ COPY.1 R3,R6
|
||||
XOR.0 R10,R1,R1 \ COPY.1 0,R7
|
||||
AND.0 R1,R5,R5
|
||||
|
||||
epilogue:
|
||||
|
||||
JR (R12) \ LDW (FP)-4,R14
|
||||
=-> LDL (FP)-3,R[11:10]
|
||||
|
||||
_picoMark_FUNCTION_END=
|
||||
|
||||
// picoChip Function Epilogue : udivmodsi4
|
||||
|
||||
//============================================================================
|
||||
// All DWARF information between this marker, and the END OF DWARF
|
||||
// marker should be included in the source file. Search for
|
||||
// FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
|
||||
// provide the relevant information. Add markers called
|
||||
// _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
|
||||
// function in question.
|
||||
//============================================================================
|
||||
|
||||
//============================================================================
|
||||
// Frame information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_frame
|
||||
_picoMark_DebugFrame=
|
||||
|
||||
// Common CIE header.
|
||||
.unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
|
||||
_picoMark_CieBegin=
|
||||
.unalignedInitLong 0xffffffff
|
||||
.initByte 0x1 // CIE Version
|
||||
.ascii 16#0# // CIE Augmentation
|
||||
.uleb128 0x1 // CIE Code Alignment Factor
|
||||
.sleb128 2 // CIE Data Alignment Factor
|
||||
.initByte 0xc // CIE RA Column
|
||||
.initByte 0xc // DW_CFA_def_cfa
|
||||
.uleb128 0xd
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_CieEnd=
|
||||
|
||||
// FDE
|
||||
_picoMark_LSFDE0I900821033007563=
|
||||
.unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
|
||||
_picoMark_FdeBegin=
|
||||
.unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location
|
||||
.unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x18 // <-- FUNCTION_STACK_SIZE_GOES_HERE
|
||||
.initByte 0x4 // DW_CFA_advance_loc4
|
||||
.unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
|
||||
.initByte 0xe // DW_CFA_def_cfa_offset
|
||||
.uleb128 0x0
|
||||
.align 2
|
||||
_picoMark_FdeEnd=
|
||||
|
||||
//============================================================================
|
||||
// Abbrevation information.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_abbrev
|
||||
_picoMark_ABBREVIATIONS=
|
||||
|
||||
.section .debug_abbrev
|
||||
.uleb128 0x1 // (abbrev code)
|
||||
.uleb128 0x11 // (TAG: DW_TAG_compile_unit)
|
||||
.initByte 0x1 // DW_children_yes
|
||||
.uleb128 0x10 // (DW_AT_stmt_list)
|
||||
.uleb128 0x6 // (DW_FORM_data4)
|
||||
.uleb128 0x12 // (DW_AT_high_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x11 // (DW_AT_low_pc)
|
||||
.uleb128 0x1 // (DW_FORM_addr)
|
||||
.uleb128 0x25 // (DW_AT_producer)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.uleb128 0x13 // (DW_AT_language)
|
||||
.uleb128 0x5 // (DW_FORM_data2)
|
||||
.uleb128 0x3 // (DW_AT_name)
|
||||
.uleb128 0x8 // (DW_FORM_string)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.uleb128 0x2 ;# (abbrev code)
|
||||
.uleb128 0x2e ;# (TAG: DW_TAG_subprogram)
|
||||
.initByte 0x0 ;# DW_children_no
|
||||
.uleb128 0x3 ;# (DW_AT_name)
|
||||
.uleb128 0x8 ;# (DW_FORM_string)
|
||||
.uleb128 0x11 ;# (DW_AT_low_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.uleb128 0x12 ;# (DW_AT_high_pc)
|
||||
.uleb128 0x1 ;# (DW_FORM_addr)
|
||||
.initByte 0x0
|
||||
.initByte 0x0
|
||||
|
||||
.initByte 0x0
|
||||
|
||||
//============================================================================
|
||||
// Line information. DwarfLib requires this to be present, but it can
|
||||
// be empty.
|
||||
//============================================================================
|
||||
|
||||
.section .debug_line
|
||||
_picoMark_LINES=
|
||||
|
||||
//============================================================================
|
||||
// Debug Information
|
||||
//============================================================================
|
||||
.section .debug_info
|
||||
|
||||
//Fixed header.
|
||||
.unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
|
||||
_picoMark_DEBUG_INFO_BEGIN=
|
||||
.unalignedInitWord 0x2
|
||||
.unalignedInitLong _picoMark_ABBREVIATIONS
|
||||
.initByte 0x2
|
||||
|
||||
// Compile unit information.
|
||||
.uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit)
|
||||
.unalignedInitLong _picoMark_LINES
|
||||
.unalignedInitWord _picoMark_FUNCTION_END
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN
|
||||
// Producer is `picoChip'
|
||||
.ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
|
||||
.unalignedInitWord 0xcafe // ASM language
|
||||
.ascii 16#0# // Name. DwarfLib expects this to be present.
|
||||
|
||||
.uleb128 0x2 ;# (DIE DW_TAG_subprogram)
|
||||
|
||||
// FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
|
||||
// digit is specified using the format 16#XX#
|
||||
.ascii 16#5f# 16#75# 16#64# 16#69# 16#76# 16#6d# 16#6f# 16#64# 16#73# 16#69# 16#34# 16#0# // Function name `_udivmodsi4'
|
||||
.unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc
|
||||
.unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc
|
||||
|
||||
.initByte 0x0 // end of compile unit children.
|
||||
|
||||
_picoMark_DEBUG_INFO_END=
|
||||
|
||||
//============================================================================
|
||||
// END OF DWARF
|
||||
//============================================================================
|
||||
.section .endFile
|
||||
// End of picoChip ASM file
|
Loading…
Add table
Reference in a new issue