[llvm] d532484 - [RISCV][MC] Fix encoding for vfwmaccbf16
Alex Bradbury via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 06:02:01 PDT 2023
Author: Alex Bradbury
Date: 2023-06-23T14:01:52+01:00
New Revision: d5324844687d15e2da89abc244dc8f66d98b1596
URL: https://github.com/llvm/llvm-project/commit/d5324844687d15e2da89abc244dc8f66d98b1596
DIFF: https://github.com/llvm/llvm-project/commit/d5324844687d15e2da89abc244dc8f66d98b1596.diff
LOG: [RISCV][MC] Fix encoding for vfwmaccbf16
The encoding matched the one given in the bf16 extension specification
PDF, but per https://github.com/riscv/riscv-bfloat16/issues/45 it seems
this encoding was not the one that is intended and was incorrectly
modified due to an issue in the PDF generation process. This patch
corrects the opcode to 111011 from 100011.
The correct encoding is shown in the new spec PDF
<https://github.com/riscv/riscv-bfloat16/releases/tag/20230614>.
Differential Revision: https://reviews.llvm.org/D152894
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td
llvm/test/MC/RISCV/rvv/zvfbfwma.s
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td
index b7d30460fe28e..046074d848f59 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td
@@ -27,5 +27,5 @@ defm VFNCVTBF16_F_F_W : VNCVTF_FV_VS2<"vfncvtbf16.f.f.w", 0b010010, 0b11101>;
let Predicates = [HasStdExtZvfbfwma], Constraints = "@earlyclobber $vd",
RVVConstraint = WidenV, Uses = [FRM], mayRaiseFPException = true in {
-defm VFWMACCBF16_V : VWMAC_FV_V_F<"vfwmaccbf16", 0b100011>;
+defm VFWMACCBF16_V : VWMAC_FV_V_F<"vfwmaccbf16", 0b111011>;
}
diff --git a/llvm/test/MC/RISCV/rvv/zvfbfwma.s b/llvm/test/MC/RISCV/rvv/zvfbfwma.s
index 32bf40bb41ab0..ed577bca2d740 100644
--- a/llvm/test/MC/RISCV/rvv/zvfbfwma.s
+++ b/llvm/test/MC/RISCV/rvv/zvfbfwma.s
@@ -18,27 +18,27 @@
# RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
# CHECK-INST: vfwmaccbf16.vv v8, v20, v4, v0.t
-# CHECK-ENCODING: [0x57,0x14,0x4a,0x8c]
+# CHECK-ENCODING: [0x57,0x14,0x4a,0xec]
# CHECK-ERROR: instruction requires the following: 'Zvfbfwma' (Vector BF16 widening mul-add){{$}}
-# CHECK-UNKNOWN: 57 14 4a 8c <unknown>
+# CHECK-UNKNOWN: 57 14 4a ec <unknown>
vfwmaccbf16.vv v8, v20, v4, v0.t
# CHECK-INST: vfwmaccbf16.vv v8, v20, v4
-# CHECK-ENCODING: [0x57,0x14,0x4a,0x8e]
+# CHECK-ENCODING: [0x57,0x14,0x4a,0xee]
# CHECK-ERROR: instruction requires the following: 'Zvfbfwma' (Vector BF16 widening mul-add){{$}}
-# CHECK-UNKNOWN: 57 14 4a 8e <unknown>
+# CHECK-UNKNOWN: 57 14 4a ee <unknown>
vfwmaccbf16.vv v8, v20, v4
# CHECK-INST: vfwmaccbf16.vf v8, fa0, v4, v0.t
-# CHECK-ENCODING: [0x57,0x54,0x45,0x8c]
+# CHECK-ENCODING: [0x57,0x54,0x45,0xec]
# CHECK-ERROR: instruction requires the following: 'Zvfbfwma' (Vector BF16 widening mul-add){{$}}
-# CHECK-UNKNOWN: 57 54 45 8c <unknown>
+# CHECK-UNKNOWN: 57 54 45 ec <unknown>
vfwmaccbf16.vf v8, fa0, v4, v0.t
# CHECK-INST: vfwmaccbf16.vf v8, fa0, v4
-# CHECK-ENCODING: [0x57,0x54,0x45,0x8e]
+# CHECK-ENCODING: [0x57,0x54,0x45,0xee]
# CHECK-ERROR: instruction requires the following: 'Zvfbfwma' (Vector BF16 widening mul-add){{$}}
-# CHECK-UNKNOWN: 57 54 45 8e <unknown>
+# CHECK-UNKNOWN: 57 54 45 ee <unknown>
vfwmaccbf16.vf v8, fa0, v4
# Check scalar half FP load/store/move included in this extension.
More information about the llvm-commits
mailing list