Skip to content
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

AArch64 decoder: Add all GPR-touching instructions #4848

Open
derekbruening opened this issue Apr 14, 2021 · 2 comments
Open

AArch64 decoder: Add all GPR-touching instructions #4848

derekbruening opened this issue Apr 14, 2021 · 2 comments

Comments

@derekbruening
Copy link
Contributor

Splitting sub-pieces off from the master issue #2626 on finishing the AArch64 decoder. This piece covers ensuring that all instructions with general purpose register operands are fully decoded and encoded. Xref the instruction lists here: #2626 (comment)

MDevereau added a commit that referenced this issue Apr 15, 2021
This implements:
- Scalar floating-point
- Vector floating-point
- Scalar floating-point to GPR

Issue: #4848
AssadHashmi pushed a commit that referenced this issue Apr 15, 2021
i#4848 AArch64 decoder: Add FCVTZU instruction (#4846)

This implements:
- Scalar floating-point
- Vector floating-point
- Scalar floating-point to GPR

Issue: #4848
MDevereau added a commit that referenced this issue Apr 16, 2021
…ructions

This implements:
- Scalar floating-point
- Vector floating-point
- Scalar floating-point to GPR

for FCVTAS, FCVTNS, FCVTPS, FCVTPU, and FCVTZS.

Issue: #4848
MDevereau added a commit that referenced this issue Apr 16, 2021
This implements:
- Scalar floating-point
- Vector floating-point
- Scalar floating-point to GPR

for FCVTAS, FCVTNS, FCVTPS, FCVTPU, and FCVTZS.

Issue: #4848
MDevereau added a commit that referenced this issue Apr 19, 2021
This implements:
- Scalar floating-point
- Vector floating-point
- Scalar floating-point to GPR

for FCVTAS, FCVTNS, FCVTPS, FCVTPU, and FCVTZS.

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Apr 19, 2021
This implements:
- Scalar floating-point
- Vector floating-point
- Scalar floating-point to GPR

for FCVTAS, FCVTNS, FCVTPS, FCVTPU, and FCVTZS.

Issue: #4848, #2626
AssadHashmi pushed a commit that referenced this issue Apr 19, 2021
This implements:
- Scalar floating-point
- Vector floating-point
- Scalar floating-point to GPR

for FCVTAS, FCVTNS, FCVTPS, FCVTPU, and FCVTZS.

Issue: #4848, #2626
AssadHashmi added a commit that referenced this issue Apr 19, 2021
This patch adds scale and immh:immb bitfeld handling
for the #fbits value in the codec using the FCVTZU
instruction as a use-case.

Issues: #2626, #4848
AssadHashmi added a commit that referenced this issue Apr 19, 2021
This patch adds scale and immh:immb bitfeld handling
for the #fbits value in the codec using the FCVTZU
instruction as a use-case.

Issues: #2626, #4848
AssadHashmi added a commit that referenced this issue Apr 21, 2021
This patch adds scale and immh:immb bitfeld handling
for the #fbits value in the codec using the FCVTZU
instruction as a use-case.

Issues: #2626, #4848
MDevereau added a commit that referenced this issue Apr 22, 2021
Add handling of:
- FCVTZS (scalar, fixed-point)
- FCVTZS (vector, fixed-point)(scalar)

Issue: #2626, #4848
MDevereau added a commit that referenced this issue Apr 22, 2021
Add handling of:
- FCVTZS (scalar, fixed-point)
- FCVTZS (vector, fixed-point)(scalar)

Issue: #2626, #4848
MDevereau added a commit that referenced this issue Apr 23, 2021
Add handling of:
- FCVTZS (scalar, fixed-point)
- FCVTZS (vector, fixed-point)(scalar)

Issue: #2626, #4848
MDevereau added a commit that referenced this issue Apr 23, 2021
Add handling of:
- scalar, integer
- vector, integer
- scalar, fixed-point
- vector, fixed-point

for instructions UCVTF and SCVTF

Issue: #2626, #4848
AssadHashmi pushed a commit that referenced this issue Apr 23, 2021
Add handling of:
- scalar, integer
- vector, integer
- scalar, fixed-point
- vector, fixed-point

