| /* |
| * Copyright 2023 Google LLC |
| * |
| * 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. |
| */ |
| |
| #ifndef SOFTRVV_VMFNE_H |
| #define SOFTRVV_VMFNE_H |
| |
| #include <stddef.h> |
| |
| namespace softrvv { |
| |
| // The type of dest is defined as int32_t instead of float |
| // to use "set_bit_in_dest_mask", which has bitwise operations in it. |
| void vmfne_vf(int32_t *dest, float *src2, const float *src1, int32_t avl) { |
| for (int32_t idx = 0; idx < avl; idx++) { |
| set_bit_in_dest_mask<int32_t>(idx, dest, src2[idx] != *src1); |
| } |
| } |
| |
| // The type of dest is defined as int32_t instead of float |
| // to use "set_bit_in_dest_mask", which has bitwise operations in it. |
| void vmfne_vv(int32_t *dest, float *src2, float *src1, int32_t avl) { |
| for (int32_t idx = 0; idx < avl; idx++) { |
| set_bit_in_dest_mask<int32_t>(idx, dest, src2[idx] != src1[idx]); |
| } |
| } |
| |
| } // namespace softrvv |
| |
| #endif // SOFTRVV_VMFNE_H |