Path: blob/master/arch/xtensa/variants/dc232b/include/variant/tie-asm.h
10821 views
/*1* This header file contains assembly-language definitions (assembly2* macros, etc.) for this specific Xtensa processor's TIE extensions3* and options. It is customized to this Xtensa processor configuration.4*5* This file is subject to the terms and conditions of the GNU General Public6* License. See the file "COPYING" in the main directory of this archive7* for more details.8*9* Copyright (C) 1999-2007 Tensilica Inc.10*/1112#ifndef _XTENSA_CORE_TIE_ASM_H13#define _XTENSA_CORE_TIE_ASM_H1415/* Selection parameter values for save-area save/restore macros: */16/* Option vs. TIE: */17#define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */18#define XTHAL_SAS_OPT 0x0002 /* optional (and not a coprocessor) */19/* Whether used automatically by compiler: */20#define XTHAL_SAS_NOCC 0x0004 /* not used by compiler w/o special opts/code */21#define XTHAL_SAS_CC 0x0008 /* used by compiler without special opts/code */22/* ABI handling across function calls: */23#define XTHAL_SAS_CALR 0x0010 /* caller-saved */24#define XTHAL_SAS_CALE 0x0020 /* callee-saved */25#define XTHAL_SAS_GLOB 0x0040 /* global across function calls (in thread) */26/* Misc */27#define XTHAL_SAS_ALL 0xFFFF /* include all default NCP contents */28293031/* Macro to save all non-coprocessor (extra) custom TIE and optional state32* (not including zero-overhead loop registers).33* Save area ptr (clobbered): ptr (1 byte aligned)34* Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed)35*/36.macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL37xchal_sa_start \continue, \ofs38.ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~\select39xchal_sa_align \ptr, 0, 1024-8, 4, 440rsr \at1, ACCLO // MAC16 accumulator41rsr \at2, ACCHI42s32i \at1, \ptr, .Lxchal_ofs_ + 043s32i \at2, \ptr, .Lxchal_ofs_ + 444.set .Lxchal_ofs_, .Lxchal_ofs_ + 845.endif46.ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select47xchal_sa_align \ptr, 0, 1024-16, 4, 448rsr \at1, M0 // MAC16 registers49rsr \at2, M150s32i \at1, \ptr, .Lxchal_ofs_ + 051s32i \at2, \ptr, .Lxchal_ofs_ + 452rsr \at1, M253rsr \at2, M354s32i \at1, \ptr, .Lxchal_ofs_ + 855s32i \at2, \ptr, .Lxchal_ofs_ + 1256.set .Lxchal_ofs_, .Lxchal_ofs_ + 1657.endif58.ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select59xchal_sa_align \ptr, 0, 1024-4, 4, 460rsr \at1, SCOMPARE1 // conditional store option61s32i \at1, \ptr, .Lxchal_ofs_ + 062.set .Lxchal_ofs_, .Lxchal_ofs_ + 463.endif64.ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select65xchal_sa_align \ptr, 0, 1024-4, 4, 466rur \at1, THREADPTR // threadptr option67s32i \at1, \ptr, .Lxchal_ofs_ + 068.set .Lxchal_ofs_, .Lxchal_ofs_ + 469.endif70.endm // xchal_ncp_store7172/* Macro to save all non-coprocessor (extra) custom TIE and optional state73* (not including zero-overhead loop registers).74* Save area ptr (clobbered): ptr (1 byte aligned)75* Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed)76*/77.macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL78xchal_sa_start \continue, \ofs79.ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~\select80xchal_sa_align \ptr, 0, 1024-8, 4, 481l32i \at1, \ptr, .Lxchal_ofs_ + 082l32i \at2, \ptr, .Lxchal_ofs_ + 483wsr \at1, ACCLO // MAC16 accumulator84wsr \at2, ACCHI85.set .Lxchal_ofs_, .Lxchal_ofs_ + 886.endif87.ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select88xchal_sa_align \ptr, 0, 1024-16, 4, 489l32i \at1, \ptr, .Lxchal_ofs_ + 090l32i \at2, \ptr, .Lxchal_ofs_ + 491wsr \at1, M0 // MAC16 registers92wsr \at2, M193l32i \at1, \ptr, .Lxchal_ofs_ + 894l32i \at2, \ptr, .Lxchal_ofs_ + 1295wsr \at1, M296wsr \at2, M397.set .Lxchal_ofs_, .Lxchal_ofs_ + 1698.endif99.ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select100xchal_sa_align \ptr, 0, 1024-4, 4, 4101l32i \at1, \ptr, .Lxchal_ofs_ + 0102wsr \at1, SCOMPARE1 // conditional store option103.set .Lxchal_ofs_, .Lxchal_ofs_ + 4104.endif105.ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select106xchal_sa_align \ptr, 0, 1024-4, 4, 4107l32i \at1, \ptr, .Lxchal_ofs_ + 0108wur \at1, THREADPTR // threadptr option109.set .Lxchal_ofs_, .Lxchal_ofs_ + 4110.endif111.endm // xchal_ncp_load112113114115#define XCHAL_NCP_NUM_ATMPS 2116117118#define XCHAL_SA_NUM_ATMPS 2119120#endif /*_XTENSA_CORE_TIE_ASM_H*/121122123124