[clang] [llvm] [LoongArch] Support LA V1.1 feature that div.w[u] and mod.w[u] instructions with inputs not signed-extended. (PR #116764)

Lu Weining via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 25 22:23:11 PST 2024


================
@@ -0,0 +1,79 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc --mtriple=loongarch64 -mattr=+d,-div32 < %s | FileCheck %s --check-prefix=LA64
+; RUN: llc --mtriple=loongarch64 -mattr=+d,+div32 < %s | FileCheck %s --check-prefix=LA64-DIV32
+
+define i32 @divw(i64 %a, i64 %b) {
+; LA64-LABEL: divw:
+; LA64:       # %bb.0:
+; LA64-NEXT:    addi.w $a0, $a0, 0
+; LA64-NEXT:    addi.w $a1, $a1, 0
+; LA64-NEXT:    div.d $a0, $a0, $a1
+; LA64-NEXT:    ret
+;
+; LA64-DIV32-LABEL: divw:
----------------
SixWeining wrote:

Leave a `TODO` here that the issue will be addressed by another PR.

https://github.com/llvm/llvm-project/pull/116764


More information about the cfe-commits mailing list