1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc < %s -mtriple=riscv64 -mattr=+m,+zba,+zbb,+zcb | FileCheck %s
4 define i64 @c_not(i64 %x, i64 %y, i64 %z) {
7 ; CHECK-NEXT: not a1, a1
8 ; CHECK-NEXT: li a0, 1234
9 ; CHECK-NEXT: mul a0, a0, a1
16 define i64 @c_mul(i64 %x, i64 %y, i64 %z, i64 %w) {
19 ; CHECK-NEXT: mul a1, a1, a2
20 ; CHECK-NEXT: lui a0, 1
21 ; CHECK-NEXT: or a0, a0, a1
28 define i64 @c_sext_b(i64 %x, i8 %y, i64 %z) {
29 ; CHECK-LABEL: c_sext_b:
31 ; CHECK-NEXT: sext.b a1, a1
32 ; CHECK-NEXT: lui a0, 1
33 ; CHECK-NEXT: or a0, a0, a1
35 %a = sext i8 %y to i64
40 define i64 @c_sext_h(i64 %x, i16 %y, i64 %z) {
41 ; CHECK-LABEL: c_sext_h:
43 ; CHECK-NEXT: sext.h a1, a1
44 ; CHECK-NEXT: lui a0, 1
45 ; CHECK-NEXT: or a0, a0, a1
47 %a = sext i16 %y to i64
52 define i64 @c_zext_b(i64 %x, i8 %y, i64 %z) {
53 ; CHECK-LABEL: c_zext_b:
55 ; CHECK-NEXT: andi a1, a1, 255
56 ; CHECK-NEXT: lui a0, 1
57 ; CHECK-NEXT: or a0, a0, a1
59 %a = zext i8 %y to i64
64 define i64 @c_zext_h(i64 %x, i16 %y) {
65 ; CHECK-LABEL: c_zext_h:
67 ; CHECK-NEXT: zext.h a1, a1
68 ; CHECK-NEXT: lui a0, 4096
69 ; CHECK-NEXT: or a0, a0, a1
71 %a = zext i16 %y to i64
72 %b = or i64 %a, 16777216
76 define i64 @c_zext_w(i64 %x, i32 %y) {
77 ; CHECK-LABEL: c_zext_w:
79 ; CHECK-NEXT: zext.w a1, a1
80 ; CHECK-NEXT: li a0, 1234
81 ; CHECK-NEXT: mul a0, a0, a1
83 %a = zext i32 %y to i64