Ignore:
Timestamp:
Mar 3, 2012, 1:37:28 PM (7 years ago)
Author:
cameron
Message:

Updates for AVX, reverted casts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/idisa_cpp/idisa_neon.cpp

    r1884 r1953  
    795795template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::srli(bitblock128_t arg1)
    796796{
    797         return ((sh == 0) ? arg1 : reinterpret_cast<bitblock128_t>(vshrq_n_u8((uint8x16_t)(arg1), (int32_t)(sh))));
     797        return ((sh == 0) ? arg1 : ((bitblock128_t)(vshrq_n_u8((uint8x16_t)(arg1), (int32_t)(sh)))));
    798798}
    799799
     
    801801template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::srli(bitblock128_t arg1)
    802802{
    803         return ((sh == 0) ? arg1 : reinterpret_cast<bitblock128_t>(vshrq_n_u16((uint16x8_t)(arg1), (int32_t)(sh))));
     803        return ((sh == 0) ? arg1 : ((bitblock128_t)(vshrq_n_u16((uint16x8_t)(arg1), (int32_t)(sh)))));
    804804}
    805805
     
    807807template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::srli(bitblock128_t arg1)
    808808{
    809         return ((sh == 0) ? arg1 : reinterpret_cast<bitblock128_t>(vshrq_n_u32((uint32x4_t)(arg1), (int32_t)(sh))));
     809        return ((sh == 0) ? arg1 : ((bitblock128_t)(vshrq_n_u32((uint32x4_t)(arg1), (int32_t)(sh)))));
    810810}
    811811
     
    813813template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srli(bitblock128_t arg1)
    814814{
    815         return ((sh == 0) ? arg1 : reinterpret_cast<bitblock128_t>(vshrq_n_u64((uint64x2_t)(arg1), (int32_t)(sh))));
     815        return ((sh == 0) ? arg1 : ((bitblock128_t)(vshrq_n_u64((uint64x2_t)(arg1), (int32_t)(sh)))));
    816816}
    817817
     
    10791079template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::slli(bitblock128_t arg1)
    10801080{
    1081         return ((sh == 8) ? simd128<32>::constant<0>() : reinterpret_cast<bitblock128_t>(vshlq_n_u8((uint8x16_t)(arg1), (int32_t)(sh))));
     1081        return ((sh == 8) ? simd128<32>::constant<0>() : ((bitblock128_t)(vshlq_n_u8((uint8x16_t)(arg1), (int32_t)(sh)))));
    10821082}
    10831083
     
    10851085template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::slli(bitblock128_t arg1)
    10861086{
    1087         return ((sh == 16) ? simd128<32>::constant<0>() : reinterpret_cast<bitblock128_t>(vshlq_n_u16((uint16x8_t)(arg1), (int32_t)(sh))));
     1087        return ((sh == 16) ? simd128<32>::constant<0>() : ((bitblock128_t)(vshlq_n_u16((uint16x8_t)(arg1), (int32_t)(sh)))));
    10881088}
    10891089
     
    10911091template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::slli(bitblock128_t arg1)
    10921092{
    1093         return ((sh == 32) ? simd128<32>::constant<0>() : reinterpret_cast<bitblock128_t>(vshlq_n_u32((uint32x4_t)(arg1), (int32_t)(sh))));
     1093        return ((sh == 32) ? simd128<32>::constant<0>() : ((bitblock128_t)(vshlq_n_u32((uint32x4_t)(arg1), (int32_t)(sh)))));
    10941094}
    10951095
     
    10971097template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::slli(bitblock128_t arg1)
    10981098{
    1099         return ((sh == 64) ? simd128<32>::constant<0>() : reinterpret_cast<bitblock128_t>(vshlq_n_u64((uint64x2_t)(arg1), (int32_t)(sh))));
     1099        return ((sh == 64) ? simd128<32>::constant<0>() : ((bitblock128_t)(vshlq_n_u64((uint64x2_t)(arg1), (int32_t)(sh)))));
    11001100}
    11011101
     
    15691569template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::srai(bitblock128_t arg1)
    15701570{
    1571         return ((sh == 0) ? arg1 : reinterpret_cast<bitblock128_t>(vshrq_n_s8((int8x16_t)(arg1), (int32_t)(sh))));
     1571        return ((sh == 0) ? arg1 : ((bitblock128_t)(vshrq_n_s8((int8x16_t)(arg1), (int32_t)(sh)))));
    15721572}
    15731573
     
    15751575template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::srai(bitblock128_t arg1)
    15761576{
    1577         return ((sh == 0) ? arg1 : reinterpret_cast<bitblock128_t>(vshrq_n_s16((int16x8_t)(arg1), (int32_t)(sh))));
     1577        return ((sh == 0) ? arg1 : ((bitblock128_t)(vshrq_n_s16((int16x8_t)(arg1), (int32_t)(sh)))));
    15781578}
    15791579
     
    15811581template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::srai(bitblock128_t arg1)
    15821582{
    1583         return ((sh == 0) ? arg1 : reinterpret_cast<bitblock128_t>(vshrq_n_s32((int32x4_t)(arg1), (int32_t)(sh))));
     1583        return ((sh == 0) ? arg1 : ((bitblock128_t)(vshrq_n_s32((int32x4_t)(arg1), (int32_t)(sh)))));
    15841584}
    15851585
     
    15871587template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srai(bitblock128_t arg1)
    15881588{
    1589         return ((sh == 0) ? arg1 : reinterpret_cast<bitblock128_t>(vshrq_n_s64((int64x2_t)(arg1), (int32_t)(sh))));
     1589        return ((sh == 0) ? arg1 : ((bitblock128_t)(vshrq_n_s64((int64x2_t)(arg1), (int32_t)(sh)))));
    15901590}
    15911591
Note: See TracChangeset for help on using the changeset viewer.