Runtime: [RyuJIT] Ensure all the VEX.vvvv instructions in IsDstDstSrc/DstSrcSrcAVXInstruction

Created on 12 Jul 2018  路  7Comments  路  Source: dotnet/runtime

Logging the conversation https://github.com/dotnet/coreclr/pull/18876#pullrequestreview-136452081

We should double check that all the instructions that use VEX.vvvv field (VEX encoded 256-bit and 128-bit instructions both) properly exist in IsDstDstSrc/DstSrcSrcAVXInstruction.

area-CodeGen-coreclr enhancement

Most helpful comment

I've gone through the instruction manual, and have found nothing immediately actionable. The only questionable thing I found is blendvps, blendvpd and pblendvb which "sort of" have IsDstDstSrc semantics, but since the mask is implicit xmm0 for SSE vs. encoded immediate for AVX, they really can't use the same emitter method anyway.
I think that these methods should be limited to those instructions that have both VEX and non-VEX encodings, but I believe there may still be some places in SIMD codegen that use the 2-operand emit method to generate 3-operand VEX-only instructions. And unfortunately, the emitter and instrDescs have only the most minimal of mechanisms to ensure that a supported format is being used.
I am going to close this, and add some notes to dotnet/runtime#9135.

All 7 comments

@fiigii @tannergooding do you envision that this is something we could do programmatically, e.g. by adding asserts?

do programmatically, e.g. by adding asserts?

Maybe hard because the current ins table does not have VEX encoding information. I think https://github.com/dotnet/coreclr/issues/14523 is a better approach.

@CarolEidt, I think we could after a refactoring to add the necessary flags/etc.

This should be significantly easier to do now that this information is encoded as flags in the instruction table.

@CarolEidt @tannergooding Is this something that will just be a one-time manual audit, or does code need to be written? Does this need to be in 3.0? If so, can someone take ownership?

This just needs to be a one time manual audit. I believe I already did this when I added the instruction flags support, but it wouldn't hurt for someone to do it again.

I've gone through the instruction manual, and have found nothing immediately actionable. The only questionable thing I found is blendvps, blendvpd and pblendvb which "sort of" have IsDstDstSrc semantics, but since the mask is implicit xmm0 for SSE vs. encoded immediate for AVX, they really can't use the same emitter method anyway.
I think that these methods should be limited to those instructions that have both VEX and non-VEX encodings, but I believe there may still be some places in SIMD codegen that use the 2-operand emit method to generate 3-operand VEX-only instructions. And unfortunately, the emitter and instrDescs have only the most minimal of mechanisms to ensure that a supported format is being used.
I am going to close this, and add some notes to dotnet/runtime#9135.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bencz picture bencz  路  3Comments

yahorsi picture yahorsi  路  3Comments

matty-hall picture matty-hall  路  3Comments

GitAntoinee picture GitAntoinee  路  3Comments

aggieben picture aggieben  路  3Comments