|
| 1 | +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 | +// RUN: %clang_cc1 -triple riscv32 -target-feature +xcvalu -emit-llvm %s -o - \ |
| 3 | +// RUN: | FileCheck %s |
| 4 | + |
| 5 | +#include <stdint.h> |
| 6 | +#include <riscv_corev_alu.h> |
| 7 | + |
| 8 | +// CHECK-LABEL: @test_alu_slet |
| 9 | +// CHECK: @llvm.riscv.cv.alu.slet |
| 10 | +int test_alu_slet(int32_t a, int32_t b) { |
| 11 | + return __riscv_cv_alu_slet(a, b); |
| 12 | +} |
| 13 | + |
| 14 | +// CHECK-LABEL: @test_alu_sletu |
| 15 | +// CHECK: @llvm.riscv.cv.alu.sletu |
| 16 | +int test_alu_sletu(uint32_t a, uint32_t b) { |
| 17 | + return __riscv_cv_alu_sletu(a, b); |
| 18 | +} |
| 19 | + |
| 20 | +// CHECK-LABEL: @test_alu_min |
| 21 | +// CHECK: @llvm.riscv.cv.alu.min |
| 22 | +int test_alu_min(int32_t a, int32_t b) { |
| 23 | + return __riscv_cv_alu_min(a, b); |
| 24 | +} |
| 25 | + |
| 26 | +// CHECK-LABEL: @test_alu_minu |
| 27 | +// CHECK: @llvm.riscv.cv.alu.minu |
| 28 | +int test_alu_minu(uint32_t a, uint32_t b) { |
| 29 | + return __riscv_cv_alu_minu(a, b); |
| 30 | +} |
| 31 | + |
| 32 | +// CHECK-LABEL: @test_alu_max |
| 33 | +// CHECK: @llvm.riscv.cv.alu.max |
| 34 | +int test_alu_max(int32_t a, int32_t b) { |
| 35 | + return __riscv_cv_alu_max(a, b); |
| 36 | +} |
| 37 | + |
| 38 | +// CHECK-LABEL: @test_alu_maxu |
| 39 | +// CHECK: @llvm.riscv.cv.alu.maxu |
| 40 | +int test_alu_maxu(uint32_t a, uint32_t b) { |
| 41 | + return __riscv_cv_alu_maxu(a, b); |
| 42 | +} |
| 43 | + |
| 44 | +// CHECK-LABEL: @test_alu_exths |
| 45 | +// CHECK: @llvm.riscv.cv.alu.exths |
| 46 | +int test_alu_exths(int16_t a) { |
| 47 | + return __riscv_cv_alu_exths(a); |
| 48 | +} |
| 49 | + |
| 50 | +// CHECK-LABEL: @test_alu_exthz |
| 51 | +// CHECK: @llvm.riscv.cv.alu.exthz |
| 52 | +int test_alu_exthz(uint16_t a) { |
| 53 | + return __riscv_cv_alu_exthz(a); |
| 54 | +} |
| 55 | + |
| 56 | +// CHECK-LABEL: @test_alu_extbs |
| 57 | +// CHECK: @llvm.riscv.cv.alu.extbs |
| 58 | +int test_alu_extbs(int8_t a) { |
| 59 | + return __riscv_cv_alu_extbs(a); |
| 60 | +} |
| 61 | + |
| 62 | +// CHECK-LABEL: @test_alu_extbz |
| 63 | +// CHECK: @llvm.riscv.cv.alu.extbz |
| 64 | +int test_alu_extbz(uint8_t a) { |
| 65 | + return __riscv_cv_alu_extbz(a); |
| 66 | +} |
| 67 | + |
| 68 | +// CHECK-LABEL: @test_alu_clip |
| 69 | +// CHECK: @llvm.riscv.cv.alu.clip |
| 70 | +int test_alu_clip(int32_t a) { |
| 71 | + return __riscv_cv_alu_clip(a, 0); |
| 72 | +} |
| 73 | + |
| 74 | +// CHECK-LABEL: @test_alu_clipu |
| 75 | +// CHECK: @llvm.riscv.cv.alu.clipu |
| 76 | +int test_alu_clipu(uint32_t a) { |
| 77 | + return __riscv_cv_alu_clipu(a, 0); |
| 78 | +} |
| 79 | + |
| 80 | +// CHECK-LABEL: @test_alu_addN |
| 81 | +// CHECK: @llvm.riscv.cv.alu.addN |
| 82 | +int test_alu_addN(int32_t a, int32_t b) { |
| 83 | + return __riscv_cv_alu_addN(a, b, 0); |
| 84 | +} |
| 85 | + |
| 86 | +// CHECK-LABEL: @test_alu_adduN |
| 87 | +// CHECK: @llvm.riscv.cv.alu.adduN |
| 88 | +int test_alu_adduN(uint32_t a, uint32_t b) { |
| 89 | + return __riscv_cv_alu_adduN(a, b, 0); |
| 90 | +} |
| 91 | + |
| 92 | +// CHECK-LABEL: @test_alu_addRN |
| 93 | +// CHECK: @llvm.riscv.cv.alu.addRN |
| 94 | +int test_alu_addRN(int32_t a, int32_t b) { |
| 95 | + return __riscv_cv_alu_addRN(a, b, 0); |
| 96 | +} |
| 97 | + |
| 98 | +// CHECK-LABEL: @test_alu_adduRN |
| 99 | +// CHECK: @llvm.riscv.cv.alu.adduRN |
| 100 | +int test_alu_adduRN(uint32_t a, uint32_t b) { |
| 101 | + return __riscv_cv_alu_adduRN(a, b, 0); |
| 102 | +} |
| 103 | + |
| 104 | +// CHECK-LABEL: @test_alu_subN |
| 105 | +// CHECK: @llvm.riscv.cv.alu.subN |
| 106 | +int test_alu_subN(int32_t a, int32_t b) { |
| 107 | + return __riscv_cv_alu_subN(a, b, 0); |
| 108 | +} |
| 109 | + |
| 110 | +// CHECK-LABEL: @test_alu_subuN |
| 111 | +// CHECK: @llvm.riscv.cv.alu.subuN |
| 112 | +int test_alu_subuN(uint32_t a, uint32_t b) { |
| 113 | + return __riscv_cv_alu_subuN(a, b, 0); |
| 114 | +} |
| 115 | + |
| 116 | +// CHECK-LABEL: @test_alu_subRN |
| 117 | +// CHECK: @llvm.riscv.cv.alu.subRN |
| 118 | +int test_alu_subRN(int32_t a, int32_t b) { |
| 119 | + return __riscv_cv_alu_subRN(a, b, 0); |
| 120 | +} |
| 121 | + |
| 122 | +// CHECK-LABEL: @test_alu_subuRN |
| 123 | +// CHECK: @llvm.riscv.cv.alu.subuRN |
| 124 | +int test_alu_subuRN(uint32_t a, uint32_t b) { |
| 125 | + return __riscv_cv_alu_subuRN(a, b, 0); |
| 126 | +} |
0 commit comments