Skip to content
Permalink
Browse files
8257137: Revise smov and umov in aarch64 assembler
Reviewed-by: aph, njian
  • Loading branch information
shqking authored and Ningsheng Jian committed Mar 4, 2021
1 parent d93fa0d commit 84c93d5a18021c178d2f28b22869e910c391ead2
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 80 deletions.
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2657,16 +2657,18 @@ void mvnw(Register Rd, Register Rm,
f(sidx<<(int)T, 14, 11), f(1, 10), rf(Vn, 5), rf(Vd, 0);
}

#define INSN(NAME, op) \
void NAME(Register Rd, FloatRegister Vn, SIMD_RegVariant T, int idx) { \
starti; \
f(0, 31), f(T==D ? 1:0, 30), f(0b001110000, 29, 21); \
f(((idx<<1)|1)<<(int)T, 20, 16), f(op, 15, 10); \
rf(Vn, 5), rf(Rd, 0); \
#define INSN(NAME, cond, op1, op2) \
void NAME(Register Rd, FloatRegister Vn, SIMD_RegVariant T, int idx) { \
starti; \
assert(cond, "invalid register variant"); \
f(0, 31), f(op1, 30), f(0b001110000, 29, 21); \
f(((idx << 1) | 1) << (int)T, 20, 16), f(op2, 15, 10); \
rf(Vn, 5), rf(Rd, 0); \
}

INSN(umov, 0b001111);
INSN(smov, 0b001011);
INSN(umov, (T != Q), (T == D ? 1 : 0), 0b001111);
INSN(smov, (T < D), 1, 0b001011);

#undef INSN

#define INSN(NAME, opc, opc2, isSHR) \
@@ -1499,6 +1499,13 @@ def generate(kind, names):
["mov", "__ mov(v1, __ T2S, 1, zr);", "mov\tv1.s[1], wzr"],
["mov", "__ mov(v1, __ T4H, 2, zr);", "mov\tv1.h[2], wzr"],
["mov", "__ mov(v1, __ T8B, 3, zr);", "mov\tv1.b[3], wzr"],
["smov", "__ smov(r0, v1, __ S, 0);", "smov\tx0, v1.s[0]"],
["smov", "__ smov(r0, v1, __ H, 1);", "smov\tx0, v1.h[1]"],
["smov", "__ smov(r0, v1, __ B, 2);", "smov\tx0, v1.b[2]"],
["umov", "__ umov(r0, v1, __ D, 0);", "umov\tx0, v1.d[0]"],
["umov", "__ umov(r0, v1, __ S, 1);", "umov\tw0, v1.s[1]"],
["umov", "__ umov(r0, v1, __ H, 2);", "umov\tw0, v1.h[2]"],
["umov", "__ umov(r0, v1, __ B, 3);", "umov\tw0, v1.b[3]"],
["ld1", "__ ld1(v31, v0, __ T2D, Address(__ post(r1, r0)));", "ld1\t{v31.2d, v0.2d}, [x1], x0"],
# SVE instructions
["cpy", "__ sve_cpy(z0, __ S, p0, v1);", "mov\tz0.s, p0/m, s1"],
@@ -685,6 +685,13 @@
__ mov(v1, __ T2S, 1, zr); // mov v1.s[1], wzr
__ mov(v1, __ T4H, 2, zr); // mov v1.h[2], wzr
__ mov(v1, __ T8B, 3, zr); // mov v1.b[3], wzr
__ smov(r0, v1, __ S, 0); // smov x0, v1.s[0]
__ smov(r0, v1, __ H, 1); // smov x0, v1.h[1]
__ smov(r0, v1, __ B, 2); // smov x0, v1.b[2]
__ umov(r0, v1, __ D, 0); // umov x0, v1.d[0]
__ umov(r0, v1, __ S, 1); // umov w0, v1.s[1]
__ umov(r0, v1, __ H, 2); // umov w0, v1.h[2]
__ umov(r0, v1, __ B, 3); // umov w0, v1.b[3]
__ ld1(v31, v0, __ T2D, Address(__ post(r1, r0))); // ld1 {v31.2d, v0.2d}, [x1], x0
__ sve_cpy(z0, __ S, p0, v1); // mov z0.s, p0/m, s1
__ sve_inc(r0, __ S); // incw x0
@@ -922,30 +929,30 @@
0x9101a1a0, 0xb10a5cc8, 0xd10810aa, 0xf10fd061,
0x120cb166, 0x321764bc, 0x52174681, 0x720c0227,
0x9241018e, 0xb25a2969, 0xd278b411, 0xf26aad01,
0x14000000, 0x17ffffd7, 0x140002d4, 0x94000000,
0x97ffffd4, 0x940002d1, 0x3400000a, 0x34fffa2a,
0x340059ca, 0x35000008, 0x35fff9c8, 0x35005968,
0xb400000b, 0xb4fff96b, 0xb400590b, 0xb500001d,
0xb5fff91d, 0xb50058bd, 0x10000013, 0x10fff8b3,
0x10005853, 0x90000013, 0x36300016, 0x3637f836,
0x363057d6, 0x3758000c, 0x375ff7cc, 0x3758576c,
0x14000000, 0x17ffffd7, 0x140002db, 0x94000000,
0x97ffffd4, 0x940002d8, 0x3400000a, 0x34fffa2a,
0x34005aaa, 0x35000008, 0x35fff9c8, 0x35005a48,
0xb400000b, 0xb4fff96b, 0xb40059eb, 0xb500001d,
0xb5fff91d, 0xb500599d, 0x10000013, 0x10fff8b3,
0x10005933, 0x90000013, 0x36300016, 0x3637f836,
0x363058b6, 0x3758000c, 0x375ff7cc, 0x3758584c,
0x128313a0, 0x528a32c7, 0x7289173b, 0x92ab3acc,
0xd2a0bf94, 0xf2c285e8, 0x9358722f, 0x330e652f,
0x53067f3b, 0x93577c53, 0xb34a1aac, 0xd35a4016,
0x13946c63, 0x93c3dbc8, 0x54000000, 0x54fff5a0,
0x54005540, 0x54000001, 0x54fff541, 0x540054e1,
0x54000002, 0x54fff4e2, 0x54005482, 0x54000002,
0x54fff482, 0x54005422, 0x54000003, 0x54fff423,
0x540053c3, 0x54000003, 0x54fff3c3, 0x54005363,
0x54000004, 0x54fff364, 0x54005304, 0x54000005,
0x54fff305, 0x540052a5, 0x54000006, 0x54fff2a6,
0x54005246, 0x54000007, 0x54fff247, 0x540051e7,
0x54000008, 0x54fff1e8, 0x54005188, 0x54000009,
0x54fff189, 0x54005129, 0x5400000a, 0x54fff12a,
0x540050ca, 0x5400000b, 0x54fff0cb, 0x5400506b,
0x5400000c, 0x54fff06c, 0x5400500c, 0x5400000d,
0x54fff00d, 0x54004fad, 0x5400000e, 0x54ffefae,
0x54004f4e, 0x5400000f, 0x54ffef4f, 0x54004eef,
0x54005620, 0x54000001, 0x54fff541, 0x540055c1,
0x54000002, 0x54fff4e2, 0x54005562, 0x54000002,
0x54fff482, 0x54005502, 0x54000003, 0x54fff423,
0x540054a3, 0x54000003, 0x54fff3c3, 0x54005443,
0x54000004, 0x54fff364, 0x540053e4, 0x54000005,
0x54fff305, 0x54005385, 0x54000006, 0x54fff2a6,
0x54005326, 0x54000007, 0x54fff247, 0x540052c7,
0x54000008, 0x54fff1e8, 0x54005268, 0x54000009,
0x54fff189, 0x54005209, 0x5400000a, 0x54fff12a,
0x540051aa, 0x5400000b, 0x54fff0cb, 0x5400514b,
0x5400000c, 0x54fff06c, 0x540050ec, 0x5400000d,
0x54fff00d, 0x5400508d, 0x5400000e, 0x54ffefae,
0x5400502e, 0x5400000f, 0x54ffef4f, 0x54004fcf,
0xd40658e1, 0xd4014d22, 0xd4046543, 0xd4273f60,
0xd44cad80, 0xd503201f, 0xd69f03e0, 0xd6bf03e0,
0xd5033fdf, 0xd5033e9f, 0xd50332bf, 0xd61f0200,
@@ -977,7 +984,7 @@
0x791f226d, 0xf95aa2f3, 0xb9587bb7, 0x395f7176,
0x795d9143, 0x399e7e08, 0x799a2697, 0x79df3422,
0xb99c2624, 0xfd5c2374, 0xbd5fa1d9, 0xfd1d595a,
0xbd1b1869, 0x58003f3b, 0x1800000b, 0xf8945060,
0xbd1b1869, 0x5800401b, 0x1800000b, 0xf8945060,
0xd8000000, 0xf8ae6ba0, 0xf99a0080, 0x1a070035,
0x3a0700a8, 0x5a0e0367, 0x7a11009b, 0x9a000380,
0xba1e030c, 0xda0f0320, 0xfa030301, 0x0b340b11,
@@ -1055,54 +1062,56 @@
0x3a5f03e5, 0xfa411be4, 0x7a42cbe2, 0x93df03ff,
0xc820ffff, 0x8822fc7f, 0xc8247cbf, 0x88267fff,
0x4e010fe0, 0x4e081fe1, 0x4e0c1fe1, 0x4e0a1fe1,
0x4e071fe1, 0x4cc0ac3f, 0x05a08020, 0x04b0e3e0,
0x0470e7e1, 0x042f9c20, 0x043f9c35, 0x047f9c20,
0x04ff9c20, 0x04299420, 0x04319160, 0x0461943e,
0x04a19020, 0x042053ff, 0x047f5401, 0x25208028,
0x2538cfe0, 0x2578d001, 0x25b8efe2, 0x25f8f007,
0xa400a3e0, 0xa4a8a7ea, 0xa547a814, 0xa4084ffe,
0xa55c53e0, 0xa5e1540b, 0xe400fbf6, 0xe408ffff,
0xe547e400, 0xe4014be0, 0xe4a84fe0, 0xe5f15000,
0x858043e0, 0x85a043ff, 0xe59f5d08, 0x1e601000,
0x1e603000, 0x1e621000, 0x1e623000, 0x1e641000,
0x1e643000, 0x1e661000, 0x1e663000, 0x1e681000,
0x1e683000, 0x1e6a1000, 0x1e6a3000, 0x1e6c1000,
0x1e6c3000, 0x1e6e1000, 0x1e6e3000, 0x1e701000,
0x1e703000, 0x1e721000, 0x1e723000, 0x1e741000,
0x1e743000, 0x1e761000, 0x1e763000, 0x1e781000,
0x1e783000, 0x1e7a1000, 0x1e7a3000, 0x1e7c1000,
0x1e7c3000, 0x1e7e1000, 0x1e7e3000, 0xf8238358,
0xf83702af, 0xf8231118, 0xf8392214, 0xf8313022,
0xf8205098, 0xf82343ec, 0xf83c734a, 0xf82261ec,
0xf8bf81a1, 0xf8bd0260, 0xf8ac12d1, 0xf8ad23dc,
0xf8bf3341, 0xf8bc53c4, 0xf8a443c6, 0xf8ba7130,
0xf8a8600c, 0xf8f48301, 0xf8e20120, 0xf8f8121a,
0xf8fe2143, 0xf8f7308a, 0xf8f05162, 0xf8e841ea,
0xf8f17142, 0xf8ec61ec, 0xf86d80e2, 0xf874021a,
0xf8641082, 0xf86c22b0, 0xf8703170, 0xf8755197,
0xf87a4397, 0xf86e730b, 0xf86163ec, 0xb82a80f0,
0xb82201a3, 0xb8331211, 0xb8232161, 0xb83e3105,
0xb82f53dd, 0xb82040f4, 0xb8347397, 0xb835633b,
0xb8a582e1, 0xb8b000bf, 0xb8ac1389, 0xb8af22dd,
0xb8bf33f3, 0xb8a551ee, 0xb8bf4370, 0xb8b47190,
0xb8ab60c9, 0xb8fe8371, 0xb8fc00fe, 0xb8ea1154,
0xb8e42238, 0xb8f13076, 0xb8fd52cf, 0xb8f342d3,
0xb8e270cf, 0xb8ec6170, 0xb86d8037, 0xb87e00b3,
0xb8711202, 0xb876214d, 0xb875337d, 0xb86c507b,
0xb861431f, 0xb8737131, 0xb87c61fb, 0xce367a86,
0xce1e6858, 0xce768d51, 0xce910451, 0xce768338,
0xce6c8622, 0xcec08363, 0xce708b9d, 0x04e900da,
0x042404f1, 0x6596012f, 0x65d40b62, 0x65c00745,
0x0456a72e, 0x04c0175b, 0x04109418, 0x041ab006,
0x0413812f, 0x04118b65, 0x04101694, 0x04d7aa0a,
0x045eb046, 0x04c81c5d, 0x044a1dd6, 0x040112fb,
0x04dcad42, 0x65809aca, 0x658d9603, 0x65c69201,
0x65878d8c, 0x65c28290, 0x04dda4e5, 0x65c2be0c,
0x6580a386, 0x65c1a624, 0x658dae6d, 0x65819638,
0x65f318ca, 0x65a030cd, 0x65a8532e, 0x65bb76d6,
0x04144e23, 0x04407ce4, 0x04363270, 0x04b6312f,
0x047e30b9, 0x041a356d, 0x04982a8d, 0x04192c99,
0x04c828d1, 0x04ca3e04, 0x658729da, 0x65863c6b,
0x65d83aa1, 0x04812a2e,
0x4e071fe1, 0x4e042c20, 0x4e062c20, 0x4e052c20,
0x4e083c20, 0x0e0c3c20, 0x0e0a3c20, 0x0e073c20,
0x4cc0ac3f, 0x05a08020, 0x04b0e3e0, 0x0470e7e1,
0x042f9c20, 0x043f9c35, 0x047f9c20, 0x04ff9c20,
0x04299420, 0x04319160, 0x0461943e, 0x04a19020,
0x042053ff, 0x047f5401, 0x25208028, 0x2538cfe0,
0x2578d001, 0x25b8efe2, 0x25f8f007, 0xa400a3e0,
0xa4a8a7ea, 0xa547a814, 0xa4084ffe, 0xa55c53e0,
0xa5e1540b, 0xe400fbf6, 0xe408ffff, 0xe547e400,
0xe4014be0, 0xe4a84fe0, 0xe5f15000, 0x858043e0,
0x85a043ff, 0xe59f5d08, 0x1e601000, 0x1e603000,
0x1e621000, 0x1e623000, 0x1e641000, 0x1e643000,
0x1e661000, 0x1e663000, 0x1e681000, 0x1e683000,
0x1e6a1000, 0x1e6a3000, 0x1e6c1000, 0x1e6c3000,
0x1e6e1000, 0x1e6e3000, 0x1e701000, 0x1e703000,
0x1e721000, 0x1e723000, 0x1e741000, 0x1e743000,
0x1e761000, 0x1e763000, 0x1e781000, 0x1e783000,
0x1e7a1000, 0x1e7a3000, 0x1e7c1000, 0x1e7c3000,
0x1e7e1000, 0x1e7e3000, 0xf8238358, 0xf83702af,
0xf8231118, 0xf8392214, 0xf8313022, 0xf8205098,
0xf82343ec, 0xf83c734a, 0xf82261ec, 0xf8bf81a1,
0xf8bd0260, 0xf8ac12d1, 0xf8ad23dc, 0xf8bf3341,
0xf8bc53c4, 0xf8a443c6, 0xf8ba7130, 0xf8a8600c,
0xf8f48301, 0xf8e20120, 0xf8f8121a, 0xf8fe2143,
0xf8f7308a, 0xf8f05162, 0xf8e841ea, 0xf8f17142,
0xf8ec61ec, 0xf86d80e2, 0xf874021a, 0xf8641082,
0xf86c22b0, 0xf8703170, 0xf8755197, 0xf87a4397,
0xf86e730b, 0xf86163ec, 0xb82a80f0, 0xb82201a3,
0xb8331211, 0xb8232161, 0xb83e3105, 0xb82f53dd,
0xb82040f4, 0xb8347397, 0xb835633b, 0xb8a582e1,
0xb8b000bf, 0xb8ac1389, 0xb8af22dd, 0xb8bf33f3,
0xb8a551ee, 0xb8bf4370, 0xb8b47190, 0xb8ab60c9,
0xb8fe8371, 0xb8fc00fe, 0xb8ea1154, 0xb8e42238,
0xb8f13076, 0xb8fd52cf, 0xb8f342d3, 0xb8e270cf,
0xb8ec6170, 0xb86d8037, 0xb87e00b3, 0xb8711202,
0xb876214d, 0xb875337d, 0xb86c507b, 0xb861431f,
0xb8737131, 0xb87c61fb, 0xce367a86, 0xce1e6858,
0xce768d51, 0xce910451, 0xce768338, 0xce6c8622,
0xcec08363, 0xce708b9d, 0x04e900da, 0x042404f1,
0x6596012f, 0x65d40b62, 0x65c00745, 0x0456a72e,
0x04c0175b, 0x04109418, 0x041ab006, 0x0413812f,
0x04118b65, 0x04101694, 0x04d7aa0a, 0x045eb046,
0x04c81c5d, 0x044a1dd6, 0x040112fb, 0x04dcad42,
0x65809aca, 0x658d9603, 0x65c69201, 0x65878d8c,
0x65c28290, 0x04dda4e5, 0x65c2be0c, 0x6580a386,
0x65c1a624, 0x658dae6d, 0x65819638, 0x65f318ca,
0x65a030cd, 0x65a8532e, 0x65bb76d6, 0x04144e23,
0x04407ce4, 0x04363270, 0x04b6312f, 0x047e30b9,
0x041a356d, 0x04982a8d, 0x04192c99, 0x04c828d1,
0x04ca3e04, 0x658729da, 0x65863c6b, 0x65d83aa1,
0x04812a2e,
};
// END Generated code -- do not edit

0 comments on commit 84c93d5

Please sign in to comment.