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

x86: Update code-generator documentation #7375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BradleyWood
Copy link
Member

No description provided.

@BradleyWood BradleyWood marked this pull request as ready for review July 25, 2024 14:25
Copy link
Contributor

@0xdaryl 0xdaryl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contributions to the documentation.


```
128 - SSE, VEX_L128, EVEX_L128
256 - VEX_L256, EVEX_L128
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be EVEX_L256 ?


### Generating SIMD instructions

Generating SIMD instructions is simple. You may optionally specify the method of which to encode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"of which" -> "by which"

generateRegRegInstruction(TR::InstOpCode::MOVDQURegReg, node, resultReg, valueReg, cg, OMR::X86::VEX_L128);
```

By not specifying an opcode encoding method, the code-generator will use method specified
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"code-generator" -> "code generator"

It isn't our convention to hyphenate these words.

```

By not specifying an opcode encoding method, the code-generator will use method specified
on opcodes definition. If the instruction is labeled as VEX_L128, and AVX is not supported,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"use the method specified on an opcode's definition."

} Encoding;
```

#### 128-Bit vmovdqu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this included just as an example, or is there some other reason for calling out 128-bit vmovdqu ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an example


To dynamically find the best encoding method you may call ```getSIMDEncoding(&cpu, vl)```.
This query uses flags stored on the instruction to determine the best encoding method for
the given instruction, cpu, and vector length.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpu -> CPU


#### Dynamically determining the best encoding method

To dynamically find the best encoding method you may call ```getSIMDEncoding(&cpu, vl)```.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there restrictions on when you can call this function? e.g., can you only call it during binary encoding?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, doesn't matter when/where you call it


#### Dynamically determining the best encoding method

To dynamically find the best encoding method you may call ```getSIMDEncoding(&cpu, vl)```.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mention the class this function is a member of?

This method will return ```OMR::X86::Bad``` if the opcode is not supported at the given
vector length and will also throw an assertion failure if the instruction is missing
CPU feature requirements flags.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precede this with "For example," here if that's what it is.


#### Dynamically determining the best encoding method

To dynamically find the best encoding method you may call ```getSIMDEncoding(&cpu, vl)```.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a permalink to where it is defined.

@BradleyWood
Copy link
Member Author

@0xdaryl See the force-push

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

Successfully merging this pull request may close these issues.

2 participants