-
Notifications
You must be signed in to change notification settings - Fork 168
[CIR] Added support for __builtin_ia32_pslldqi_byteshift
#1883
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
[CIR] Added support for __builtin_ia32_pslldqi_byteshift
#1883
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs some documentation in the codegen handling, and a couple of nits. There are a lot of tests and I don't see how all of them are necessary. Some are also underspecified to the point where they don't check what they claim to check.
// CHECK-LABEL: @_Z23test_pslldqi128_shift20Dv2_x | ||
__m128i test_pslldqi128_shift20(__m128i a) { | ||
// Should also return zero | ||
// CHECK: %{{.*}} = cir.const #cir.zero : !cir.vector<!s64i x 2> | ||
return __builtin_ia32_pslldqi128_byteshift(a, 20); | ||
} | ||
|
||
// CHECK-LABEL: @_Z28test_pslldqi128_masked_shiftDv2_x | ||
__m128i test_pslldqi128_masked_shift(__m128i a) { | ||
// 250 > 16, so should return zero | ||
// CHECK: %{{.*}} = cir.const #cir.zero : !cir.vector<!s64i x 2> | ||
return __builtin_ia32_pslldqi128_byteshift(a, 250); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we need both of these tests?
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir -target-feature +avx512f | ||
// RUN: FileCheck --input-file=%t.cir %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add cir-to-llvm (LLVM
) and OG codegen (OGCG
) tests?
Closes #1880 |
lgtm, after @tommymcm comments are resolved |
fc93690
to
011131f
Compare
// LLVM: store <2 x i64> zeroinitializer, ptr %{{.*}}, align 16 | ||
// OGCG: ret <2 x i64> zeroinitializer | ||
return __builtin_ia32_pslldqi128_byteshift(a, 240); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should still keep this test? I do agree the tests previously was redundant, but I only did so for the sake of stress testing my implementation in order to make sure we catch the issues now rather than later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
**Related Issue**: llvm#1880
Related Issue: #1880