File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+ ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3+ ; RUN: | FileCheck %s -check-prefix=RV32I
4+ ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5+ ; RUN: | FileCheck %s -check-prefix=RV64I
6+
7+ define i32 @and_0xfff_shl_2 (i32 %x ) {
8+ ; RV32I-LABEL: and_0xfff_shl_2:
9+ ; RV32I: # %bb.0:
10+ ; RV32I-NEXT: slli a0, a0, 20
11+ ; RV32I-NEXT: srli a0, a0, 20
12+ ; RV32I-NEXT: slli a0, a0, 2
13+ ; RV32I-NEXT: ret
14+ ;
15+ ; RV64I-LABEL: and_0xfff_shl_2:
16+ ; RV64I: # %bb.0:
17+ ; RV64I-NEXT: slli a0, a0, 52
18+ ; RV64I-NEXT: srli a0, a0, 52
19+ ; RV64I-NEXT: slli a0, a0, 2
20+ ; RV64I-NEXT: ret
21+ %a = and i32 %x , 4095
22+ %s = shl i32 %a , 2
23+ ret i32 %s
24+ }
You can’t perform that action at this time.
0 commit comments