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

Logical & TruncConv Ops + Tests #3288

Merged
merged 4 commits into from Jul 13, 2017

Conversation

Krovatkin
Copy link
Collaborator

@Krovatkin Krovatkin commented Jul 5, 2017

This PR includes

  • logical operations + tests
  • truncation & conversion operations for 32x4 types + tests

This change is Reviewable

@Krovatkin
Copy link
Collaborator Author

@Cellule @MikeHolman I'll ping you guys later about this PR when all the tests pass
fyi @arunetm

@Krovatkin
Copy link
Collaborator Author

Krovatkin commented Jul 5, 2017

@chakrabot Please test Ubuntu shared_ubuntu_linux_debug

@Krovatkin
Copy link
Collaborator Author

@Cellule Could you please take a look when you have a moment?

@MikeHolman
Copy link
Contributor

I think nonstandard true values will be broken. Currently, if a lane is non-zero it is considered true. Lowering code uses PMOVMSKB, which only looks at the most significant bit of each byte.

https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#boolean-horizontal-reductions

@Krovatkin
Copy link
Collaborator Author

@MikeHolman absolutely! will fix!

@Krovatkin Krovatkin force-pushed the wasm.simd.logical branch 3 times, most recently from c7fdc4c to 1853d77 Compare July 7, 2017 19:19
@Krovatkin
Copy link
Collaborator Author

@chakrabot Please test Windows ci_slow_x64_debug

@Krovatkin
Copy link
Collaborator Author

@arunetm okay

@Krovatkin
Copy link
Collaborator Author

@MikeHolman Looks like we should be able to handle non-canonical boolean values now.

@Krovatkin
Copy link
Collaborator Author

@MikeHolman @Cellule Hey guys! Could you please take another look? I'd like to push this one and 2 more then I'll rebase wasm.simd as @Cellule suggested.

@Cellule
Copy link
Contributor

Cellule commented Jul 12, 2017

Reviewed 9 of 11 files at r1, 8 of 8 files at r2.
Review status: all files reviewed at latest revision, 4 unresolved discussions.


lib/Backend/LowerMDShared.h, line 374 at r2 (raw file):

    IR::Instr*          Simd128LowerAnyTrue(IR::Instr* instr);
    IR::Instr*          Simd128LowerAllTrue(IR::Instr* instr);
#ifdef ENABLE_WASM

Could we start using a different #define for wasm.simd ? Just so we can more easily organize what's what.
Something like ENABLE_WASM_SIMD. I thin that will also help the transition to remove simd.js and keep what we need for wasm.


lib/Backend/LowerMDSharedSimd128.cpp, line 2273 at r2 (raw file):

    if (m_func->GetJITFunctionBody()->IsWasmFunction())
    {
        Js::OpCode spreadOpCode = Js::OpCode::InvalidOpCode;

nit: could we name this cmpOpcode to match how we use it


lib/Runtime/Language/SimdBool32x4Operation.cpp, line 45 at r2 (raw file):

    }

    template bool SIMDBool32x4Operation::OpAllTrue<int>(const SIMDValue& val);

nit: I would prefer use int32, int16, int8 instead of int, short, char


lib/Runtime/Language/SimdUtils.h, line 335 at r2 (raw file):

        {
#ifdef ENABLE_WASM
            T* cursor = (T*)val.i8;

I would add some CompileAssert here

            CompileAssert(sizeof(T) <= sizeof(SIMDValue));
            CompileAssert(sizeof(SIMDValue) % sizeof(T) == 0);
            T* cursor = (T*)val.i8;
            uint size = sizeof(SIMDValue) / sizeof(T);

Comments from Reviewable

@Cellule
Copy link
Contributor

Cellule commented Jul 13, 2017

:lgtm:


Reviewed 6 of 6 files at r3.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@Krovatkin
Copy link
Collaborator Author

@arunetm Could you please merge this PR?

@chakrabot chakrabot merged commit cff6be7 into chakra-core:wasm.simd Jul 13, 2017
chakrabot pushed a commit that referenced this pull request Jul 13, 2017
Merge pull request #3288 from Krovatkin:wasm.simd.logical

This PR includes

* logical operations + tests
* truncation & conversion operations for 32x4 types + tests
@Krovatkin
Copy link
Collaborator Author

@Cellule , Thanks a lot for your help!

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

Successfully merging this pull request may close these issues.

None yet

5 participants