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

Relaxed type casting #571

Closed
aqrit opened this issue Dec 26, 2022 · 2 comments
Closed

Relaxed type casting #571

aqrit opened this issue Dec 26, 2022 · 2 comments

Comments

@aqrit
Copy link
Contributor

aqrit commented Dec 26, 2022

From RenderKit/embree#410

I haven't checked with a compiler but these lines (from 72daa0f) seem lax:

sse2neon.h:580:    return vget_lane_u32((uint32x2_t) o, 0); /// uint16_t
sse2neon.h:2486:    return vsetq_lane_f32(vgetq_lane_f32(_mm_rsqrt_ps(in), 0), in, 0); /// __m128
sse2neon.h:3151:    return vld1q_f32((float32_t *) c); /// __m128d
sse2neon.h:3173:    return vld1q_f32((float32_t *) c); /// __m128d
sse2neon.h:3303:    return (__m128i) vrhaddq_u16(vreinterpretq_u16_m128i(a), /// C-style cast
sse2neon.h:4540:    return vld1q_f32((float32_t *) c); /// __m128d
sse2neon.h:5025:    return vgetq_lane_u64(high_bits, 0) | (vgetq_lane_u64(high_bits, 1) << 1); /// int
sse2neon.h:5078:    return vld1q_f32((float32_t *) c); /// __m128d
sse2neon.h:5324:    return (__m128i) vld1q_s8(data); /// C-style cast
sse2neon.h:5481:    return (__m128i) vld1q_s8(data); /// C-style cast
sse2neon.h:5868:    return (__m128i) vshlq_s16((int16x8_t) a, vdupq_n_s16(-count)); /// C-style cast
sse2neon.h:6306:    return vld1q_f32((float32_t *) c); /// __m128d
sse2neon.h:7011:    return vreinterpretq_s64_s16( /// __m128i
sse2neon.h:7034:    return vreinterpret_s64_s16(vqadd_s16(vuzp1_s16(a, b), vuzp2_s16(a, b))); /// __m64
sse2neon.h:7037:    return vreinterpret_s64_s16(vqadd_s16(res.val[0], res.val[1])); /// __m64
@jserv
Copy link
Member

jserv commented Dec 31, 2022

Recent embree enforces -flax-vector-conversions option which allows implicit conversions between vectors with differing numbers of elements and/or incompatible element types. According to GCC manual, this option should not be used for new code.

@jserv
Copy link
Member

jserv commented Jan 5, 2024

Duplicated with #614

@jserv jserv closed this as completed Jan 5, 2024
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

No branches or pull requests

2 participants