1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=riscv64 -global-isel -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s --check-prefixes=RV64
5 define i16 @constant_fold_barrier_i16(i16 %x, i16 %y) {
6 ; RV64-LABEL: constant_fold_barrier_i16:
7 ; RV64: # %bb.0: # %entry
9 ; RV64-NEXT: slli a1, a1, 11
10 ; RV64-NEXT: and a0, a0, a1
11 ; RV64-NEXT: addiw a1, a1, 289
12 ; RV64-NEXT: or a0, a0, a1
15 %and = and i16 %x, 2048
16 %or = or i16 %and, 2337
20 define i128 @constant_fold_barrier_i128(i128 %x) {
21 ; RV64-LABEL: constant_fold_barrier_i128:
22 ; RV64: # %bb.0: # %entry
24 ; RV64-NEXT: slli a2, a2, 11
25 ; RV64-NEXT: and a0, a0, a2
26 ; RV64-NEXT: and a1, a1, zero
27 ; RV64-NEXT: add a0, a0, a2
28 ; RV64-NEXT: sltu a2, a0, a2
29 ; RV64-NEXT: add a1, a1, zero
30 ; RV64-NEXT: add a1, a1, a2
33 %and = and i128 %x, 2048
34 %add = add i128 %and, 2048