/*
 * 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_INCLUDE_SOFTRVV_VMFLT_H_
#define SOFTRVV_INCLUDE_SOFTRVV_VMFLT_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 vmflt_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 vmflt_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_INCLUDE_SOFTRVV_VMFLT_H_
