/* * Copyright (c) 2015 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Copyright (c) 2005 Eliot Dresselhaus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef included_vector_sse2_h #define included_vector_sse2_h #include /* for ASSERT */ #include /* 128 bit interleaves. */ always_inline u8x16 u8x16_interleave_hi (u8x16 a, u8x16 b) { return (u8x16) _mm_unpackhi_epi8 ((__m128i) a, (__m128i) b); } always_inline u8x16 u8x16_interleave_lo (u8x16 a, u8x16 b) { return (u8x16) _mm_unpacklo_epi8 ((__m128i) a, (__m128i) b); } always_inline u16x8 u16x8_interleave_hi (u16x8 a, u16x8 b) { return (u16x8) _mm_unpackhi_epi16 ((__m128i) a, (__m128i) b); } always_inline u16x8 u16x8_interleave_lo (u16x8 a, u16x8 b) { return (u16x8) _mm_unpacklo_epi16 ((__m128i) a, (__m128i) b); } always_inline u32x4 u32x4_interleave_hi (u32x4 a, u32x4 b) { return (u32x4) _mm_unpackhi_epi32 ((__m128i) a, (__m128i) b); } always_inline u32x4 u32x4_interleave_lo (u32x4 a, u32x4 b) { return (u32x4) _mm_unpacklo_epi32 ((__m128i) a, (__m128i) b); } always_inline u64x2 u64x2_interleave_hi (u64x2 a, u64x2 b) { return (u64x2) _mm_unpackhi_epi64 ((__m128i) a, (__m128i) b); } always_inline u64x2 u64x2_interleave_lo (u64x2 a, u64x2 b) { return (u64x2) _mm_unpacklo_epi64 ((__m128i) a, (__m128i) b); } /* 64 bit interleaves. */ always_inline u8x8 u8x8_interleave_hi (u8x8 a, u8x8 b) { return (u8x8) _m_punpckhbw ((__m64) a, (__m64) b); } always_inline u8x8 u8x8_interleave_lo (u8x8 a, u8x8 b) { return (u8x8) _m_punpcklbw ((__m64) a, (__m64) b); } always_inline u16x4 u16x4_interleave_hi (u16x4 a, u16x4 b) { return (u16x4) _m_punpckhwd ((__m64) a, (__m64) b); } always_inline u16x4 u16x4_interleave_lo (u16x4 a, u16x4 b) { return (u16x4) _m_punpcklwd ((__m64) a, (__m64) b); } always_inline u32x2 u32x2_interleave_hi (u32x2 a, u32x2 b) { return (u32x2) _m_punpckhdq ((__m64) a, (__m64) b); } always_inline u32x2 u32x2_interleave_lo (u32x2 a, u32x2 b) { return (u32x2) _m_punpckldq ((__m64) a, (__m64) b); } /* 128 bit packs. */ always_inline u8x16 u16x8_pack (u16x8 lo, u16x8 hi) { return (u8x16) _mm_packus_epi16 ((__m128i) lo, (__m128i) hi); } always_inline i8x16 i16x8_pack (i16x8 lo, i16x8 hi) { return (i8x16) _mm_packs_epi16 ((__m128i) lo, (__m128i) hi); } always_inline u16x8 u32x4_pack (u32x4 lo, u32x4 hi) { return (u16x8) _mm_packs_epi32 ((__m128i) lo, (__m128i) hi); } /* 64 bit packs. */ always_inline u8x8 u16x4_pack (u16x4 lo, u16x4 hi) { return (u8x8) _m_packuswb ((__m64) lo, (__m64) hi); } always_inline i8x8 i16x4_pack (i16x4 lo, i16x4 hi) { return (i8x8) _m_packsswb ((__m64) lo, (__m64) hi); } always_inline u16x4 u32x2_pack (u32x2 lo, u32x2 hi) { return (u16x4) _m_packssdw ((__m64) lo, (__m64) hi); } always_inline i16x4 i32x2_pack (i32x2 lo, i32x2 hi) { return (i16x4) _m_packssdw ((__m64) lo, (__m64) hi); } /* Splats: replicate scalar value into vector. */ always_inline u64x2 u64x2_splat (u64 a) { u64x2 x = { a, a }; return x; } always_inline u32x4 u32x4_splat (u32 a) { u32x4 x = { a, a, a, a }; return x; } always_inline u16x8 u16x8_splat (u16 a) { u16x8 x = { a, a, a, a, a, a, a, a }; return x; } always_inline u8x16 u8x16_splat (u8 a) { u8x16 x = { a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a }; return x; } always_inline u32x2 u32x2_splat (u32 a) { u32x2 x = { a, a }; return x; } always_inline u16x4 u16x4_splat (u16 a) { u16x4 x = { a, a, a, a }; return x; } always_inline u8x8 u8x8_splat (u8 a) { u8x8 x = { a, a, a, a, a, a, a, a }; return x; } #define i64x2_splat u64x2_splat #define i32x4_splat u32x4_splat #define i16x8_splat u16x8_splat #define i8x16_splat u8x16_splat #define i32x2_splat u32x2_splat #define i16x4_splat u16x4_splat #define i8x8_splat u8x8_splat #ifndef __ICC always_inline u64x2 u64x2_read_lo (u64x2 x, u64 * a) { return (u64x2) _mm_loadl_pi ((__m128) x, (__m64 *) a); } always_inline u64x2 u64x2_read_hi (u64x2 x, u64 * a) { return (u64x2) _mm_loadh_pi ((__m128) x, (__m64 *) a); } always_inline void u64x2_write_lo (u64x2 x, u64 * a) { _mm_storel_pi ((__m64 *) a, (__m128) x); } always_inline void u64x2_write_hi (u64x2 x, u64 * a) { _mm_storeh_pi ((__m64 *) a, (__m128) x); } #endif /* Unaligned loads/stores. */ #define _(t) \ always
/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2017 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

option version = "1.0.0";

/*  API to control ioam caching */

autoreply define ioam_cache_ip6_enable_disable {
    /* Client identifier, set from api_main.my_client_index */
    u32 client_index;

    /* Arbitrary context, so client can match reply to request */
    u32 context;

    /* Enable / disable the feature */
    u8 is_disable;

};
(x, 1)); return _mm_extract_epi16 ((__m128i) x, 0) & 0xff; } always_inline i16x8 i16x8_max (i16x8 x, i16x8 y) { return (i16x8) _mm_max_epi16 ((__m128i) x, (__m128i) y); } always_inline i16 i16x8_max_scalar (i16x8 x) { x = i16x8_max (x, i16x8_word_shift_right (x, 4)); x = i16x8_max (x, i16x8_word_shift_right (x, 2)); x = i16x8_max (x, i16x8_word_shift_right (x, 1)); return _mm_extract_epi16 ((__m128i) x, 0); } always_inline i16x8 i16x8_min (i16x8 x, i16x8 y) { return (i16x8) _mm_min_epi16 ((__m128i) x, (__m128i) y); } always_inline i16 i16x8_min_scalar (i16x8 x) { x = i16x8_min (x, i16x8_word_shift_right (x, 4)); x = i16x8_min (x, i16x8_word_shift_right (x, 2)); x = i16x8_min (x, i16x8_word_shift_right (x, 1)); return _mm_extract_epi16 ((__m128i) x, 0); } #undef _signed_binop #endif /* included_vector_sse2_h */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */