|
| 1 | +//==- BuiltinsRISCVXCV.td - RISC-V CORE-V Builtin database ----*- C++ -*-==// |
| 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 defines the CORE-V-specific builtin function database. Users of |
| 10 | +// this file must define the BUILTIN macro to make use of this information. |
| 11 | +// |
| 12 | +//===----------------------------------------------------------------------===// |
| 13 | + |
| 14 | +class RISCXCVBuiltin<string prototype, string features = ""> : TargetBuiltin { |
| 15 | + let Spellings = ["__builtin_riscv_cv_" # NAME]; |
| 16 | + let Prototype = prototype; |
| 17 | + let Features = features; |
| 18 | +} |
| 19 | + |
| 20 | +let Attributes = [NoThrow, Const] in { |
| 21 | +//===----------------------------------------------------------------------===// |
| 22 | +// XCValu extension. |
| 23 | +//===----------------------------------------------------------------------===// |
| 24 | +def alu_slet : RISCXCVBuiltin<"int(int, int)", "xcvalu">; |
| 25 | +def alu_sletu : RISCXCVBuiltin<"int(unsigned int, unsigned int)", "xcvalu">; |
| 26 | +def alu_minu : RISCXCVBuiltin<"unsigned int(unsigned int, unsigned int)", "xcvalu">; |
| 27 | +def alu_maxu : RISCXCVBuiltin<"unsigned int(unsigned int, unsigned int)", "xcvalu">; |
| 28 | +def alu_exths : RISCXCVBuiltin<"int(int)", "xcvalu">; |
| 29 | +def alu_exthz : RISCXCVBuiltin<"unsigned int(unsigned int)", "xcvalu">; |
| 30 | +def alu_extbs : RISCXCVBuiltin<"int(int)", "xcvalu">; |
| 31 | +def alu_extbz : RISCXCVBuiltin<"unsigned int(unsigned int)", "xcvalu">; |
| 32 | + |
| 33 | +def alu_clip : RISCXCVBuiltin<"int(int, int)", "xcvalu">; |
| 34 | +def alu_clipu : RISCXCVBuiltin<"unsigned int(unsigned int, unsigned int)", "xcvalu">; |
| 35 | +def alu_addN : RISCXCVBuiltin<"int(int, int, unsigned int)", "xcvalu">; |
| 36 | +def alu_adduN : RISCXCVBuiltin<"unsigned int(unsigned int, unsigned int, unsigned int)", "xcvalu">; |
| 37 | +def alu_addRN : RISCXCVBuiltin<"int(int, int, unsigned int)", "xcvalu">; |
| 38 | +def alu_adduRN : RISCXCVBuiltin<"unsigned int(unsigned int, unsigned int, unsigned int)", "xcvalu">; |
| 39 | +def alu_subN : RISCXCVBuiltin<"int(int, int, unsigned int)", "xcvalu">; |
| 40 | +def alu_subuN : RISCXCVBuiltin<"unsigned int(unsigned int, unsigned int, unsigned int)", "xcvalu">; |
| 41 | +def alu_subRN : RISCXCVBuiltin<"int(int, int, unsigned int)", "xcvalu">; |
| 42 | +def alu_subuRN : RISCXCVBuiltin<"unsigned int(unsigned int, unsigned int, unsigned int)", "xcvalu">; |
| 43 | +} // Attributes = [NoThrow, Const] |
0 commit comments