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

Side by Side Diff: test/cctest/test-assembler-arm.cc

Issue 2649323012: [ARM] Add Neon saturating add and subtract instructions. (Closed)
Patch Set: Add static_asserts on Widen, Clamp. Created 3 years, 10 months 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/arm/simulator-arm.cc ('k') | test/cctest/test-disasm-arm.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 float vcvt_f32_s32[4], vcvt_f32_u32[4]; 1292 float vcvt_f32_s32[4], vcvt_f32_u32[4];
1293 uint32_t vdup8[4], vdup16[4], vdup32[4]; 1293 uint32_t vdup8[4], vdup16[4], vdup32[4];
1294 float vabsf[4], vnegf[4]; 1294 float vabsf[4], vnegf[4];
1295 uint32_t vabs_s8[4], vabs_s16[4], vabs_s32[4]; 1295 uint32_t vabs_s8[4], vabs_s16[4], vabs_s32[4];
1296 uint32_t vneg_s8[4], vneg_s16[4], vneg_s32[4]; 1296 uint32_t vneg_s8[4], vneg_s16[4], vneg_s32[4];
1297 uint32_t veor[4], vand[4], vorr[4]; 1297 uint32_t veor[4], vand[4], vorr[4];
1298 float vdupf[4], vaddf[4], vsubf[4], vmulf[4]; 1298 float vdupf[4], vaddf[4], vsubf[4], vmulf[4];
1299 uint32_t vmin_s8[4], vmin_u16[4], vmin_s32[4]; 1299 uint32_t vmin_s8[4], vmin_u16[4], vmin_s32[4];
1300 uint32_t vmax_s8[4], vmax_u16[4], vmax_s32[4]; 1300 uint32_t vmax_s8[4], vmax_u16[4], vmax_s32[4];
1301 uint32_t vadd8[4], vadd16[4], vadd32[4]; 1301 uint32_t vadd8[4], vadd16[4], vadd32[4];
1302 uint32_t vqadd_s8[4], vqadd_u16[4], vqadd_s32[4];
1302 uint32_t vsub8[4], vsub16[4], vsub32[4]; 1303 uint32_t vsub8[4], vsub16[4], vsub32[4];
1304 uint32_t vqsub_u8[4], vqsub_s16[4], vqsub_u32[4];
1303 uint32_t vmul8[4], vmul16[4], vmul32[4]; 1305 uint32_t vmul8[4], vmul16[4], vmul32[4];
1304 uint32_t vshl8[4], vshl16[4], vshl32[5]; 1306 uint32_t vshl8[4], vshl16[4], vshl32[5];
1305 uint32_t vshr_s8[4], vshr_u16[4], vshr_s32[5]; 1307 uint32_t vshr_s8[4], vshr_u16[4], vshr_s32[5];
1306 uint32_t vceq[4], vceqf[4], vcgef[4], vcgtf[4]; 1308 uint32_t vceq[4], vceqf[4], vcgef[4], vcgtf[4];
1307 uint32_t vcge_s8[4], vcge_u16[4], vcge_s32[4]; 1309 uint32_t vcge_s8[4], vcge_u16[4], vcge_s32[4];
1308 uint32_t vcgt_s8[4], vcgt_u16[4], vcgt_s32[4]; 1310 uint32_t vcgt_s8[4], vcgt_u16[4], vcgt_s32[4];
1309 float vrecpe[4], vrecps[4], vrsqrte[4], vrsqrts[4]; 1311 float vrecpe[4], vrecps[4], vrsqrte[4], vrsqrts[4];
1310 float vminf[4], vmaxf[4]; 1312 float vminf[4], vmaxf[4];
1311 uint32_t vtst[4], vbsl[4]; 1313 uint32_t vtst[4], vbsl[4];
1312 uint32_t vext[4]; 1314 uint32_t vext[4];
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd16)))); 1628 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd16))));
1627 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); 1629 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1628 __ mov(r4, Operand(0x80000001)); 1630 __ mov(r4, Operand(0x80000001));
1629 __ vdup(Neon32, q0, r4); 1631 __ vdup(Neon32, q0, r4);
1630 __ mov(r4, Operand(0x80000002)); 1632 __ mov(r4, Operand(0x80000002));
1631 __ vdup(Neon32, q1, r4); 1633 __ vdup(Neon32, q1, r4);
1632 __ vadd(Neon32, q1, q1, q0); 1634 __ vadd(Neon32, q1, q1, q0);
1633 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd32)))); 1635 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vadd32))));
1634 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); 1636 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1635 1637
1638 // vqadd.
1639 __ mov(r4, Operand(0x81));
1640 __ vdup(Neon8, q0, r4);
1641 __ mov(r4, Operand(0x82));
1642 __ vdup(Neon8, q1, r4);
1643 __ vqadd(NeonS8, q1, q1, q0);
1644 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vqadd_s8))));
1645 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1646 __ mov(r4, Operand(0x8000));
1647 __ vdup(Neon16, q0, r4);
1648 __ vdup(Neon16, q1, r4);
1649 __ vqadd(NeonU16, q1, q1, q0);
1650 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vqadd_u16))));
1651 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1652 __ mov(r4, Operand(0x80000001));
1653 __ vdup(Neon32, q0, r4);
1654 __ mov(r4, Operand(0x80000002));
1655 __ vdup(Neon32, q1, r4);
1656 __ vqadd(NeonS32, q1, q1, q0);
1657 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vqadd_s32))));
1658 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1659
1636 // vsub (integer). 1660 // vsub (integer).
1637 __ mov(r4, Operand(0x01)); 1661 __ mov(r4, Operand(0x01));
1638 __ vdup(Neon8, q0, r4); 1662 __ vdup(Neon8, q0, r4);
1639 __ mov(r4, Operand(0x03)); 1663 __ mov(r4, Operand(0x03));
1640 __ vdup(Neon8, q1, r4); 1664 __ vdup(Neon8, q1, r4);
1641 __ vsub(Neon8, q1, q0, q1); 1665 __ vsub(Neon8, q1, q0, q1);
1642 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub8)))); 1666 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub8))));
1643 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); 1667 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1644 __ mov(r4, Operand(0x0001)); 1668 __ mov(r4, Operand(0x0001));
1645 __ vdup(Neon16, q0, r4); 1669 __ vdup(Neon16, q0, r4);
1646 __ mov(r4, Operand(0x0003)); 1670 __ mov(r4, Operand(0x0003));
1647 __ vdup(Neon16, q1, r4); 1671 __ vdup(Neon16, q1, r4);
1648 __ vsub(Neon16, q1, q0, q1); 1672 __ vsub(Neon16, q1, q0, q1);
1649 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub16)))); 1673 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub16))));
1650 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); 1674 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1651 __ mov(r4, Operand(0x00000001)); 1675 __ mov(r4, Operand(0x00000001));
1652 __ vdup(Neon32, q0, r4); 1676 __ vdup(Neon32, q0, r4);
1653 __ mov(r4, Operand(0x00000003)); 1677 __ mov(r4, Operand(0x00000003));
1654 __ vdup(Neon32, q1, r4); 1678 __ vdup(Neon32, q1, r4);
1655 __ vsub(Neon32, q1, q0, q1); 1679 __ vsub(Neon32, q1, q0, q1);
1656 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub32)))); 1680 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vsub32))));
1657 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); 1681 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1658 1682
1683 // vqsub.
1684 __ mov(r4, Operand(0x7f));
1685 __ vdup(Neon8, q0, r4);
1686 __ mov(r4, Operand(0x3f));
1687 __ vdup(Neon8, q1, r4);
1688 __ vqsub(NeonU8, q1, q1, q0);
1689 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vqsub_u8))));
1690 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1691 __ mov(r4, Operand(0x8000));
1692 __ vdup(Neon16, q0, r4);
1693 __ mov(r4, Operand(0x7fff));
1694 __ vdup(Neon16, q1, r4);
1695 __ vqsub(NeonS16, q1, q1, q0);
1696 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vqsub_s16))));
1697 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1698 __ mov(r4, Operand(0x80000001));
1699 __ vdup(Neon32, q0, r4);
1700 __ mov(r4, Operand(0x80000000));
1701 __ vdup(Neon32, q1, r4);
1702 __ vqsub(NeonU32, q1, q1, q0);
1703 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vqsub_u32))));
1704 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1705
1659 // vmul (integer). 1706 // vmul (integer).
1660 __ mov(r4, Operand(0x02)); 1707 __ mov(r4, Operand(0x02));
1661 __ vdup(Neon8, q0, r4); 1708 __ vdup(Neon8, q0, r4);
1662 __ vmul(Neon8, q1, q0, q0); 1709 __ vmul(Neon8, q1, q0, q0);
1663 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul8)))); 1710 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul8))));
1664 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4)); 1711 __ vst1(Neon8, NeonListOperand(q1), NeonMemOperand(r4));
1665 __ mov(r4, Operand(0x0002)); 1712 __ mov(r4, Operand(0x0002));
1666 __ vdup(Neon16, q0, r4); 1713 __ vdup(Neon16, q0, r4);
1667 __ vmul(Neon16, q1, q0, q0); 1714 __ vmul(Neon16, q1, q0, q0);
1668 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul16)))); 1715 __ add(r4, r0, Operand(static_cast<int32_t>(offsetof(T, vmul16))));
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 CHECK_EQ_SPLAT(vmax_s8, 0x03030303u); 1988 CHECK_EQ_SPLAT(vmax_s8, 0x03030303u);
1942 // [0x00ff, 0x00ff, ...] and [0xffff, 0xffff, ...] 1989 // [0x00ff, 0x00ff, ...] and [0xffff, 0xffff, ...]
1943 CHECK_EQ_SPLAT(vmin_u16, 0x00ff00ffu); 1990 CHECK_EQ_SPLAT(vmin_u16, 0x00ff00ffu);
1944 CHECK_EQ_SPLAT(vmax_u16, 0xffffffffu); 1991 CHECK_EQ_SPLAT(vmax_u16, 0xffffffffu);
1945 // [0x000000ff, 0x000000ff, ...] and [0xffffffff, 0xffffffff, ...] 1992 // [0x000000ff, 0x000000ff, ...] and [0xffffffff, 0xffffffff, ...]
1946 CHECK_EQ_SPLAT(vmin_s32, 0xffffffffu); 1993 CHECK_EQ_SPLAT(vmin_s32, 0xffffffffu);
1947 CHECK_EQ_SPLAT(vmax_s32, 0xffu); 1994 CHECK_EQ_SPLAT(vmax_s32, 0xffu);
1948 CHECK_EQ_SPLAT(vadd8, 0x03030303u); 1995 CHECK_EQ_SPLAT(vadd8, 0x03030303u);
1949 CHECK_EQ_SPLAT(vadd16, 0x00030003u); 1996 CHECK_EQ_SPLAT(vadd16, 0x00030003u);
1950 CHECK_EQ_SPLAT(vadd32, 0x00000003u); 1997 CHECK_EQ_SPLAT(vadd32, 0x00000003u);
1998 CHECK_EQ_SPLAT(vqadd_s8, 0x80808080u);
1999 CHECK_EQ_SPLAT(vqadd_u16, 0xffffffffu);
2000 CHECK_EQ_SPLAT(vqadd_s32, 0x80000000u);
2001 CHECK_EQ_SPLAT(vqsub_u8, 0x00000000u);
2002 CHECK_EQ_SPLAT(vqsub_s16, 0x7fff7fffu);
2003 CHECK_EQ_SPLAT(vqsub_u32, 0x00000000u);
1951 CHECK_EQ_SPLAT(vsub8, 0xfefefefeu); 2004 CHECK_EQ_SPLAT(vsub8, 0xfefefefeu);
1952 CHECK_EQ_SPLAT(vsub16, 0xfffefffeu); 2005 CHECK_EQ_SPLAT(vsub16, 0xfffefffeu);
1953 CHECK_EQ_SPLAT(vsub32, 0xfffffffeu); 2006 CHECK_EQ_SPLAT(vsub32, 0xfffffffeu);
1954 CHECK_EQ_SPLAT(vmul8, 0x04040404u); 2007 CHECK_EQ_SPLAT(vmul8, 0x04040404u);
1955 CHECK_EQ_SPLAT(vmul16, 0x00040004u); 2008 CHECK_EQ_SPLAT(vmul16, 0x00040004u);
1956 CHECK_EQ_SPLAT(vmul32, 0x00000004u); 2009 CHECK_EQ_SPLAT(vmul32, 0x00000004u);
1957 CHECK_EQ_SPLAT(vshl8, 0xaaaaaaaau); 2010 CHECK_EQ_SPLAT(vshl8, 0xaaaaaaaau);
1958 CHECK_EQ_SPLAT(vshl16, 0xaa00aa00u); 2011 CHECK_EQ_SPLAT(vshl16, 0xaa00aa00u);
1959 CHECK_EQ_SPLAT(vshl32, 0xaaaa0000u); 2012 CHECK_EQ_SPLAT(vshl32, 0xaaaa0000u);
1960 CHECK_EQ_SPLAT(vshr_s8, 0xc0c0c0c0u); 2013 CHECK_EQ_SPLAT(vshr_s8, 0xc0c0c0c0u);
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
3672 HandleScope scope(isolate); 3725 HandleScope scope(isolate);
3673 3726
3674 Assembler assm(isolate, NULL, 0); 3727 Assembler assm(isolate, NULL, 0);
3675 __ mov(r0, Operand(isolate->factory()->infinity_value())); 3728 __ mov(r0, Operand(isolate->factory()->infinity_value()));
3676 __ BlockConstPoolFor(1019); 3729 __ BlockConstPoolFor(1019);
3677 for (int i = 0; i < 1019; ++i) __ nop(); 3730 for (int i = 0; i < 1019; ++i) __ nop();
3678 __ vldr(d0, MemOperand(r0, 0)); 3731 __ vldr(d0, MemOperand(r0, 0));
3679 } 3732 }
3680 3733
3681 #undef __ 3734 #undef __
OLDNEW
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | test/cctest/test-disasm-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698