blob: 7e08f17accd573b50a32f0070971c376f616e42e [file] [log] [blame]
Isaku Yamahatae92e8c62008-05-19 22:13:36 +09001/******************************************************************************
Tony Luck7f304912008-08-01 10:13:32 -07002 * arch/ia64/include/asm/native/inst.h
Isaku Yamahatae92e8c62008-05-19 22:13:36 +09003 *
4 * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
5 * VA Linux Systems Japan K.K.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
Isaku Yamahata02e32e32008-05-19 22:13:37 +090023#define DO_SAVE_MIN IA64_NATIVE_DO_SAVE_MIN
24
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090025#define MOV_FROM_IFA(reg) \
26 mov reg = cr.ifa
27
28#define MOV_FROM_ITIR(reg) \
29 mov reg = cr.itir
30
31#define MOV_FROM_ISR(reg) \
32 mov reg = cr.isr
33
34#define MOV_FROM_IHA(reg) \
35 mov reg = cr.iha
36
37#define MOV_FROM_IPSR(pred, reg) \
38(pred) mov reg = cr.ipsr
39
40#define MOV_FROM_IIM(reg) \
41 mov reg = cr.iim
42
43#define MOV_FROM_IIP(reg) \
44 mov reg = cr.iip
45
46#define MOV_FROM_IVR(reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070047 mov reg = cr.ivr
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090048
49#define MOV_FROM_PSR(pred, reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070050(pred) mov reg = psr
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090051
Isaku Yamahata94752a72009-03-04 21:05:38 +090052#define MOV_FROM_ITC(pred, pred_clob, reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070053(pred) mov reg = ar.itc
Isaku Yamahata94752a72009-03-04 21:05:38 +090054
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090055#define MOV_TO_IFA(reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070056 mov cr.ifa = reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090057
58#define MOV_TO_ITIR(pred, reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070059(pred) mov cr.itir = reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090060
61#define MOV_TO_IHA(pred, reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070062(pred) mov cr.iha = reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090063
64#define MOV_TO_IPSR(pred, reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070065(pred) mov cr.ipsr = reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090066
67#define MOV_TO_IFS(pred, reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070068(pred) mov cr.ifs = reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090069
70#define MOV_TO_IIP(reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070071 mov cr.iip = reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090072
73#define MOV_TO_KR(kr, reg, clob0, clob1) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070074 mov IA64_KR(kr) = reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090075
76#define ITC_I(pred, reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070077(pred) itc.i reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090078
79#define ITC_D(pred, reg, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070080(pred) itc.d reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090081
82#define ITC_I_AND_D(pred_i, pred_d, reg, clob) \
83(pred_i) itc.i reg; \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070084(pred_d) itc.d reg
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090085
86#define THASH(pred, reg0, reg1, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -070087(pred) thash reg0 = reg1
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090088
89#define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1) \
90 ssm psr.ic | PSR_DEFAULT_BITS \
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090091 ;; \
92 srlz.i /* guarantee that interruption collectin is on */ \
93 ;;
94
95#define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1) \
96 ssm psr.ic \
Isaku Yamahatae92e8c62008-05-19 22:13:36 +090097 ;; \
98 srlz.d
99
100#define RSM_PSR_IC(clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -0700101 rsm psr.ic
Isaku Yamahatae92e8c62008-05-19 22:13:36 +0900102
103#define SSM_PSR_I(pred, pred_clob, clob) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -0700104(pred) ssm psr.i
Isaku Yamahatae92e8c62008-05-19 22:13:36 +0900105
106#define RSM_PSR_I(pred, clob0, clob1) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -0700107(pred) rsm psr.i
Isaku Yamahatae92e8c62008-05-19 22:13:36 +0900108
109#define RSM_PSR_I_IC(clob0, clob1, clob2) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -0700110 rsm psr.i | psr.ic
Isaku Yamahatae92e8c62008-05-19 22:13:36 +0900111
112#define RSM_PSR_DT \
113 rsm psr.dt
114
Isaku Yamahatac4312512009-03-04 21:05:45 +0900115#define RSM_PSR_BE_I(clob0, clob1) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -0700116 rsm psr.be | psr.i
Isaku Yamahatac4312512009-03-04 21:05:45 +0900117
Isaku Yamahatae92e8c62008-05-19 22:13:36 +0900118#define SSM_PSR_DT_AND_SRLZ_I \
119 ssm psr.dt \
120 ;; \
121 srlz.i
122
123#define BSW_0(clob0, clob1, clob2) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -0700124 bsw.0
Isaku Yamahatae92e8c62008-05-19 22:13:36 +0900125
126#define BSW_1(clob0, clob1) \
Luis R. Rodrigueze55645e2015-06-02 11:42:02 -0700127 bsw.1
Isaku Yamahatae92e8c62008-05-19 22:13:36 +0900128
129#define COVER \
130 cover
131
132#define RFI \
133 rfi