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

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

Issue 44153002: Introduce andps for IA32/X64 (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 1 month 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
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 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 void fptan(); 1339 void fptan();
1340 void fyl2x(); 1340 void fyl2x();
1341 void f2xm1(); 1341 void f2xm1();
1342 void fscale(); 1342 void fscale();
1343 void fninit(); 1343 void fninit();
1344 1344
1345 void frndint(); 1345 void frndint();
1346 1346
1347 void sahf(); 1347 void sahf();
1348 1348
1349 // SSE instructions
1350 void movaps(XMMRegister dst, XMMRegister src);
1351 void movss(XMMRegister dst, const Operand& src);
1352 void movss(const Operand& dst, XMMRegister src);
1353
1354 void cvttss2si(Register dst, const Operand& src);
1355 void cvttss2si(Register dst, XMMRegister src);
1356 void cvtlsi2ss(XMMRegister dst, Register src);
1357
1358 void xorps(XMMRegister dst, XMMRegister src);
1359 void andps(XMMRegister dst, XMMRegister src);
1360
1361 void movmskps(Register dst, XMMRegister src);
1362
1349 // SSE2 instructions 1363 // SSE2 instructions
1350 void movd(XMMRegister dst, Register src); 1364 void movd(XMMRegister dst, Register src);
1351 void movd(Register dst, XMMRegister src); 1365 void movd(Register dst, XMMRegister src);
1352 void movq(XMMRegister dst, Register src); 1366 void movq(XMMRegister dst, Register src);
1353 void movq(Register dst, XMMRegister src); 1367 void movq(Register dst, XMMRegister src);
1354 void movq(XMMRegister dst, XMMRegister src); 1368 void movq(XMMRegister dst, XMMRegister src);
1355 void extractps(Register dst, XMMRegister src, byte imm8);
1356 1369
1357 // Don't use this unless it's important to keep the 1370 // Don't use this unless it's important to keep the
1358 // top half of the destination register unchanged. 1371 // top half of the destination register unchanged.
1359 // Used movaps when moving double values and movq for integer 1372 // Used movaps when moving double values and movq for integer
1360 // values in xmm registers. 1373 // values in xmm registers.
1361 void movsd(XMMRegister dst, XMMRegister src); 1374 void movsd(XMMRegister dst, XMMRegister src);
1362 1375
1363 void movsd(const Operand& dst, XMMRegister src); 1376 void movsd(const Operand& dst, XMMRegister src);
1364 void movsd(XMMRegister dst, const Operand& src); 1377 void movsd(XMMRegister dst, const Operand& src);
1365 1378
1366 void movdqa(const Operand& dst, XMMRegister src); 1379 void movdqa(const Operand& dst, XMMRegister src);
1367 void movdqa(XMMRegister dst, const Operand& src); 1380 void movdqa(XMMRegister dst, const Operand& src);
1368 1381
1369 void movdqu(const Operand& dst, XMMRegister src); 1382 void movdqu(const Operand& dst, XMMRegister src);
1370 void movdqu(XMMRegister dst, const Operand& src); 1383 void movdqu(XMMRegister dst, const Operand& src);
1371 1384
1372 void movapd(XMMRegister dst, XMMRegister src); 1385 void movapd(XMMRegister dst, XMMRegister src);
1373 void movaps(XMMRegister dst, XMMRegister src);
1374 1386
1375 void movss(XMMRegister dst, const Operand& src);
1376 void movss(const Operand& dst, XMMRegister src);
1377
1378 void cvttss2si(Register dst, const Operand& src);
1379 void cvttss2si(Register dst, XMMRegister src);
1380 void cvttsd2si(Register dst, const Operand& src); 1387 void cvttsd2si(Register dst, const Operand& src);
1381 void cvttsd2si(Register dst, XMMRegister src); 1388 void cvttsd2si(Register dst, XMMRegister src);
1382 void cvttsd2siq(Register dst, XMMRegister src); 1389 void cvttsd2siq(Register dst, XMMRegister src);
1383 1390
1384 void cvtlsi2sd(XMMRegister dst, const Operand& src); 1391 void cvtlsi2sd(XMMRegister dst, const Operand& src);
1385 void cvtlsi2sd(XMMRegister dst, Register src); 1392 void cvtlsi2sd(XMMRegister dst, Register src);
1386 void cvtqsi2sd(XMMRegister dst, const Operand& src); 1393 void cvtqsi2sd(XMMRegister dst, const Operand& src);
1387 void cvtqsi2sd(XMMRegister dst, Register src); 1394 void cvtqsi2sd(XMMRegister dst, Register src);
1388 1395
1389 void cvtlsi2ss(XMMRegister dst, Register src);
1390 1396
1391 void cvtss2sd(XMMRegister dst, XMMRegister src); 1397 void cvtss2sd(XMMRegister dst, XMMRegister src);
1392 void cvtss2sd(XMMRegister dst, const Operand& src); 1398 void cvtss2sd(XMMRegister dst, const Operand& src);
1393 void cvtsd2ss(XMMRegister dst, XMMRegister src); 1399 void cvtsd2ss(XMMRegister dst, XMMRegister src);
1394 1400
1395 void cvtsd2si(Register dst, XMMRegister src); 1401 void cvtsd2si(Register dst, XMMRegister src);
1396 void cvtsd2siq(Register dst, XMMRegister src); 1402 void cvtsd2siq(Register dst, XMMRegister src);
1397 1403
1398 void addsd(XMMRegister dst, XMMRegister src); 1404 void addsd(XMMRegister dst, XMMRegister src);
1399 void addsd(XMMRegister dst, const Operand& src); 1405 void addsd(XMMRegister dst, const Operand& src);
1400 void subsd(XMMRegister dst, XMMRegister src); 1406 void subsd(XMMRegister dst, XMMRegister src);
1401 void mulsd(XMMRegister dst, XMMRegister src); 1407 void mulsd(XMMRegister dst, XMMRegister src);
1402 void mulsd(XMMRegister dst, const Operand& src); 1408 void mulsd(XMMRegister dst, const Operand& src);
1403 void divsd(XMMRegister dst, XMMRegister src); 1409 void divsd(XMMRegister dst, XMMRegister src);
1404 1410
1405 void andpd(XMMRegister dst, XMMRegister src); 1411 void andpd(XMMRegister dst, XMMRegister src);
1406 void orpd(XMMRegister dst, XMMRegister src); 1412 void orpd(XMMRegister dst, XMMRegister src);
1407 void xorpd(XMMRegister dst, XMMRegister src); 1413 void xorpd(XMMRegister dst, XMMRegister src);
1408 void xorps(XMMRegister dst, XMMRegister src);
1409 void sqrtsd(XMMRegister dst, XMMRegister src); 1414 void sqrtsd(XMMRegister dst, XMMRegister src);
1410 1415
1411 void ucomisd(XMMRegister dst, XMMRegister src); 1416 void ucomisd(XMMRegister dst, XMMRegister src);
1412 void ucomisd(XMMRegister dst, const Operand& src); 1417 void ucomisd(XMMRegister dst, const Operand& src);
1418 void cmpltsd(XMMRegister dst, XMMRegister src);
1419
1420 void movmskpd(Register dst, XMMRegister src);
1421
1422 // SSE 4.1 instruction
1423 void extractps(Register dst, XMMRegister src, byte imm8);
1413 1424
1414 enum RoundingMode { 1425 enum RoundingMode {
1415 kRoundToNearest = 0x0, 1426 kRoundToNearest = 0x0,
1416 kRoundDown = 0x1, 1427 kRoundDown = 0x1,
1417 kRoundUp = 0x2, 1428 kRoundUp = 0x2,
1418 kRoundToZero = 0x3 1429 kRoundToZero = 0x3
1419 }; 1430 };
1420 1431
1421 void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode); 1432 void roundsd(XMMRegister dst, XMMRegister src, RoundingMode mode);
1422 1433
1423 void movmskpd(Register dst, XMMRegister src);
1424 void movmskps(Register dst, XMMRegister src);
1425
1426 void cmpltsd(XMMRegister dst, XMMRegister src);
1427
1428 // The first argument is the reg field, the second argument is the r/m field.
1429 void emit_sse_operand(XMMRegister dst, XMMRegister src);
1430 void emit_sse_operand(XMMRegister reg, const Operand& adr);
1431 void emit_sse_operand(XMMRegister dst, Register src);
1432 void emit_sse_operand(Register dst, XMMRegister src);
1433
1434 // Debugging 1434 // Debugging
1435 void Print(); 1435 void Print();
1436 1436
1437 // Check the code size generated from label to here. 1437 // Check the code size generated from label to here.
1438 int SizeOfCodeGeneratedSince(Label* label) { 1438 int SizeOfCodeGeneratedSince(Label* label) {
1439 return pc_offset() - label->pos(); 1439 return pc_offset() - label->pos();
1440 } 1440 }
1441 1441
1442 // Mark address of the ExitJSFrame code. 1442 // Mark address of the ExitJSFrame code.
1443 void RecordJSReturn(); 1443 void RecordJSReturn();
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 // Emit a ModR/M byte with an operation subcode in the reg field and 1604 // Emit a ModR/M byte with an operation subcode in the reg field and
1605 // a register in the rm_reg field. 1605 // a register in the rm_reg field.
1606 void emit_modrm(int code, Register rm_reg) { 1606 void emit_modrm(int code, Register rm_reg) {
1607 ASSERT(is_uint3(code)); 1607 ASSERT(is_uint3(code));
1608 emit(0xC0 | code << 3 | rm_reg.low_bits()); 1608 emit(0xC0 | code << 3 | rm_reg.low_bits());
1609 } 1609 }
1610 1610
1611 // Emit the code-object-relative offset of the label's position 1611 // Emit the code-object-relative offset of the label's position
1612 inline void emit_code_relative_offset(Label* label); 1612 inline void emit_code_relative_offset(Label* label);
1613 1613
1614 // The first argument is the reg field, the second argument is the r/m field.
1615 void emit_sse_operand(XMMRegister dst, XMMRegister src);
1616 void emit_sse_operand(XMMRegister reg, const Operand& adr);
1617 void emit_sse_operand(XMMRegister dst, Register src);
1618 void emit_sse_operand(Register dst, XMMRegister src);
1619
1614 // Emit machine code for one of the operations ADD, ADC, SUB, SBC, 1620 // Emit machine code for one of the operations ADD, ADC, SUB, SBC,
1615 // AND, OR, XOR, or CMP. The encodings of these operations are all 1621 // AND, OR, XOR, or CMP. The encodings of these operations are all
1616 // similar, differing just in the opcode or in the reg field of the 1622 // similar, differing just in the opcode or in the reg field of the
1617 // ModR/M byte. 1623 // ModR/M byte.
1618 void arithmetic_op_16(byte opcode, Register reg, Register rm_reg); 1624 void arithmetic_op_16(byte opcode, Register reg, Register rm_reg);
1619 void arithmetic_op_16(byte opcode, Register reg, const Operand& rm_reg); 1625 void arithmetic_op_16(byte opcode, Register reg, const Operand& rm_reg);
1620 void arithmetic_op_32(byte opcode, Register reg, Register rm_reg); 1626 void arithmetic_op_32(byte opcode, Register reg, Register rm_reg);
1621 void arithmetic_op_32(byte opcode, Register reg, const Operand& rm_reg); 1627 void arithmetic_op_32(byte opcode, Register reg, const Operand& rm_reg);
1622 void arithmetic_op(byte opcode, Register reg, Register rm_reg); 1628 void arithmetic_op(byte opcode, Register reg, Register rm_reg);
1623 void arithmetic_op(byte opcode, Register reg, const Operand& rm_reg); 1629 void arithmetic_op(byte opcode, Register reg, const Operand& rm_reg);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 private: 1704 private:
1699 Assembler* assembler_; 1705 Assembler* assembler_;
1700 #ifdef DEBUG 1706 #ifdef DEBUG
1701 int space_before_; 1707 int space_before_;
1702 #endif 1708 #endif
1703 }; 1709 };
1704 1710
1705 } } // namespace v8::internal 1711 } } // namespace v8::internal
1706 1712
1707 #endif // V8_X64_ASSEMBLER_X64_H_ 1713 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698