1// Copyright (c) 2017-2019 ARM Limited |
2// All rights reserved 3// 4// The license below extends only to copyright in the software and shall 5// not be construed as granting a license to any other intellectual 6// property including but not limited to intellectual property relating 7// to a hardware implementation of the functionality of the software 8// licensed hereunder. You may use the software subject to the license 9// terms below provided that you ensure that this notice is replicated --- 1102 unchanged lines hidden (view full) --- 1112 # operations (gather loads, scatter stores) 1113 def emitSveIndexedMemMicroops(indexed_addr_form): 1114 assert indexed_addr_form in (IndexedAddrForm.VEC_PLUS_IMM, 1115 IndexedAddrForm.SCA_PLUS_VEC) 1116 global header_output, exec_output, decoders 1117 tplHeader = 'template <class RegElemType, class MemElemType>' 1118 tplArgs = '<RegElemType, MemElemType>' 1119 if indexed_addr_form == IndexedAddrForm.VEC_PLUS_IMM: |
1120 eaCode_store = ''' |
1121 EA = AA64FpBase_x[elemIndex] + imm * sizeof(MemElemType)''' |
1122 eaCode_load = ''' 1123 EA = AA64FpUreg0_x[elemIndex] + imm * sizeof(MemElemType)''' |
1124 else: |
1125 offset_code = ''' |
1126 if (offsetIs32) { 1127 offset &= (1ULL << 32) - 1; 1128 } 1129 if (offsetIsSigned) { 1130 offset = sext<32>(offset); 1131 } 1132 if (offsetIsScaled) { 1133 offset *= sizeof(MemElemType); 1134 } 1135 EA = XBase + offset''' |
1136 eaCode_store = ''' 1137 uint64_t offset = AA64FpOffset_x[elemIndex];''' + offset_code 1138 eaCode_load = ''' 1139 uint64_t offset = AA64FpUreg0_x[elemIndex];''' + offset_code 1140 |
1141 loadMemAccCode = ''' 1142 AA64FpDest_x[elemIndex] = memData; 1143 ''' 1144 storeMemAccCode = ''' 1145 memData = AA64FpDest_x[elemIndex]; 1146 ''' 1147 predCheckCode = 'GpOp_x[index]' 1148 faultStatusSetCode = 'PUreg0_x[elemIndex] = 1;' 1149 faultStatusResetCode = 'PUreg0_x[elemIndex] = 0;' 1150 loadIop = InstObjParams('ld1', 1151 ('SveGatherLoadVIMicroop' 1152 if indexed_addr_form == IndexedAddrForm.VEC_PLUS_IMM 1153 else 'SveGatherLoadSVMicroop'), 1154 'MicroOp', 1155 {'tpl_header': tplHeader, 1156 'tpl_args': tplArgs, 1157 'memacc_code': loadMemAccCode, |
1158 'ea_code' : sveEnabledCheckCode + eaCode_load, |
1159 'fault_status_set_code' : faultStatusSetCode, 1160 'fault_status_reset_code' : faultStatusResetCode, 1161 'pred_check_code' : predCheckCode, 1162 'fa_code' : ''}, 1163 ['IsMicroop', 'IsMemRef', 'IsLoad']) 1164 storeIop = InstObjParams('st1', 1165 ('SveScatterStoreVIMicroop' 1166 if indexed_addr_form == IndexedAddrForm.VEC_PLUS_IMM 1167 else 'SveScatterStoreSVMicroop'), 1168 'MicroOp', 1169 {'tpl_header': tplHeader, 1170 'tpl_args': tplArgs, 1171 'memacc_code': storeMemAccCode, |
1172 'ea_code' : sveEnabledCheckCode + eaCode_store, |
1173 'pred_check_code' : predCheckCode, 1174 'fa_code' : ''}, 1175 ['IsMicroop', 'IsMemRef', 'IsStore']) 1176 if indexed_addr_form == IndexedAddrForm.VEC_PLUS_IMM: 1177 header_output += SveIndexedMemVIMicroopDeclare.subst(loadIop) 1178 header_output += SveIndexedMemVIMicroopDeclare.subst(storeIop) 1179 else: 1180 header_output += SveIndexedMemSVMicroopDeclare.subst(loadIop) --- 415 unchanged lines hidden --- |