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

Side by Side Diff: src/ia32/assembler-ia32.h

Issue 90643003: Experimental implementation: Exposing SIMD instructions into JavaScript Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-representation-changes.cc ('k') | src/ia32/assembler-ia32.cc » ('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 are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 "xmm3", 212 "xmm3",
213 "xmm4", 213 "xmm4",
214 "xmm5", 214 "xmm5",
215 "xmm6", 215 "xmm6",
216 "xmm7" 216 "xmm7"
217 }; 217 };
218 return names[index]; 218 return names[index];
219 } 219 }
220 }; 220 };
221 221
222 typedef XMMRegister Float32x4Register;
223 typedef XMMRegister Int32x4Register;
222 224
223 #define xmm0 (static_cast<const XMMRegister&>(double_register_0)) 225 #define xmm0 (static_cast<const XMMRegister&>(double_register_0))
224 #define xmm1 (static_cast<const XMMRegister&>(double_register_1)) 226 #define xmm1 (static_cast<const XMMRegister&>(double_register_1))
225 #define xmm2 (static_cast<const XMMRegister&>(double_register_2)) 227 #define xmm2 (static_cast<const XMMRegister&>(double_register_2))
226 #define xmm3 (static_cast<const XMMRegister&>(double_register_3)) 228 #define xmm3 (static_cast<const XMMRegister&>(double_register_3))
227 #define xmm4 (static_cast<const XMMRegister&>(double_register_4)) 229 #define xmm4 (static_cast<const XMMRegister&>(double_register_4))
228 #define xmm5 (static_cast<const XMMRegister&>(double_register_5)) 230 #define xmm5 (static_cast<const XMMRegister&>(double_register_5))
229 #define xmm6 (static_cast<const XMMRegister&>(double_register_6)) 231 #define xmm6 (static_cast<const XMMRegister&>(double_register_6))
230 #define xmm7 (static_cast<const XMMRegister&>(double_register_7)) 232 #define xmm7 (static_cast<const XMMRegister&>(double_register_7))
231 #define no_xmm_reg (static_cast<const XMMRegister&>(no_double_reg)) 233 #define no_xmm_reg (static_cast<const XMMRegister&>(no_double_reg))
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 times_twice_pointer_size = times_8 385 times_twice_pointer_size = times_8
384 }; 386 };
385 387
386 388
387 class Operand BASE_EMBEDDED { 389 class Operand BASE_EMBEDDED {
388 public: 390 public:
389 // XMM reg 391 // XMM reg
390 INLINE(explicit Operand(XMMRegister xmm_reg)); 392 INLINE(explicit Operand(XMMRegister xmm_reg));
391 393
392 // [disp/r] 394 // [disp/r]
393 INLINE(explicit Operand(int32_t disp, RelocInfo::Mode rmode)); 395 INLINE(explicit Operand(int32_t disp,
396 RelocInfo::Mode rmode = RelocInfo::NONE32));
394 // disp only must always be relocated 397 // disp only must always be relocated
395 398
396 // [base + disp/r] 399 // [base + disp/r]
397 explicit Operand(Register base, int32_t disp, 400 explicit Operand(Register base, int32_t disp,
398 RelocInfo::Mode rmode = RelocInfo::NONE32); 401 RelocInfo::Mode rmode = RelocInfo::NONE32);
399 402
400 // [base + index*scale + disp/r] 403 // [base + index*scale + disp/r]
401 explicit Operand(Register base, 404 explicit Operand(Register base,
402 Register index, 405 Register index,
403 ScaleFactor scale, 406 ScaleFactor scale,
404 int32_t disp, 407 int32_t disp,
405 RelocInfo::Mode rmode = RelocInfo::NONE32); 408 RelocInfo::Mode rmode = RelocInfo::NONE32);
406 409
407 // [index*scale + disp/r] 410 // [index*scale + disp/r]
408 explicit Operand(Register index, 411 explicit Operand(Register index,
409 ScaleFactor scale, 412 ScaleFactor scale,
410 int32_t disp, 413 int32_t disp,
411 RelocInfo::Mode rmode = RelocInfo::NONE32); 414 RelocInfo::Mode rmode = RelocInfo::NONE32);
412 415
416 // Offset from existing memory operand.
417 // Offset is added to existing displacement as 32-bit signed values and
418 // this must not overflow.
419 Operand(const Operand& base, int32_t offset);
420
413 static Operand StaticVariable(const ExternalReference& ext) { 421 static Operand StaticVariable(const ExternalReference& ext) {
414 return Operand(reinterpret_cast<int32_t>(ext.address()), 422 return Operand(reinterpret_cast<int32_t>(ext.address()),
415 RelocInfo::EXTERNAL_REFERENCE); 423 RelocInfo::EXTERNAL_REFERENCE);
416 } 424 }
417 425
418 static Operand StaticArray(Register index, 426 static Operand StaticArray(Register index,
419 ScaleFactor scale, 427 ScaleFactor scale,
420 const ExternalReference& arr) { 428 const ExternalReference& arr) {
421 return Operand(index, scale, reinterpret_cast<int32_t>(arr.address()), 429 return Operand(index, scale, reinterpret_cast<int32_t>(arr.address()),
422 RelocInfo::EXTERNAL_REFERENCE); 430 RelocInfo::EXTERNAL_REFERENCE);
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 void frndint(); 1015 void frndint();
1008 1016
1009 void sahf(); 1017 void sahf();
1010 void setcc(Condition cc, Register reg); 1018 void setcc(Condition cc, Register reg);
1011 1019
1012 void cpuid(); 1020 void cpuid();
1013 1021
1014 // SSE instructions 1022 // SSE instructions
1015 void movaps(XMMRegister dst, XMMRegister src); 1023 void movaps(XMMRegister dst, XMMRegister src);
1016 void shufps(XMMRegister dst, XMMRegister src, byte imm8); 1024 void shufps(XMMRegister dst, XMMRegister src, byte imm8);
1025 void movups(XMMRegister dst, const Operand& src);
1026 void movups(const Operand& dst, XMMRegister src);
1017 1027
1018 void andps(XMMRegister dst, const Operand& src); 1028 void andps(XMMRegister dst, const Operand& src);
1019 void andps(XMMRegister dst, XMMRegister src) { andps(dst, Operand(src)); } 1029 void andps(XMMRegister dst, XMMRegister src) { andps(dst, Operand(src)); }
1020 void xorps(XMMRegister dst, const Operand& src); 1030 void xorps(XMMRegister dst, const Operand& src);
1021 void xorps(XMMRegister dst, XMMRegister src) { xorps(dst, Operand(src)); } 1031 void xorps(XMMRegister dst, XMMRegister src) { xorps(dst, Operand(src)); }
1022 void orps(XMMRegister dst, const Operand& src); 1032 void orps(XMMRegister dst, const Operand& src);
1023 void orps(XMMRegister dst, XMMRegister src) { orps(dst, Operand(src)); } 1033 void orps(XMMRegister dst, XMMRegister src) { orps(dst, Operand(src)); }
1024 1034
1025 void addps(XMMRegister dst, const Operand& src); 1035 void addps(XMMRegister dst, const Operand& src);
1026 void addps(XMMRegister dst, XMMRegister src) { addps(dst, Operand(src)); } 1036 void addps(XMMRegister dst, XMMRegister src) { addps(dst, Operand(src)); }
1027 void subps(XMMRegister dst, const Operand& src); 1037 void subps(XMMRegister dst, const Operand& src);
1028 void subps(XMMRegister dst, XMMRegister src) { subps(dst, Operand(src)); } 1038 void subps(XMMRegister dst, XMMRegister src) { subps(dst, Operand(src)); }
1029 void mulps(XMMRegister dst, const Operand& src); 1039 void mulps(XMMRegister dst, const Operand& src);
1030 void mulps(XMMRegister dst, XMMRegister src) { mulps(dst, Operand(src)); } 1040 void mulps(XMMRegister dst, XMMRegister src) { mulps(dst, Operand(src)); }
1031 void divps(XMMRegister dst, const Operand& src); 1041 void divps(XMMRegister dst, const Operand& src);
1032 void divps(XMMRegister dst, XMMRegister src) { divps(dst, Operand(src)); } 1042 void divps(XMMRegister dst, XMMRegister src) { divps(dst, Operand(src)); }
1043 void minps(XMMRegister dst, XMMRegister src) { minps(dst, Operand(src)); }
1044 void minps(XMMRegister dst, const Operand& src);
1045 void maxps(XMMRegister dst, XMMRegister src) { maxps(dst, Operand(src)); }
1046 void maxps(XMMRegister dst, const Operand& src);
1047 void rcpps(XMMRegister dst, XMMRegister src) { rcpps(dst, Operand(src)); }
1048 void rcpps(XMMRegister dst, const Operand& src);
1049 void rsqrtps(XMMRegister dst, XMMRegister src) { rsqrtps(dst, Operand(src)); }
1050 void rsqrtps(XMMRegister dst, const Operand& src);
1051 void sqrtps(XMMRegister dst, XMMRegister src) { sqrtps(dst, Operand(src)); }
1052 void sqrtps(XMMRegister dst, const Operand& src);
1053
1054 void cvtdq2ps(XMMRegister dst, const Operand& src);
1055 void cmpps(XMMRegister dst, XMMRegister src, int8_t cmp);
1056 void cmpeqps(XMMRegister dst, XMMRegister src);
1057 void cmpltps(XMMRegister dst, XMMRegister src);
1058 void cmpleps(XMMRegister dst, XMMRegister src);
1059 void cmpneqps(XMMRegister dst, XMMRegister src);
1060 void cmpnltps(XMMRegister dst, XMMRegister src);
1061 void cmpnleps(XMMRegister dst, XMMRegister src);
1062
1063 // SSE 2, introduced by SIMD
1064 void paddd(XMMRegister dst, XMMRegister src) { paddd(dst, Operand(src)); }
1065 void paddd(XMMRegister dst, const Operand& src);
1066 void psubd(XMMRegister dst, XMMRegister src) { psubd(dst, Operand(src)); }
1067 void psubd(XMMRegister dst, const Operand& src);
1068 void pmuludq(XMMRegister dst, XMMRegister src) { pmuludq(dst, Operand(src)); }
1069 void pmuludq(XMMRegister dst, const Operand& src);
1070 void punpackldq(XMMRegister dst, XMMRegister src) {
1071 punpackldq(dst, Operand(src));
1072 }
1073 void punpackldq(XMMRegister dst, const Operand& src);
1074 void cvtps2dq(XMMRegister dst, XMMRegister src) {
1075 cvtps2dq(dst, Operand(src));
1076 }
1077 void cvtps2dq(XMMRegister dst, const Operand& src);
1078 void cvtdq2ps(XMMRegister dst, XMMRegister src) {
1079 cvtdq2ps(dst, Operand(src));
1080 }
1081 // SSE 4.1, introduced by SIMD
1082 void insertps(XMMRegister dst, XMMRegister src, byte imm8);
1083 void pmulld(XMMRegister dst, XMMRegister src) { pmulld(dst, Operand(src)); }
1084 void pmulld(XMMRegister dst, const Operand& src);
1033 1085
1034 // SSE2 instructions 1086 // SSE2 instructions
1035 void cvttss2si(Register dst, const Operand& src); 1087 void cvttss2si(Register dst, const Operand& src);
1036 void cvttss2si(Register dst, XMMRegister src) { 1088 void cvttss2si(Register dst, XMMRegister src) {
1037 cvttss2si(dst, Operand(src)); 1089 cvttss2si(dst, Operand(src));
1038 } 1090 }
1039 void cvttsd2si(Register dst, const Operand& src); 1091 void cvttsd2si(Register dst, const Operand& src);
1040 void cvtsd2si(Register dst, XMMRegister src); 1092 void cvtsd2si(Register dst, XMMRegister src);
1041 1093
1042 void cvtsi2sd(XMMRegister dst, Register src) { cvtsi2sd(dst, Operand(src)); } 1094 void cvtsi2sd(XMMRegister dst, Register src) { cvtsi2sd(dst, Operand(src)); }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 private: 1319 private:
1268 Assembler* assembler_; 1320 Assembler* assembler_;
1269 #ifdef DEBUG 1321 #ifdef DEBUG
1270 int space_before_; 1322 int space_before_;
1271 #endif 1323 #endif
1272 }; 1324 };
1273 1325
1274 } } // namespace v8::internal 1326 } } // namespace v8::internal
1275 1327
1276 #endif // V8_IA32_ASSEMBLER_IA32_H_ 1328 #endif // V8_IA32_ASSEMBLER_IA32_H_
OLDNEW
« no previous file with comments | « src/hydrogen-representation-changes.cc ('k') | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698