[Clang][SME2] Enable multi-vector loads & stores for SME2 (#75821)
[llvm-project.git] / compiler-rt / lib / builtins / powisf2.c
blobd0ab26167bbd2276cf1cf8bab89608380c4e47cb
1 //===-- powisf2.cpp - Implement __powisf2 ---------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements __powisf2 for the compiler_rt library.
11 //===----------------------------------------------------------------------===//
13 #include "int_lib.h"
15 // Returns: a ^ b
17 COMPILER_RT_ABI float __powisf2(float a, int b) {
18 const int recip = b < 0;
19 float r = 1;
20 while (1) {
21 if (b & 1)
22 r *= a;
23 b /= 2;
24 if (b == 0)
25 break;
26 a *= a;
28 return recip ? 1 / r : r;