for instructions UCVTF and SCVTF

Issue: #2626, #4848
@derekbruening
Copy link
Contributor Author

I found it surprising how many GPR-touching instructions were/are missing from the decoder: those could cause subtle bugs and all kinds of application crashes or abnormalities. I recall that the xx opcodes were supposed to decode GPR slots and try to include GPR registers they touch to avoid such bugs -- has that held for all these SIMD opcodes?

From #4855 (comment)

$ disasm_a64 1e290000
llvm-mc:   1e290000 fcvtpu w0, s0
capstone:  1e290000 fcvtpu w0, s0
bfd:       1e290000 fcvtpu w0, s0
DynamoRIO: 1e290000 xx $0x1e290000 %x0 %x0 %x0 %x9 -> %x0 %x0 %x0 %x9
$ disasm_a64 1e2903ff
llvm-mc:   1e2903ff fcvtpu wzr, s31
capstone:  1e2903ff fcvtpu wzr, s31
bfd:       1e2903ff fcvtpu wzr, s31
DynamoRIO: 1e2903ff xx $0x1e2903ff %sp %sp %x0 %x9 -> %sp %sp %x0 %x9

Here we have wzr/sp and w0 indicated as both read and written which does remove (most/all?) causes of bugs.

MDevereau added a commit that referenced this issue Apr 27, 2021
Ordering dis-a64.txt alphabetically by instruction name will make it
much easier to navigate and detect missing or erroneous tests.

Issue: #2626, #4847, #4848, #4849
AssadHashmi pushed a commit that referenced this issue Apr 27, 2021
Ordering dis-a64.txt alphabetically by instruction name will make it
much easier to navigate and detect missing or erroneous tests.

Issue: #2626, #4847, #4848, #4849
MDevereau added a commit that referenced this issue May 25, 2021
Adds the following instructions to the codec with decoder tests
- FCVTAU, FCVTL, FCVTL2, FCVTMS, FCVTN, FCVTN2

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jun 1, 2021
Adds the following instructions to the codec with decoder tests
- FCVTAU, FCVTL, FCVTL2, FCVTMS, FCVTN, FCVTN2

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jun 1, 2021
Adds DUP to the codec with decoder tests

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jun 1, 2021
Adds SMOV to the codec with decoder tests

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jun 1, 2021
Add any missing variations of mul, rev32, rev64 with
decoding tests

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jun 2, 2021
Add SMOV to the codec with decoder tests

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jun 2, 2021
Add DUP to the codec with decoder tests

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jun 17, 2021
Add missing variations of mul, rev32, rev64 with
decoding tests

Issue: #4848, #2626
@AssadHashmi
Copy link
Contributor

Missing opcodes that touch GPR's: 75 of 254 as at 17-06-21.

MDevereau added a commit that referenced this issue Jun 21, 2021
Adds the following AArch64 v8.0 instructions to the codec:

    CLZ (vector)
    NEG (vector)
    NEG (vector, scalar)
    ORR (vector, immediate)
    MOV (vector, element) (INS alias)
    MOV (vector, from general) (INS alias)
    MOV (vector, scalar)
    MOV (vector, to general) (UMOV alias)

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jun 22, 2021
Adds the following AArch64 v8.0 instructions to the codec:

    CLZ (vector)
    NEG (vector)
    NEG (vector, scalar)
    ORR (vector, immediate)
    MOV (vector, element) (INS alias)
    MOV (vector, from general) (INS alias)
    MOV (vector, scalar)
    MOV (vector, to general) (UMOV alias)

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jul 9, 2021
Adds FCVTMU FCVTNU SYSL CMLT to the codec.

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jul 12, 2021
Adds FCVTMU FCVTNU SYSL and CMLT to the codec.

Issue: #4848, #2626
MDevereau added a commit that referenced this issue Jul 12, 2021
Adds FCVTMU FCVTNU SYSL and CMLT to the codec.

Issue: #4848, #2626
sapostolakis pushed a commit that referenced this issue Jul 14, 2021
Adds FCVTMU FCVTNU SYSL and CMLT to the codec.

Issue: #4848, #2626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants