vfp.isa (10205:3ca67d0e0e7e) vfp.isa (10474:799c8ee4ecba)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010-2013 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

--- 34 unchanged lines hidden (view full) ---

43 bool trapEnCheck;
44 uint32_t seq;
45 if (!vfpNeonEnabled(seq,Hcptr, Nsacr, Cpacr, Cpsr, issEnCheck,
46 trapEnCheck, xc->tcBase(), Fpexc))
47 {return disabledFault();}
48 if (trapEnCheck) {
49 CPSR cpsrEnCheck = Cpsr;
50 if (cpsrEnCheck.mode == MODE_HYP) {
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010-2013 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

--- 34 unchanged lines hidden (view full) ---

43 bool trapEnCheck;
44 uint32_t seq;
45 if (!vfpNeonEnabled(seq,Hcptr, Nsacr, Cpacr, Cpsr, issEnCheck,
46 trapEnCheck, xc->tcBase(), Fpexc))
47 {return disabledFault();}
48 if (trapEnCheck) {
49 CPSR cpsrEnCheck = Cpsr;
50 if (cpsrEnCheck.mode == MODE_HYP) {
51 return new UndefinedInstruction(machInst, issEnCheck,
51 return std::make_shared<UndefinedInstruction>(
52 machInst, issEnCheck,
52 EC_TRAPPED_HCPTR, mnemonic);
53 } else {
54 if (!inSecureState(Scr, Cpsr)) {
53 EC_TRAPPED_HCPTR, mnemonic);
54 } else {
55 if (!inSecureState(Scr, Cpsr)) {
55 return new HypervisorTrap(machInst, issEnCheck,
56 return std::make_shared<HypervisorTrap>(
57 machInst, issEnCheck,
56 EC_TRAPPED_HCPTR);
57 }
58 }
59 }
60 '''
61
62 vfp64EnabledCheckCode = '''
63 CPSR cpsrEnCheck = Cpsr;
64 ExceptionLevel el = (ExceptionLevel) (uint8_t) cpsrEnCheck.el;
65 if (!vfpNeon64Enabled(Cpacr64, el))
58 EC_TRAPPED_HCPTR);
59 }
60 }
61 }
62 '''
63
64 vfp64EnabledCheckCode = '''
65 CPSR cpsrEnCheck = Cpsr;
66 ExceptionLevel el = (ExceptionLevel) (uint8_t) cpsrEnCheck.el;
67 if (!vfpNeon64Enabled(Cpacr64, el))
66 return new SupervisorTrap(machInst, 0x1E00000,
68 return std::make_shared<SupervisorTrap>(machInst, 0x1E00000,
67 EC_TRAPPED_SIMD_FP);
68
69 if (ArmSystem::haveVirtualization(xc->tcBase()) && el <= EL2) {
70 HCPTR cptrEnCheck = xc->tcBase()->readMiscReg(MISCREG_CPTR_EL2);
71 if (cptrEnCheck.tfp)
69 EC_TRAPPED_SIMD_FP);
70
71 if (ArmSystem::haveVirtualization(xc->tcBase()) && el <= EL2) {
72 HCPTR cptrEnCheck = xc->tcBase()->readMiscReg(MISCREG_CPTR_EL2);
73 if (cptrEnCheck.tfp)
72 return new HypervisorTrap(machInst, 0x1E00000,
74 return std::make_shared<HypervisorTrap>(machInst, 0x1E00000,
73 EC_TRAPPED_SIMD_FP);
74 }
75
76 if (ArmSystem::haveSecurity(xc->tcBase())) {
77 HCPTR cptrEnCheck = xc->tcBase()->readMiscReg(MISCREG_CPTR_EL3);
78 if (cptrEnCheck.tfp)
75 EC_TRAPPED_SIMD_FP);
76 }
77
78 if (ArmSystem::haveSecurity(xc->tcBase())) {
79 HCPTR cptrEnCheck = xc->tcBase()->readMiscReg(MISCREG_CPTR_EL3);
80 if (cptrEnCheck.tfp)
79 return new SecureMonitorTrap(machInst, 0x1E00000,
81 return std::make_shared<SecureMonitorTrap>(machInst, 0x1E00000,
80 EC_TRAPPED_SIMD_FP);
81 }
82 '''
83
84 vmsrEnabledCheckCode = '''
85 uint32_t issEnCheck;
86 bool trapEnCheck;
87 uint32_t seq;
88 if (!vfpNeonEnabled(seq,Hcptr, Nsacr, Cpacr, Cpsr, issEnCheck,
89 trapEnCheck, xc->tcBase()))
90 if (dest != (int)MISCREG_FPEXC && dest != (int)MISCREG_FPSID)
91 {return disabledFault();}
92 if (!inPrivilegedMode(Cpsr))
93 if (dest != (int)MISCREG_FPSCR)
94 return disabledFault();
95 if (trapEnCheck) {
96 CPSR cpsrEnCheck = Cpsr;
97 if (cpsrEnCheck.mode == MODE_HYP) {
82 EC_TRAPPED_SIMD_FP);
83 }
84 '''
85
86 vmsrEnabledCheckCode = '''
87 uint32_t issEnCheck;
88 bool trapEnCheck;
89 uint32_t seq;
90 if (!vfpNeonEnabled(seq,Hcptr, Nsacr, Cpacr, Cpsr, issEnCheck,
91 trapEnCheck, xc->tcBase()))
92 if (dest != (int)MISCREG_FPEXC && dest != (int)MISCREG_FPSID)
93 {return disabledFault();}
94 if (!inPrivilegedMode(Cpsr))
95 if (dest != (int)MISCREG_FPSCR)
96 return disabledFault();
97 if (trapEnCheck) {
98 CPSR cpsrEnCheck = Cpsr;
99 if (cpsrEnCheck.mode == MODE_HYP) {
98 return new UndefinedInstruction(machInst, issEnCheck,
100 return std::make_shared<UndefinedInstruction>(
101 machInst, issEnCheck,
99 EC_TRAPPED_HCPTR, mnemonic);
100 } else {
101 if (!inSecureState(Scr, Cpsr)) {
102 EC_TRAPPED_HCPTR, mnemonic);
103 } else {
104 if (!inSecureState(Scr, Cpsr)) {
102 return new HypervisorTrap(machInst, issEnCheck,
105 return std::make_shared<HypervisorTrap>(
106 machInst, issEnCheck,
103 EC_TRAPPED_HCPTR);
104 }
105 }
106 }
107 '''
108
109 vmrsEnabledCheckCode = '''
110 uint32_t issEnCheck;

--- 5 unchanged lines hidden (view full) ---

116 op1 != (int)MISCREG_MVFR0 && op1 != (int)MISCREG_MVFR1)
117 {return disabledFault();}
118 if (!inPrivilegedMode(Cpsr))
119 if (op1 != (int)MISCREG_FPSCR)
120 return disabledFault();
121 if (trapEnCheck) {
122 CPSR cpsrEnCheck = Cpsr;
123 if (cpsrEnCheck.mode == MODE_HYP) {
107 EC_TRAPPED_HCPTR);
108 }
109 }
110 }
111 '''
112
113 vmrsEnabledCheckCode = '''
114 uint32_t issEnCheck;

--- 5 unchanged lines hidden (view full) ---

120 op1 != (int)MISCREG_MVFR0 && op1 != (int)MISCREG_MVFR1)
121 {return disabledFault();}
122 if (!inPrivilegedMode(Cpsr))
123 if (op1 != (int)MISCREG_FPSCR)
124 return disabledFault();
125 if (trapEnCheck) {
126 CPSR cpsrEnCheck = Cpsr;
127 if (cpsrEnCheck.mode == MODE_HYP) {
124 return new UndefinedInstruction(machInst, issEnCheck,
128 return std::make_shared<UndefinedInstruction>(
129 machInst, issEnCheck,
125 EC_TRAPPED_HCPTR, mnemonic);
126 } else {
127 if (!inSecureState(Scr, Cpsr)) {
130 EC_TRAPPED_HCPTR, mnemonic);
131 } else {
132 if (!inSecureState(Scr, Cpsr)) {
128 return new HypervisorTrap(machInst, issEnCheck,
133 return std::make_shared<HypervisorTrap>(
134 machInst, issEnCheck,
129 EC_TRAPPED_HCPTR);
130 }
131 }
132 }
133 '''
134 vmrsApsrEnabledCheckCode = '''
135 uint32_t issEnCheck;
136 bool trapEnCheck;
137 uint32_t seq;
138 if (!vfpNeonEnabled(seq,Hcptr, Nsacr, Cpacr, Cpsr, issEnCheck,
139 trapEnCheck, xc->tcBase()))
140 {return disabledFault();}
141 if (trapEnCheck) {
142 CPSR cpsrEnCheck = Cpsr;
143 if (cpsrEnCheck.mode == MODE_HYP) {
135 EC_TRAPPED_HCPTR);
136 }
137 }
138 }
139 '''
140 vmrsApsrEnabledCheckCode = '''
141 uint32_t issEnCheck;
142 bool trapEnCheck;
143 uint32_t seq;
144 if (!vfpNeonEnabled(seq,Hcptr, Nsacr, Cpacr, Cpsr, issEnCheck,
145 trapEnCheck, xc->tcBase()))
146 {return disabledFault();}
147 if (trapEnCheck) {
148 CPSR cpsrEnCheck = Cpsr;
149 if (cpsrEnCheck.mode == MODE_HYP) {
144 return new UndefinedInstruction(machInst, issEnCheck,
150 return std::make_shared<UndefinedInstruction>(
151 machInst, issEnCheck,
145 EC_TRAPPED_HCPTR, mnemonic);
146 } else {
147 if (!inSecureState(Scr, Cpsr)) {
152 EC_TRAPPED_HCPTR, mnemonic);
153 } else {
154 if (!inSecureState(Scr, Cpsr)) {
148 return new HypervisorTrap(machInst, issEnCheck,
155 return std::make_shared<HypervisorTrap>(
156 machInst, issEnCheck,
149 EC_TRAPPED_HCPTR);
150 }
151 }
152 }
153 '''
154}};
155
156def template FpRegRegOpDeclare {{

--- 112 unchanged lines hidden ---
157 EC_TRAPPED_HCPTR);
158 }
159 }
160 }
161 '''
162}};
163
164def template FpRegRegOpDeclare {{

--- 112 unchanged lines hidden ---