Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/assembler_x86.hpp @ 6225:2c368ea3e844
7181494: cleanup avx and vectors code
Summary: renamed mach nodes which use scalar AVX instructions, added integer vectors shuffling instructions
Reviewed-by: twisti
author | kvn |
---|---|
date | Mon, 16 Jul 2012 17:10:22 -0700 |
parents | 8c92982cbbc4 |
children | 1d7922586cf6 |
comparison
equal
deleted
inserted
replaced
6224:56c4f88474b3 | 6225:2c368ea3e844 |
---|---|
1464 | 1464 |
1465 // Interleave Low Doublewords | 1465 // Interleave Low Doublewords |
1466 void punpckldq(XMMRegister dst, XMMRegister src); | 1466 void punpckldq(XMMRegister dst, XMMRegister src); |
1467 void punpckldq(XMMRegister dst, Address src); | 1467 void punpckldq(XMMRegister dst, Address src); |
1468 | 1468 |
1469 // Interleave Low Quadwords | |
1470 void punpcklqdq(XMMRegister dst, XMMRegister src); | |
1471 | |
1469 #ifndef _LP64 // no 32bit push/pop on amd64 | 1472 #ifndef _LP64 // no 32bit push/pop on amd64 |
1470 void pushl(Address src); | 1473 void pushl(Address src); |
1471 #endif | 1474 #endif |
1472 | 1475 |
1473 void pushq(Address src); | 1476 void pushq(Address src); |
1604 // Bitwise Logical XOR of Packed Single-Precision Floating-Point Values | 1607 // Bitwise Logical XOR of Packed Single-Precision Floating-Point Values |
1605 void xorps(XMMRegister dst, XMMRegister src); | 1608 void xorps(XMMRegister dst, XMMRegister src); |
1606 | 1609 |
1607 void set_byte_if_not_zero(Register dst); // sets reg to 1 if not zero, otherwise 0 | 1610 void set_byte_if_not_zero(Register dst); // sets reg to 1 if not zero, otherwise 0 |
1608 | 1611 |
1609 // AVX 3-operands instructions (encoded with VEX prefix) | 1612 // AVX 3-operands scalar instructions (encoded with VEX prefix) |
1610 void vaddsd(XMMRegister dst, XMMRegister nds, Address src); | 1613 void vaddsd(XMMRegister dst, XMMRegister nds, Address src); |
1611 void vaddsd(XMMRegister dst, XMMRegister nds, XMMRegister src); | 1614 void vaddsd(XMMRegister dst, XMMRegister nds, XMMRegister src); |
1612 void vaddss(XMMRegister dst, XMMRegister nds, Address src); | 1615 void vaddss(XMMRegister dst, XMMRegister nds, Address src); |
1613 void vaddss(XMMRegister dst, XMMRegister nds, XMMRegister src); | 1616 void vaddss(XMMRegister dst, XMMRegister nds, XMMRegister src); |
1614 void vandpd(XMMRegister dst, XMMRegister nds, Address src); | |
1615 void vandps(XMMRegister dst, XMMRegister nds, Address src); | |
1616 void vdivsd(XMMRegister dst, XMMRegister nds, Address src); | 1617 void vdivsd(XMMRegister dst, XMMRegister nds, Address src); |
1617 void vdivsd(XMMRegister dst, XMMRegister nds, XMMRegister src); | 1618 void vdivsd(XMMRegister dst, XMMRegister nds, XMMRegister src); |
1618 void vdivss(XMMRegister dst, XMMRegister nds, Address src); | 1619 void vdivss(XMMRegister dst, XMMRegister nds, Address src); |
1619 void vdivss(XMMRegister dst, XMMRegister nds, XMMRegister src); | 1620 void vdivss(XMMRegister dst, XMMRegister nds, XMMRegister src); |
1620 void vmulsd(XMMRegister dst, XMMRegister nds, Address src); | 1621 void vmulsd(XMMRegister dst, XMMRegister nds, Address src); |
1623 void vmulss(XMMRegister dst, XMMRegister nds, XMMRegister src); | 1624 void vmulss(XMMRegister dst, XMMRegister nds, XMMRegister src); |
1624 void vsubsd(XMMRegister dst, XMMRegister nds, Address src); | 1625 void vsubsd(XMMRegister dst, XMMRegister nds, Address src); |
1625 void vsubsd(XMMRegister dst, XMMRegister nds, XMMRegister src); | 1626 void vsubsd(XMMRegister dst, XMMRegister nds, XMMRegister src); |
1626 void vsubss(XMMRegister dst, XMMRegister nds, Address src); | 1627 void vsubss(XMMRegister dst, XMMRegister nds, Address src); |
1627 void vsubss(XMMRegister dst, XMMRegister nds, XMMRegister src); | 1628 void vsubss(XMMRegister dst, XMMRegister nds, XMMRegister src); |
1629 | |
1630 // AVX Vector instrucitons. | |
1631 void vandpd(XMMRegister dst, XMMRegister nds, Address src); | |
1632 void vandps(XMMRegister dst, XMMRegister nds, Address src); | |
1628 void vxorpd(XMMRegister dst, XMMRegister nds, Address src); | 1633 void vxorpd(XMMRegister dst, XMMRegister nds, Address src); |
1629 void vxorps(XMMRegister dst, XMMRegister nds, Address src); | 1634 void vxorps(XMMRegister dst, XMMRegister nds, Address src); |
1630 | |
1631 // AVX Vector instrucitons. | |
1632 void vxorpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); | 1635 void vxorpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
1633 void vxorps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); | 1636 void vxorps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
1637 void vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); | |
1634 void vinsertf128h(XMMRegister dst, XMMRegister nds, XMMRegister src); | 1638 void vinsertf128h(XMMRegister dst, XMMRegister nds, XMMRegister src); |
1639 void vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src); | |
1635 | 1640 |
1636 // AVX instruction which is used to clear upper 128 bits of YMM registers and | 1641 // AVX instruction which is used to clear upper 128 bits of YMM registers and |
1637 // to avoid transaction penalty between AVX and SSE states. There is no | 1642 // to avoid transaction penalty between AVX and SSE states. There is no |
1638 // penalty if legacy SSE instructions are encoded using VEX prefix because | 1643 // penalty if legacy SSE instructions are encoded using VEX prefix because |
1639 // they always clear upper 128 bits. It should be used before calling | 1644 // they always clear upper 128 bits. It should be used before calling |
2561 | 2566 |
2562 void vxorps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { Assembler::vxorps(dst, nds, src, vector256); } | 2567 void vxorps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { Assembler::vxorps(dst, nds, src, vector256); } |
2563 void vxorps(XMMRegister dst, XMMRegister nds, Address src) { Assembler::vxorps(dst, nds, src); } | 2568 void vxorps(XMMRegister dst, XMMRegister nds, Address src) { Assembler::vxorps(dst, nds, src); } |
2564 void vxorps(XMMRegister dst, XMMRegister nds, AddressLiteral src); | 2569 void vxorps(XMMRegister dst, XMMRegister nds, AddressLiteral src); |
2565 | 2570 |
2571 void vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { | |
2572 if (UseAVX > 1 || !vector256) // vpxor 256 bit is available only in AVX2 | |
2573 Assembler::vpxor(dst, nds, src, vector256); | |
2574 else | |
2575 Assembler::vxorpd(dst, nds, src, vector256); | |
2576 } | |
2577 | |
2578 // Move packed integer values from low 128 bit to hign 128 bit in 256 bit vector. | |
2579 void vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src) { | |
2580 if (UseAVX > 1) // vinserti128h is available only in AVX2 | |
2581 Assembler::vinserti128h(dst, nds, src); | |
2582 else | |
2583 Assembler::vinsertf128h(dst, nds, src); | |
2584 } | |
2566 | 2585 |
2567 // Data | 2586 // Data |
2568 | 2587 |
2569 void cmov32( Condition cc, Register dst, Address src); | 2588 void cmov32( Condition cc, Register dst, Address src); |
2570 void cmov32( Condition cc, Register dst, Register src); | 2589 void cmov32( Condition cc, Register dst, Register src); |
2612 void mov32(AddressLiteral dst, Register src); | 2631 void mov32(AddressLiteral dst, Register src); |
2613 void mov32(Register dst, AddressLiteral src); | 2632 void mov32(Register dst, AddressLiteral src); |
2614 | 2633 |
2615 // to avoid hiding movb | 2634 // to avoid hiding movb |
2616 void movbyte(ArrayAddress dst, int src); | 2635 void movbyte(ArrayAddress dst, int src); |
2636 | |
2637 // Import other mov() methods from the parent class or else | |
2638 // they will be hidden by the following overriding declaration. | |
2639 using Assembler::movdl; | |
2640 using Assembler::movq; | |
2641 void movdl(XMMRegister dst, AddressLiteral src); | |
2642 void movq(XMMRegister dst, AddressLiteral src); | |
2617 | 2643 |
2618 // Can push value or effective address | 2644 // Can push value or effective address |
2619 void pushptr(AddressLiteral src); | 2645 void pushptr(AddressLiteral src); |
2620 | 2646 |
2621 void pushptr(Address src) { LP64_ONLY(pushq(src)) NOT_LP64(pushl(src)); } | 2647 void pushptr(Address src) { LP64_ONLY(pushq(src)) NOT_LP64(pushl(src)); } |