New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shufps instruction, there is a better way to display #1937

Open
flarejune opened this Issue Apr 25, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@flarejune

flarejune commented Apr 25, 2018

the Shufps instruction, there is a better way to display:
for example:
Shufps xmm0, xmm1,0x4E
can be displayed as:
Shufps xmm0, xmm1,1032

For example, the above 0x4E,
the binary is 01001110, divided into 2 groups are represented as:
01 (1) 00 (0) 11 (3) 10 (2)
After representing the Shuf,
the numerical exchange position of the XMM register.
The final results:
xmm1[1] - > xmm0[3]
xmm1[0] - > xmm0[2]
xmm0[3] - > xmm0[1]
xmm0[2] - > xmm0[0]
Code for calculation:
v = 0x4E;
v1 = v & 0x3;
v2 = (v & 0xC) >> 2;
v3 = (v & 0x30) >> 4;
v4 = (v & 0xC0) >> 6;
Result:{v4}{v3}{v2}{v1} = 1032

@flarejune

This comment has been minimized.

flarejune commented Apr 25, 2018

string to shufps imm:
s = "1032";
imm = s[3] - '0' | (s[2] - '0') << 2 | (s[1] - '0') << 4 | (s[0] - '0') << 6;

@torusrxxx

This comment has been minimized.

Member

torusrxxx commented Apr 25, 2018

@flarejune

This comment has been minimized.

flarejune commented Apr 25, 2018

When inputting the instruction "shufps" to the assembly,
If the "imm" string length is 4, need string conversion processing
The default length is 1 (does not contain "0x"),Can clearly distinguish

@IssuehuntBot

This comment has been minimized.

IssuehuntBot commented Jul 23, 2018

@0maxxam0 funded this issue with $6. Visit this issue on Issuehunt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment