Skip to content

Implement new vector types - #6353

Merged
0xdaryl merged 1 commit into
eclipse-omr:masterfrom
gita-omr:wip_vector_types
Mar 31, 2022
Merged

0xdaryl merged 1 commit into
eclipse-omr:masterfrom
gita-omr:wip_vector_types

Conversation

@gita-omr

@gita-omr gita-omr commented Feb 14, 2022 •

Copy link
Copy Markdown
Contributor
  • remove VectorInt8 - VectorDouble from OMR::DataTypes

  • allocate space for vector enums just before TR::NumAllTypes(former TR::NumTypes)

  • vector enums are generated at runtime using createVectorType()

  • value returned by createVectorType() can be used to dereference tables
    of size TR::NumAllTypes as before, but cannot be used to dereference
    tables of size TR::NumOMRTypes

  • typeless vector opcodes such as vsub, vadd, etc. (have ILTypeProp::HasNoDataType property)
    can start using the new types

  • codegen evaluators for those opcodes can use isVector(), getVectorElementType(), getVectorLength()
    on the node's DataType

  • note that getVectorElementType() and getVectorLength() can only be called on vector types, otherwise there will be an assert

  • to enable new vector length on specific platform, NumVectorLenghts must be defined corresponfingly in
    OMRDataTypes.hpp

  • TRIL and JITBuilder will use 128-bit vectors for now

  • ATTENTION: for safety reasons, renamed TR::NumTypes to TR::NumAllTypes. Please adjust your code correspondingly if it does not compile. In fact, any code that relies on specific values of TR::NumTypes, TR::NumOMRTypes, as well as vector opcodes being smaller than TR::NumOMRTypes will need to be adjusted. All that work is already done for openj9(Implement new vector types eclipse-openj9/openj9#14513).

@gita-omr

gita-omr commented Feb 14, 2022 •

Copy link
Copy Markdown
Contributor Author

@0xdaryl @jdmpapin @Leonardo2718 @mstoodle @vijaysun-omr could you please review the common part?
@Akira1Saitoh @r30shah @BradleyWood @IBMJimmyk could you please review aarch64, z, x, and p files correspondingly?

gita-omr added a commit to gita-omr/openj9 that referenced this pull request Feb 14, 2022
- see eclipse-omr/omr#6353 for the background
- to enable VectorAPI support, VectorAPIExpansion::supportedOnPlatform needs to be modified
  correspondingly
- to enable specific opcode getSupportsOpCodeForAutoSIMD needs to be modified correspondingly
@gita-omr

Copy link
Copy Markdown
Contributor Author

Updated commit message with a link to openj9 PR.

@gita-omr

Copy link
Copy Markdown
Contributor Author

Looking at macOS failures...

@gita-omr

Copy link
Copy Markdown
Contributor Author

Fixed a typo which somehow only showed up in macOS build.

@knn-k

knn-k commented Feb 14, 2022

Copy link
Copy Markdown
Contributor

The changes in the aarch64 code look good to me.

switch(node->getDataType().getVectorElementType())
{
case TR::VectorInt8:
case TR::Int8:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The original code does not accept element types other than 8-bit integer, but there is no reason not to accept other integer types. Same for other logical bitwise operations (vor, vxor and vnot).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for noticing! But I was thinking maybe we can limit this PR to only enabling new style vector types and preserve all the current functionality? We could open a separate issue to extend this particular code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree. I will extend those evaluators once this PR gets merged.

Comment thread compiler/x/codegen/OMRCodeGenerator.cpp Outdated

bool
OMR::X86::CodeGenerator::getSupportsOpCodeForAutoSIMD(TR::ILOpCode opcode, TR::DataType dt)
OMR::X86::CodeGenerator::getSupportsOpCodeForAutoSIMD(TR::ILOpCode opcode, TR::DataType dt, int32_t length)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this accept VectorLength

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree. It would be better to accept VectorLength. I will change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pushed commit with this change.

@@ -4069,15 +4069,23 @@ static const TR::InstOpCode::Mnemonic BinaryArithmeticOpCodesForReg[TR::NumOMRTy
{ TR::InstOpCode::bad, TR::InstOpCode::ADDSSRegReg, TR::InstOpCode::SUBSSRegReg, TR::InstOpCode::MULSSRegReg, TR::InstOpCode::DIVSSRegReg, TR::InstOpCode::bad, TR::InstOpCode::bad, TR::InstOpCode::bad }, // Float

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These tables only have entries for float & double, perhaps this can be simplified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, but is it ok if we open another PR? I would like to minimize changes in this PR and make sure nothing is functionally broken. The main danger is that if I missed some table or some other place that needs to be changed...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure, I suppose that can wait

Comment thread compiler/z/codegen/OMRCodeGenerator.cpp Outdated
bool OMR::Z::CodeGenerator::getSupportsOpCodeForAutoSIMD(TR::ILOpCode opcode, TR::DataType dt)
bool OMR::Z::CodeGenerator::getSupportsOpCodeForAutoSIMD(TR::ILOpCode opcode, TR::DataType dt, int32_t length)
{
if(length != 128) return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use VectorLength?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pushed commit with this change.

// TODO: exclude Float?
indexInArgRegistersArray = numVectorArgs;
argRegNum = getVectorArgumentRegister(indexInArgRegistersArray);
numVectorArgs ++;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove the space

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

of course

@0xdaryl

0xdaryl commented Feb 15, 2022

Copy link
Copy Markdown
Contributor

Jenkins build all

Just running jenkins to smoke out any obvious failures or build issues.

@gita-omr

Copy link
Copy Markdown
Contributor Author

Jenkins build win

@gita-omr

Copy link
Copy Markdown
Contributor Author

Started 'win' test since there seemed to be environment failures.

@r30shah r30shah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gita-omr I have briefly looked at the Z codegen changes and left comments. I will give it another look as well.

Comment thread compiler/z/codegen/SystemLinkagezOS.cpp Outdated
if (paramCursor->getDataType().isVector())
{
lri = numVRFArgs;
// TODO: exclude Float?

@r30shah r30shah Feb 18, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

~Can you elaborate TODO bit more here? ~ NVM, I see your point. I have put TODO in #6353 (comment) to verify this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, please let me know what I should do in this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will preserve current VectorFloat behavior with next push.

Comment thread compiler/z/codegen/OMRTreeEvaluator.cpp Outdated
generateVRScInstruction(cg, TR::InstOpCode::VLGV, node, returnReg, vectorReg, memRef, getVectorElementSizeMask(vectorChild));

TR::DataType dt = vectorChild->getDataType();
TR_ASSERT_FATAL_WITH_NODE(node, vectorChild->getDataType().getVectorLength() == TR::VectorLength128,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we move this Assert at the beginning of the function? Or at-least before using vectorChild togetVectorElementSizeMask?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, I will improve it after you finish your review. Thanks a lot!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will be fixed in next push.

Comment thread compiler/z/codegen/OMRTreeEvaluator.cpp Outdated
// if the FloatMAF option is not set and the node is not FP strict, we can't generate FMA operations
if ((addNode->getType().isFloatingPoint() || TR::VectorFloat == addNode->getType() || TR::VectorDouble == addNode->getType())
if ((addNode->getType().isFloatingPoint() ||
(addNode->getType().isVector() && TR::Float == addNode->getType().getVectorElementType()) ||

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we common out the addNode->getType().isVector() query?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will do.

{
TR::DataType elementType = resDataType.getVectorElementType();
if (elementType == TR::Int8 || elementType == TR::Int16 ||
elementType == TR::Int32 || elementType == TR::Int64 || elementType == TR::Double)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am trying to understand why we have omitted FloatVector originally from having in arguments (Probably as short and extended format support for Vector instructions were added later in to the architecture).
I am adding a TODO for myself here to double check and will confirm if that is the case, we might be able to remove check for element type here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! In some case above I already treat VectorFloat as all other vector types. Please let me know if should revert that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@r30shah just a reminder to let me know how to treat VectorFloat in Z linkages.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please NVM. I will preserve current behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will preserve current behavior.

gita-omr added a commit to gita-omr/openj9 that referenced this pull request Feb 20, 2022
- see eclipse-omr/omr#6353 for the background
- to enable VectorAPI support, VectorAPIExpansion::supportedOnPlatform needs to be modified
  correspondingly
- to enable specific opcode getSupportsOpCodeForAutoSIMD needs to be modified correspondingly

@0xdaryl 0xdaryl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I did a quick one-pass review just to get a sense of the scope of these changes. I'll push out some initial comments now, but I do want to review this again in more detail.

case TR::Int32:
case TR::Int64: return self()->getDataType();
case TR::Float: return TR::DataType::createVectorType(TR::Int32, self()->getVectorLength());
case TR::Double: return TR::DataType::createVectorType(TR::Int64, self()->getVectorLength());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this necessary only for float and double element types?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am not sure who uses this method but that's what it did originally: returned integral type of the same element size as the input type.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If all vector element types are equally valid then this seems wrong to me. At the very least it should be understood why we can't simply return "self()->getDataType()" like the other element types rather than accepting that what's there now is correct.

Comment thread compiler/il/OMRDataTypes.cpp Outdated
{
if (OMRDataTypeNames[dt] == NULL)
{
char *name = (char*) calloc(20, sizeof(char));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Memory leak. Allocate from a region that will eventually be reclaimed rather than the global allocator.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The names are cached in a static table so I think should be created only once per JIT execution.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My main concern is with the use of calloc and not the fact that these are stored in a static table (in fact that re-use is encouraged). If these names will persist across compilations then they should be allocated with the persistent allocator and not the global allocator.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right. Changed to jitPersistentAlloc and solved potential race condition (in the next push)

Comment thread compiler/il/OMRDataTypes.cpp Outdated
if (OMRDataTypeNames[dt] == NULL)
{
char *name = (char*) calloc(20, sizeof(char));
sprintf(name, "Vector%d%s", getSize(dt)*8, getName(dt.getVectorElementType()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should be defensive against buffer overflows and use snprintf instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

VectorLength128,
VectorLength256,
VectorLength512,
VectorLength64,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why aren't these vector lengths in order? i.e., put 64 first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh, is it because of the need to set NumVectorLengths?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I put most commonly used lengths first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From a code readability POV, my opinion is to order them by increasing length.

Comment thread compiler/il/OMRDataTypes.hpp Outdated
NumOMRTypes,
#include "il/DataTypesEnum.hpp"
NumTypes
NumNonVectorTypes,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"Scalar" is a more conventional term to use here than "NonVector"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wanted to bring attention to the existence of the new vector types. But we can rename to scalar if that's more preferable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"Scalar" is the more preferable term to me. Others may have different opinions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure. Will make the change soon.

Comment thread compiler/il/OMRDataTypes_inlines.hpp Outdated
{
TR_ASSERT_FATAL(isVector(), "getVectorElementType() is called on non-vector type\n");

return (TR::DataTypes)((_type - TR::NumNonVectorTypes) % TR::NumVectorElementTypes + 1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please use static_cast rather than the C-style cast.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

}

TR_ASSERT(node->getDataType() == TR::VectorDouble, "unsupported splats type");
TR_ASSERT(node->getDataType().getVectorElementType() == TR::Double, "unsupported splats type");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

May as well make this a fatal assert.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would like to keep functional changes to the minimum in this PR. It was not FATAL assert before and I just mapped old interface into the equivalent new one.

Comment thread compiler/p/codegen/OMRCodeGenerator.cpp Outdated


bool OMR::Power::CodeGenerator::getSupportsOpCodeForAutoSIMD(TR::ILOpCode opcode, TR::DataType dt)
bool OMR::Power::CodeGenerator::getSupportsOpCodeForAutoSIMD(TR::ILOpCode opcode, TR::DataType dt, int32_t length)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't the length parameter be a TR::VectorLength ? That's how you defined it elsewhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That was already changed.

Comment thread compiler/z/codegen/OMRCodeGenerator.hpp Outdated
virtual bool isDispInRange(int64_t disp);

bool getSupportsOpCodeForAutoSIMD(TR::ILOpCode, TR::DataType);
bool getSupportsOpCodeForAutoSIMD(TR::ILOpCode, TR::DataType, int32_t);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

length should be TR::VectorLength

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Old code. Fixed.

Comment thread compiler/codegen/OMRCodeGenerator.hpp Outdated
void setSupportsAutoSIMD() { _flags4.set(SupportsAutoSIMD);}

bool getSupportsOpCodeForAutoSIMD(TR::ILOpCode, TR::DataType) { return false; }
bool getSupportsOpCodeForAutoSIMD(TR::ILOpCode, TR::DataType, int32_t) { return false; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

length should be TR::VectorLength ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already fixed.

@gita-omr

gita-omr commented Mar 3, 2022 •

Copy link
Copy Markdown
Contributor Author

Addressed most of the comments and squashed. Please resolve or respond to my comments.

Comment thread compiler/il/OMRIL.cpp
{
switch (dt.getVectorElementType())
{
case TR::Int8: return TR::vbRegLoad;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we have all these different "vector register load" opcodes when we only have a single equivalent "vector load" opcode ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These are good questions. We will revise all the vector opcodes in the future. This PR is only introducing new vector types.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, "New Vector Opcodes" PR is coming soon. It introduces new infrastructure for vector opcodes. Then, we will gradually remove old opcodes and add new ones.

@gita-omr

gita-omr commented Mar 16, 2022 •

Copy link
Copy Markdown
Contributor Author

Since a lot of files have been changed, I wanted to mention that the single core change is in OMRDataTypes.hpp. The rest is just an adjustment to that change and all current behaviour is preserved. But of course, please review all the changes.

/* .properties3 = */ 0, \
/* .properties4 = */ 0, \
/* .dataType = */ TR::VectorInt32, \
/* .dataType = */ OMR::DataType::Vector128Int32, \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these vector opcodes that may be re-designed in the future but are being left as per the original behavior in this PR ? Just wondering about the specific datatype in use for these (as opposed to the different approach for say a vadd opcode).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, in this file definitely all previous behavior is preserved. For example vmin had type TR::VectorInt32 and became OMR::DataType::Vector128Int32 since TR::VectorInt32 used to imply 128. This PR removed TR::VectorInt32 from the DataTypes enum. Next PR will start removing old opcodes and adding new vector opcodes that have type encoded inside them. So they will be implemented very differently.

@gita-omr gita-omr Mar 21, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OMR::DataType::Vector128Int32 is a temporary static variable which will not be used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, I imagined this must be the case but wanted to double check with you. I have approved the PR since that was the last question I had from the review.

@gita-omr

Copy link
Copy Markdown
Contributor Author

Pushed a fix for OMR::DataType::getName()

@0xdaryl

0xdaryl commented Mar 23, 2022

Copy link
Copy Markdown
Contributor

Reviewers: would those who requested changes or made comments please formally approve this PR if you are satisfied with @gita-omr's resolution of them?

@0xdaryl

0xdaryl commented Mar 23, 2022

Copy link
Copy Markdown
Contributor

Jenkins build all

midronij pushed a commit to midronij/openj9 that referenced this pull request Mar 28, 2022
- see eclipse-omr/omr#6353 for the background
- to enable VectorAPI support, VectorAPIExpansion::supportedOnPlatform needs to be modified
  correspondingly
- to enable specific opcode getSupportsOpCodeForAutoSIMD needs to be modified correspondingly
@knn-k

knn-k commented Mar 30, 2022 •

Copy link
Copy Markdown
Contributor

There is a TR::VectorDouble remaining in OMR::X86::TreeEvaluator::vdsqrtEvaluator().
See eclipse-openj9/openj9#14513 (comment)

The code was added by PR #6402, which was merged last week.

@gita-omr

Copy link
Copy Markdown
Contributor Author

There is a TR::VectorDouble remaining in OMR::X86::TreeEvaluator::vdsqrtEvaluator(). See eclipse-openj9/openj9#14513 (comment)

The code was added by PR #6402, which was merged last week.

Right. Let me rebase and hopefully it gets merged soon :)

gita-omr added a commit to gita-omr/openj9 that referenced this pull request Mar 30, 2022
- see eclipse-omr/omr#6353 for the background
- to enable VectorAPI support, VectorAPIExpansion::supportedOnPlatform needs to be modified
  correspondingly
- to enable specific opcode getSupportsOpCodeForAutoSIMD needs to be modified correspondingly
@gita-omr

Copy link
Copy Markdown
Contributor Author

Fixed new code that was added while this PR was under review.

@0xdaryl

0xdaryl commented Mar 31, 2022

Copy link
Copy Markdown
Contributor

Jenkins build all

@0xdaryl 0xdaryl self-assigned this Mar 31, 2022
@0xdaryl

0xdaryl commented Mar 31, 2022

Copy link
Copy Markdown
Contributor

Jenkins build all

midronij pushed a commit to midronij/openj9 that referenced this pull request Mar 31, 2022
- see eclipse-omr/omr#6353 for the background
- to enable VectorAPI support, VectorAPIExpansion::supportedOnPlatform needs to be modified
  correspondingly
- to enable specific opcode getSupportsOpCodeForAutoSIMD needs to be modified correspondingly
- remove VectorInt8 - VectorDouble from OMR::DataTypes
- allocate space for vector enums just before TR::NumAllTypes(former TR::NumTypes)
- vector enums are generated at runtime using createVectorType()
- value returned by createVectorType() can be used to dereference tables
  of size TR::NumAllTypes as before, but cannot be used to dereference
  tables of size TR::NumOMRTypes
- typeless vector opcodes such as vsub, vadd, etc. (have ILTypeProp::HasNoDataType property)
  can start using the new types
- codegen evaluators for those opcodes can use isVector(), getVectorElementType(), getVectorLength()
  on the node's DataType
- note that getVectorElementType() and getVectorLength() can only be called on vector types, otherwise there will be an assert
- to enable new vector length on specific platform, NumVectorLenghts must be defined corresponfingly in
  OMRDataTypes.hpp
- TRIL and JITBuilder will use 128-bit vectors for now

- ATTENTION: for safety reasons, renamed TR::NumTypes to TR::NumAllTypes. Please adjust your code correspondingly if it does not compile. In fact, any code that relies on specific values of TR::NumTypes, TR::NumOMRTypes, as well as vector opcodes being smaller than TR::NumOMRTypes will need to be adjusted. All that work is already done for openj9(eclipse-openj9/openj9#14513).
@gita-omr

Copy link
Copy Markdown
Contributor Author

Fixed another use of an old vector type that was merged recently.

@BradleyWood

Copy link
Copy Markdown
Contributor

Jenkins build all

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.

7 participants