| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -mtriple=riscv32 -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV32I | ||
| ; RUN: llc -mtriple=riscv32 -mattr=+zbb -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV32ZBB | ||
| ; RUN: llc -mtriple=riscv32 -mattr=+xtheadbb -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV32XTHEADBB | ||
| ; RUN: llc -mtriple=riscv32 -mattr=+xtheadmac -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV32XTHEADMAC | ||
| ; RUN: llc -mtriple=riscv32 -mattr=+xtheadmac -mattr=+xtheadbb -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV32XTHEAD | ||
| ; RUN: llc -mtriple=riscv64 -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV64I | ||
| ; RUN: llc -mtriple=riscv64 -mattr=+zbb -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV64ZBB | ||
| ; RUN: llc -mtriple=riscv64 -mattr=+xtheadmac -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV64XTHEADMAC | ||
| ; RUN: llc -mtriple=riscv64 -mattr=+xtheadbb -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV64XTHEADBB | ||
| ; RUN: llc -mtriple=riscv64 -mattr=+xtheadmac -mattr=+xtheadbb -mattr=+m -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV64XTHEAD | ||
|
|
||
| define i32 @f(i32 %A, i32 %B, i32 %C) { | ||
| ; RV32I-LABEL: f: | ||
| ; RV32I: # %bb.0: # %entry | ||
| ; RV32I-NEXT: mul a0, a1, a0 | ||
| ; RV32I-NEXT: slli a1, a0, 26 | ||
| ; RV32I-NEXT: srli a1, a1, 28 | ||
| ; RV32I-NEXT: slli a0, a0, 20 | ||
| ; RV32I-NEXT: srli a0, a0, 25 | ||
| ; RV32I-NEXT: mul a0, a1, a0 | ||
| ; RV32I-NEXT: add a0, a0, a2 | ||
| ; RV32I-NEXT: ret | ||
| ; | ||
| ; RV32ZBB-LABEL: f: | ||
| ; RV32ZBB: # %bb.0: # %entry | ||
| ; RV32ZBB-NEXT: mul a0, a1, a0 | ||
| ; RV32ZBB-NEXT: slli a1, a0, 26 | ||
| ; RV32ZBB-NEXT: srli a1, a1, 28 | ||
| ; RV32ZBB-NEXT: slli a0, a0, 20 | ||
| ; RV32ZBB-NEXT: srli a0, a0, 25 | ||
| ; RV32ZBB-NEXT: mul a0, a1, a0 | ||
| ; RV32ZBB-NEXT: add a0, a0, a2 | ||
| ; RV32ZBB-NEXT: ret | ||
| ; | ||
| ; RV32XTHEADBB-LABEL: f: | ||
| ; RV32XTHEADBB: # %bb.0: # %entry | ||
| ; RV32XTHEADBB-NEXT: mul a0, a1, a0 | ||
| ; RV32XTHEADBB-NEXT: slli a1, a0, 26 | ||
| ; RV32XTHEADBB-NEXT: srli a1, a1, 28 | ||
| ; RV32XTHEADBB-NEXT: slli a0, a0, 20 | ||
| ; RV32XTHEADBB-NEXT: srli a0, a0, 25 | ||
| ; RV32XTHEADBB-NEXT: mul a0, a1, a0 | ||
| ; RV32XTHEADBB-NEXT: add a0, a0, a2 | ||
| ; RV32XTHEADBB-NEXT: ret | ||
| ; | ||
| ; RV32XTHEADMAC-LABEL: f: | ||
| ; RV32XTHEADMAC: # %bb.0: # %entry | ||
| ; RV32XTHEADMAC-NEXT: mul a0, a1, a0 | ||
| ; RV32XTHEADMAC-NEXT: slli a1, a0, 26 | ||
| ; RV32XTHEADMAC-NEXT: srli a1, a1, 28 | ||
| ; RV32XTHEADMAC-NEXT: slli a0, a0, 20 | ||
| ; RV32XTHEADMAC-NEXT: srli a0, a0, 25 | ||
| ; RV32XTHEADMAC-NEXT: th.mulah a2, a1, a0 | ||
| ; RV32XTHEADMAC-NEXT: mv a0, a2 | ||
| ; RV32XTHEADMAC-NEXT: ret | ||
| ; | ||
| ; RV32XTHEAD-LABEL: f: | ||
| ; RV32XTHEAD: # %bb.0: # %entry | ||
| ; RV32XTHEAD-NEXT: mul a0, a1, a0 | ||
| ; RV32XTHEAD-NEXT: slli a1, a0, 26 | ||
| ; RV32XTHEAD-NEXT: srli a1, a1, 28 | ||
| ; RV32XTHEAD-NEXT: slli a0, a0, 20 | ||
| ; RV32XTHEAD-NEXT: srli a0, a0, 25 | ||
| ; RV32XTHEAD-NEXT: th.mulah a2, a1, a0 | ||
| ; RV32XTHEAD-NEXT: mv a0, a2 | ||
| ; RV32XTHEAD-NEXT: ret | ||
| ; | ||
| ; RV64I-LABEL: f: | ||
| ; RV64I: # %bb.0: # %entry | ||
| ; RV64I-NEXT: mulw a0, a1, a0 | ||
| ; RV64I-NEXT: slli a1, a0, 58 | ||
| ; RV64I-NEXT: srli a1, a1, 60 | ||
| ; RV64I-NEXT: slli a0, a0, 52 | ||
| ; RV64I-NEXT: srli a0, a0, 57 | ||
| ; RV64I-NEXT: mulw a0, a1, a0 | ||
| ; RV64I-NEXT: addw a0, a0, a2 | ||
| ; RV64I-NEXT: ret | ||
| ; | ||
| ; RV64ZBB-LABEL: f: | ||
| ; RV64ZBB: # %bb.0: # %entry | ||
| ; RV64ZBB-NEXT: mulw a0, a1, a0 | ||
| ; RV64ZBB-NEXT: slli a1, a0, 58 | ||
| ; RV64ZBB-NEXT: srli a1, a1, 60 | ||
| ; RV64ZBB-NEXT: slli a0, a0, 52 | ||
| ; RV64ZBB-NEXT: srli a0, a0, 57 | ||
| ; RV64ZBB-NEXT: mulw a0, a1, a0 | ||
| ; RV64ZBB-NEXT: addw a0, a0, a2 | ||
| ; RV64ZBB-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMAC-LABEL: f: | ||
| ; RV64XTHEADMAC: # %bb.0: # %entry | ||
| ; RV64XTHEADMAC-NEXT: mulw a0, a1, a0 | ||
| ; RV64XTHEADMAC-NEXT: slli a1, a0, 58 | ||
| ; RV64XTHEADMAC-NEXT: srli a1, a1, 60 | ||
| ; RV64XTHEADMAC-NEXT: slli a0, a0, 52 | ||
| ; RV64XTHEADMAC-NEXT: srli a0, a0, 57 | ||
| ; RV64XTHEADMAC-NEXT: th.mulah a2, a1, a0 | ||
| ; RV64XTHEADMAC-NEXT: mv a0, a2 | ||
| ; RV64XTHEADMAC-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADBB-LABEL: f: | ||
| ; RV64XTHEADBB: # %bb.0: # %entry | ||
| ; RV64XTHEADBB-NEXT: mulw a0, a1, a0 | ||
| ; RV64XTHEADBB-NEXT: slli a1, a0, 58 | ||
| ; RV64XTHEADBB-NEXT: srli a1, a1, 60 | ||
| ; RV64XTHEADBB-NEXT: slli a0, a0, 52 | ||
| ; RV64XTHEADBB-NEXT: srli a0, a0, 57 | ||
| ; RV64XTHEADBB-NEXT: mulw a0, a1, a0 | ||
| ; RV64XTHEADBB-NEXT: addw a0, a0, a2 | ||
| ; RV64XTHEADBB-NEXT: ret | ||
| ; | ||
| ; RV64XTHEAD-LABEL: f: | ||
| ; RV64XTHEAD: # %bb.0: # %entry | ||
| ; RV64XTHEAD-NEXT: mulw a0, a1, a0 | ||
| ; RV64XTHEAD-NEXT: slli a1, a0, 58 | ||
| ; RV64XTHEAD-NEXT: srli a1, a1, 60 | ||
| ; RV64XTHEAD-NEXT: slli a0, a0, 52 | ||
| ; RV64XTHEAD-NEXT: srli a0, a0, 57 | ||
| ; RV64XTHEAD-NEXT: th.mulah a2, a1, a0 | ||
| ; RV64XTHEAD-NEXT: mv a0, a2 | ||
| ; RV64XTHEAD-NEXT: ret | ||
| entry: | ||
| %mul = mul nsw i32 %B, %A | ||
| %0 = lshr i32 %mul, 2 | ||
| %and = and i32 %0, 15 | ||
| %1 = lshr i32 %mul, 5 | ||
| %and2 = and i32 %1, 127 | ||
| %mul3 = mul nuw nsw i32 %and, %and2 | ||
| %add = add i32 %mul3, %C | ||
| ret i32 %add | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,227 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
| ; RUN: llc -mtriple=riscv32 -mattr=+xtheadmempair -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV32XTHEADMEMPAIR | ||
| ; RUN: llc -mtriple=riscv64 -mattr=+xtheadmempair -verify-machineinstrs < %s \ | ||
| ; RUN: | FileCheck %s -check-prefix=RV64XTHEADMEMPAIR | ||
|
|
||
| define i64 @lwd(i32* %a) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: lwd: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.lwd a1, a2, (a0), 2, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: srai a3, a1, 31 | ||
| ; RV32XTHEADMEMPAIR-NEXT: srai a4, a2, 31 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV32XTHEADMEMPAIR-NEXT: sltu a1, a0, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a3, a3, a4 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a1, a3, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: lwd: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.lwd a1, a2, (a0), 2, 3 | ||
| ; RV64XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i32, i32* %a, i64 4 | ||
| %2 = load i32, i32* %1, align 4 | ||
| %3 = getelementptr i32, i32* %a, i64 5 | ||
| %4 = load i32, i32* %3, align 4 | ||
| %5 = sext i32 %2 to i64 | ||
| %6 = sext i32 %4 to i64 | ||
| %7 = add i64 %5, %6 | ||
| ret i64 %7 | ||
| } | ||
|
|
||
| define i64 @lwud(i32* %a) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: lwud: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.lwd a1, a2, (a0), 2, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV32XTHEADMEMPAIR-NEXT: sltu a1, a0, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: lwud: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.lwud a1, a2, (a0), 2, 3 | ||
| ; RV64XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i32, i32* %a, i64 4 | ||
| %2 = load i32, i32* %1, align 4 | ||
| %3 = getelementptr i32, i32* %a, i64 5 | ||
| %4 = load i32, i32* %3, align 4 | ||
| %5 = zext i32 %2 to i64 | ||
| %6 = zext i32 %4 to i64 | ||
| %7 = add i64 %5, %6 | ||
| ret i64 %7 | ||
| } | ||
|
|
||
| define i64 @ldd(i64* %a) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: ldd: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: lw a1, 32(a0) | ||
| ; RV32XTHEADMEMPAIR-NEXT: lw a2, 36(a0) | ||
| ; RV32XTHEADMEMPAIR-NEXT: lw a3, 44(a0) | ||
| ; RV32XTHEADMEMPAIR-NEXT: lw a0, 40(a0) | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a2, a2, a3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a0, a1, a0 | ||
| ; RV32XTHEADMEMPAIR-NEXT: sltu a1, a0, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a1, a2, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: ldd: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.ldd a1, a2, (a0), 2, 4 | ||
| ; RV64XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i64, i64* %a, i64 4 | ||
| %2 = load i64, i64* %1, align 8 | ||
| %3 = getelementptr i64, i64* %a, i64 5 | ||
| %4 = load i64, i64* %3, align 8 | ||
| %5 = add i64 %2, %4 | ||
| ret i64 %5 | ||
| } | ||
|
|
||
| define i64 @lwd_0(i32* %a) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: lwd_0: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.lwd a1, a2, (a0), 0, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: srai a3, a1, 31 | ||
| ; RV32XTHEADMEMPAIR-NEXT: srai a4, a2, 31 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV32XTHEADMEMPAIR-NEXT: sltu a1, a0, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a3, a3, a4 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a1, a3, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: lwd_0: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.lwd a1, a2, (a0), 0, 3 | ||
| ; RV64XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i32, i32* %a, i64 0 | ||
| %2 = load i32, i32* %1, align 4 | ||
| %3 = getelementptr i32, i32* %a, i64 1 | ||
| %4 = load i32, i32* %3, align 4 | ||
| %5 = sext i32 %2 to i64 | ||
| %6 = sext i32 %4 to i64 | ||
| %7 = add i64 %5, %6 | ||
| ret i64 %7 | ||
| } | ||
|
|
||
| define i64 @lwud_0(i32* %a) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: lwud_0: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.lwd a1, a2, (a0), 0, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV32XTHEADMEMPAIR-NEXT: sltu a1, a0, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: lwud_0: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.lwud a1, a2, (a0), 0, 3 | ||
| ; RV64XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i32, i32* %a, i64 0 | ||
| %2 = load i32, i32* %1, align 4 | ||
| %3 = getelementptr i32, i32* %a, i64 1 | ||
| %4 = load i32, i32* %3, align 4 | ||
| %5 = zext i32 %2 to i64 | ||
| %6 = zext i32 %4 to i64 | ||
| %7 = add i64 %5, %6 | ||
| ret i64 %7 | ||
| } | ||
|
|
||
| define i64 @ldd_0(i64* %a) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: ldd_0: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.lwd a1, a2, (a0), 0, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.lwd a3, a4, (a0), 1, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a2, a2, a4 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a0, a1, a3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: sltu a1, a0, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: add a1, a2, a1 | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: ldd_0: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.ldd a1, a2, (a0), 0, 4 | ||
| ; RV64XTHEADMEMPAIR-NEXT: add a0, a1, a2 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i64, i64* %a, i64 0 | ||
| %2 = load i64, i64* %1, align 8 | ||
| %3 = getelementptr i64, i64* %a, i64 1 | ||
| %4 = load i64, i64* %3, align 8 | ||
| %5 = add i64 %2, %4 | ||
| ret i64 %5 | ||
| } | ||
|
|
||
| define void @swd(i32* %a, i32 %b, i32%c) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: swd: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.swd a1, a2, (a0), 2, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: swd: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.swd a1, a2, (a0), 2, 3 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i32, i32* %a, i64 4 | ||
| store i32 %b, i32* %1, align 4 | ||
| %2 = getelementptr i32, i32* %a, i64 5 | ||
| store i32 %c, i32* %2, align 4 | ||
| ret void | ||
| } | ||
|
|
||
| define void @sdd(i64* %a, i64 %b, i64%c) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: sdd: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: sw a2, 36(a0) | ||
| ; RV32XTHEADMEMPAIR-NEXT: sw a1, 32(a0) | ||
| ; RV32XTHEADMEMPAIR-NEXT: sw a4, 44(a0) | ||
| ; RV32XTHEADMEMPAIR-NEXT: sw a3, 40(a0) | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: sdd: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.sdd a1, a2, (a0), 2, 4 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i64, i64* %a, i64 4 | ||
| store i64 %b, i64* %1, align 8 | ||
| %2 = getelementptr i64, i64* %a, i64 5 | ||
| store i64 %c, i64* %2, align 8 | ||
| ret void | ||
| } | ||
|
|
||
| define void @swd_0(i32* %a, i32 %b, i32%c) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: swd_0: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.swd a1, a2, (a0), 0, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: swd_0: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.swd a1, a2, (a0), 0, 3 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i32, i32* %a, i64 0 | ||
| store i32 %b, i32* %1, align 4 | ||
| %2 = getelementptr i32, i32* %a, i64 1 | ||
| store i32 %c, i32* %2, align 4 | ||
| ret void | ||
| } | ||
|
|
||
| define void @sdd_0(i64* %a, i64 %b, i64%c) { | ||
| ; RV32XTHEADMEMPAIR-LABEL: sdd_0: | ||
| ; RV32XTHEADMEMPAIR: # %bb.0: | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.swd a1, a2, (a0), 0, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: th.swd a3, a4, (a0), 1, 3 | ||
| ; RV32XTHEADMEMPAIR-NEXT: ret | ||
| ; | ||
| ; RV64XTHEADMEMPAIR-LABEL: sdd_0: | ||
| ; RV64XTHEADMEMPAIR: # %bb.0: | ||
| ; RV64XTHEADMEMPAIR-NEXT: th.sdd a1, a2, (a0), 0, 4 | ||
| ; RV64XTHEADMEMPAIR-NEXT: ret | ||
| %1 = getelementptr i64, i64* %a, i64 0 | ||
| store i64 %b, i64* %1, align 8 | ||
| %2 = getelementptr i64, i64* %a, i64 1 | ||
| store i64 %c, i64* %2, align 8 | ||
| ret void | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # RUN: not llvm-mc -triple riscv32 -mattr=+xtheadmempair < %s 2>&1 | FileCheck %s | ||
|
|
||
| th.ldd t0, t1, (t2), 5, 4 # CHECK: [[@LINE]]:22: error: invalid operand for instruction | ||
| th.ldd t0, t1, (t2) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.ldd t0, t1, (t2), 3, 5 # CHECK: [[@LINE]]:1: error: instruction requires the following: RV64I Base Instruction Set{{$}} | ||
| th.sdd a0, a1, (a2), 5, 4 # CHECK: [[@LINE]]:22: error: invalid operand for instruction | ||
| th.sdd a0, a1, (a2) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.sdd a0, a1, (a2), 3, 5 # CHECK: [[@LINE]]:1: error: instruction requires the following: RV64I Base Instruction Set{{$}} | ||
| th.lwud t0, t1, (t2), 5, 4 # CHECK: [[@LINE]]:23: error: immediate must be an integer in the range [0, 3] | ||
| th.lwud t0, t1, (t2) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.lwud t0, t1, (t2), 3, 5 # CHECK: [[@LINE]]:26: error: Operand must be constant 3. | ||
| th.lwd a3, a4, (a5), 5, 4 # CHECK: [[@LINE]]:22: error: immediate must be an integer in the range [0, 3] | ||
| th.lwd a3, a4, (a5) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.lwd a3, a4, (a5), 3, 5 # CHECK: [[@LINE]]:25: error: Operand must be constant 3. | ||
| th.swd t3, t4, (t5), 5, 4 # CHECK: [[@LINE]]:22: error: immediate must be an integer in the range [0, 3] | ||
| th.swd t3, t4, (t5) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.swd t3, t4, (t5), 3, 5 # CHECK: [[@LINE]]:25: error: Operand must be constant 3. | ||
| th.lwud x6, x6, (x6), 2, 3 # CHECK: [[@LINE]]:9: error: The source register and destination registers cannot be equal. | ||
| th.ldd t0, t1, (t2), 2, 4 # CHECK: [[@LINE]]:1: error: instruction requires the following: RV64I Base Instruction Set{{$}} | ||
| th.sdd t0, t1, (t2), 2, 4 # CHECK: [[@LINE]]:1: error: instruction requires the following: RV64I Base Instruction Set{{$}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # With Bitmanip base extension: | ||
| # RUN: llvm-mc %s -triple=riscv32 -mattr=+xtheadmempair -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+xtheadmempair < %s \ | ||
| # RUN: | llvm-objdump --mattr=+xtheadmempair -d -r - \ | ||
| # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: th.lwd | ||
| # CHECK-ASM: encoding: [0x0b,0x45,0xb6,0xe2] | ||
| th.lwd a0, a1, (a2), 1, 3 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: th.lwud | ||
| # CHECK-ASM: encoding: [0x0b,0x45,0xb6,0xf4] | ||
| th.lwud a0, a1, (a2), 2, 3 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: th.swd | ||
| # CHECK-ASM: encoding: [0x0b,0x55,0xb6,0xe0] | ||
| th.swd a0, a1, (a2), 0, 3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # RUN: not llvm-mc -triple riscv64 -mattr=+xtheadmempair < %s 2>&1 | FileCheck %s | ||
|
|
||
| th.ldd t0, t1, (t2), 5, 4 # CHECK: [[@LINE]]:22: error: immediate must be an integer in the range [0, 3] | ||
| th.ldd t0, t1, (t2) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.ldd t0, t1, (t2), 3, 5 # CHECK: [[@LINE]]:25: error: Operand must be constant 4. | ||
| th.sdd a0, a1, (a2), 5, 4 # CHECK: [[@LINE]]:22: error: immediate must be an integer in the range [0, 3] | ||
| th.sdd a0, a1, (a2) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.sdd a0, a1, (a2), 3, 5 # CHECK: [[@LINE]]:25: error: Operand must be constant 4. | ||
| th.lwud t0, t1, (t2), 5, 4 # CHECK: [[@LINE]]:23: error: immediate must be an integer in the range [0, 3] | ||
| th.lwud t0, t1, (t2) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.lwud t0, t1, (t2), 3, 5 # CHECK: [[@LINE]]:26: error: Operand must be constant 3. | ||
| th.lwd a3, a4, (a5), 5, 4 # CHECK: [[@LINE]]:22: error: immediate must be an integer in the range [0, 3] | ||
| th.lwd a3, a4, (a5) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.lwd a3, a4, (a5), 3, 5 # CHECK: [[@LINE]]:25: error: Operand must be constant 3. | ||
| th.swd t3, t4, (t5), 5, 4 # CHECK: [[@LINE]]:22: error: immediate must be an integer in the range [0, 3] | ||
| th.swd t3, t4, (t5) # CHECK: [[@LINE]]:1: error: too few operands for instruction | ||
| th.swd t3, t4, (t5), 3, 5 # CHECK: [[@LINE]]:25: error: Operand must be constant 3. | ||
| th.lwud x6, x6, (x6), 2, 3 # CHECK: [[@LINE]]:9: error: The source register and destination registers cannot be equal. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # With Bitmanip base extension: | ||
| # RUN: llvm-mc %s -triple=riscv64 -mattr=+xtheadmempair -show-encoding \ | ||
| # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
| # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+xtheadmempair < %s \ | ||
| # RUN: | llvm-objdump --mattr=+xtheadmempair -d -r - \ | ||
| # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
|
|
||
| # CHECK-ASM-AND-OBJ: th.lwd | ||
| # CHECK-ASM: encoding: [0x0b,0x45,0xb6,0xe2] | ||
| th.lwd a0, a1, (a2), 1, 3 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: th.lwud | ||
| # CHECK-ASM: encoding: [0x0b,0x45,0xb6,0xf4] | ||
| th.lwud a0, a1, (a2), 2, 3 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: th.swd | ||
| # CHECK-ASM: encoding: [0x0b,0x55,0xb6,0xe0] | ||
| th.swd a0, a1, (a2), 0, 3 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: th.ldd | ||
| # CHECK-ASM: encoding: [0x0b,0x45,0xb6,0xf8] | ||
| th.ldd a0, a1, (a2), 0, 4 | ||
|
|
||
| # CHECK-ASM-AND-OBJ: th.sdd | ||
| # CHECK-ASM: encoding: [0x0b,0x55,0xb6,0xfe] | ||
| th.sdd a0, a1, (a2), 3, 4 |