Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: src/s390/assembler-s390.cc

Issue 2582683002: s390x: implement vector support on s390 (Closed)
Patch Set: fix comments and dchecks Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/s390/assembler-s390.h ('k') | src/s390/constants-s390.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // for facilities. 131 // for facilities.
132 #if V8_HOST_ARCH_S390 132 #if V8_HOST_ARCH_S390
133 if (performSTFLE) { 133 if (performSTFLE) {
134 // STFLE D(B) requires: 134 // STFLE D(B) requires:
135 // GPR0 to specify # of double words to update minus 1. 135 // GPR0 to specify # of double words to update minus 1.
136 // i.e. GPR0 = 0 for 1 doubleword 136 // i.e. GPR0 = 0 for 1 doubleword
137 // D(B) to specify to memory location to store the facilities bits 137 // D(B) to specify to memory location to store the facilities bits
138 // The facilities we are checking for are: 138 // The facilities we are checking for are:
139 // Bit 45 - Distinct Operands for instructions like ARK, SRK, etc. 139 // Bit 45 - Distinct Operands for instructions like ARK, SRK, etc.
140 // As such, we require only 1 double word 140 // As such, we require only 1 double word
141 int64_t facilities[1]; 141 int64_t facilities[3] = {0L};
142 facilities[0] = 0;
143 // LHI sets up GPR0 142 // LHI sets up GPR0
144 // STFLE is specified as .insn, as opcode is not recognized. 143 // STFLE is specified as .insn, as opcode is not recognized.
145 // We register the instructions kill r0 (LHI) and the CC (STFLE). 144 // We register the instructions kill r0 (LHI) and the CC (STFLE).
146 asm volatile( 145 asm volatile(
147 "lhi 0,0\n" 146 "lhi 0,2\n"
148 ".insn s,0xb2b00000,%0\n" 147 ".insn s,0xb2b00000,%0\n"
149 : "=Q"(facilities) 148 : "=Q"(facilities)
150 : 149 :
151 : "cc", "r0"); 150 : "cc", "r0");
152 151
152 uint64_t one = static_cast<uint64_t>(1);
153 // Test for Distinct Operands Facility - Bit 45 153 // Test for Distinct Operands Facility - Bit 45
154 if (facilities[0] & (1lu << (63 - 45))) { 154 if (facilities[0] & (one << (63 - 45))) {
155 supported_ |= (1u << DISTINCT_OPS); 155 supported_ |= (1u << DISTINCT_OPS);
156 } 156 }
157 // Test for General Instruction Extension Facility - Bit 34 157 // Test for General Instruction Extension Facility - Bit 34
158 if (facilities[0] & (1lu << (63 - 34))) { 158 if (facilities[0] & (one << (63 - 34))) {
159 supported_ |= (1u << GENERAL_INSTR_EXT); 159 supported_ |= (1u << GENERAL_INSTR_EXT);
160 } 160 }
161 // Test for Floating Point Extension Facility - Bit 37 161 // Test for Floating Point Extension Facility - Bit 37
162 if (facilities[0] & (1lu << (63 - 37))) { 162 if (facilities[0] & (one << (63 - 37))) {
163 supported_ |= (1u << FLOATING_POINT_EXT); 163 supported_ |= (1u << FLOATING_POINT_EXT);
164 } 164 }
165 // Test for Vector Facility - Bit 129
166 if (facilities[2] & (one << (63 - (129 - 128)))) {
167 supported_ |= (1u << VECTOR_FACILITY);
168 }
165 } 169 }
166 #else 170 #else
167 // All distinct ops instructions can be simulated 171 // All distinct ops instructions can be simulated
168 supported_ |= (1u << DISTINCT_OPS); 172 supported_ |= (1u << DISTINCT_OPS);
169 // RISBG can be simulated 173 // RISBG can be simulated
170 supported_ |= (1u << GENERAL_INSTR_EXT); 174 supported_ |= (1u << GENERAL_INSTR_EXT);
171 175
172 supported_ |= (1u << FLOATING_POINT_EXT); 176 supported_ |= (1u << FLOATING_POINT_EXT);
173 USE(performSTFLE); // To avoid assert 177 USE(performSTFLE); // To avoid assert
178 supported_ |= (1u << VECTOR_FACILITY);
174 #endif 179 #endif
175 supported_ |= (1u << FPU); 180 supported_ |= (1u << FPU);
176 } 181 }
177 182
178 void CpuFeatures::PrintTarget() { 183 void CpuFeatures::PrintTarget() {
179 const char* s390_arch = NULL; 184 const char* s390_arch = NULL;
180 185
181 #if V8_TARGET_ARCH_S390X 186 #if V8_TARGET_ARCH_S390X
182 s390_arch = "s390x"; 187 s390_arch = "s390x";
183 #else 188 #else
184 s390_arch = "s390"; 189 s390_arch = "s390";
185 #endif 190 #endif
186 191
187 printf("target %s\n", s390_arch); 192 printf("target %s\n", s390_arch);
188 } 193 }
189 194
190 void CpuFeatures::PrintFeatures() { 195 void CpuFeatures::PrintFeatures() {
191 printf("FPU=%d\n", CpuFeatures::IsSupported(FPU)); 196 printf("FPU=%d\n", CpuFeatures::IsSupported(FPU));
192 printf("FPU_EXT=%d\n", CpuFeatures::IsSupported(FLOATING_POINT_EXT)); 197 printf("FPU_EXT=%d\n", CpuFeatures::IsSupported(FLOATING_POINT_EXT));
193 printf("GENERAL_INSTR=%d\n", CpuFeatures::IsSupported(GENERAL_INSTR_EXT)); 198 printf("GENERAL_INSTR=%d\n", CpuFeatures::IsSupported(GENERAL_INSTR_EXT));
194 printf("DISTINCT_OPS=%d\n", CpuFeatures::IsSupported(DISTINCT_OPS)); 199 printf("DISTINCT_OPS=%d\n", CpuFeatures::IsSupported(DISTINCT_OPS));
200 printf("VECTOR_FACILITY=%d\n", CpuFeatures::IsSupported(VECTOR_FACILITY));
195 } 201 }
196 202
197 Register ToRegister(int num) { 203 Register ToRegister(int num) {
198 DCHECK(num >= 0 && num < kNumRegisters); 204 DCHECK(num >= 0 && num < kNumRegisters);
199 const Register kRegisters[] = {r0, r1, r2, r3, r4, r5, r6, r7, 205 const Register kRegisters[] = {r0, r1, r2, r3, r4, r5, r6, r7,
200 r8, r9, r10, fp, ip, r13, r14, sp}; 206 r8, r9, r10, fp, ip, r13, r14, sp};
201 return kRegisters[num]; 207 return kRegisters[num];
202 } 208 }
203 209
204 // ----------------------------------------------------------------------------- 210 // -----------------------------------------------------------------------------
(...skipping 2938 matching lines...) Expand 10 before | Expand all | Expand 10 after
3143 SKIP_ICACHE_FLUSH); 3149 SKIP_ICACHE_FLUSH);
3144 } 3150 }
3145 3151
3146 reloc_info_writer.Write(&rinfo); 3152 reloc_info_writer.Write(&rinfo);
3147 } 3153 }
3148 } 3154 }
3149 3155
3150 } // namespace internal 3156 } // namespace internal
3151 } // namespace v8 3157 } // namespace v8
3152 #endif // V8_TARGET_ARCH_S390 3158 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/s390/assembler-s390.h ('k') | src/s390/constants-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698