[PATCH] D58722: [MIPS] [microMIPS] Pattern match TruncIntFP
Simon Dardis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 11:33:34 PST 2019
sdardis requested changes to this revision.
sdardis added a comment.
This revision now requires changes to proceed.
Some minor nits inlined, but otherwise the patch is more or less there.
================
Comment at: lib/Target/Mips/MicroMipsInstrFPU.td:433-435
+def : MipsPat<(MipsTruncIntFP FGR32Opnd:$src),
+ (TRUNC_W_S_MM FGR32Opnd:$src)>, ISA_MICROMIPS32_NOT_MIPS32R6,
+ FGR_64;
----------------
This pattern is duplicated by the one above except for the predicates. Drop the 'FGR_32' in the pattern above and remove this pattern. For pure FGR32 operand using instructions, they shouldn't need to distinguish between the 32bit or 64bit FPU configurations.
================
Comment at: test/CodeGen/Mips/llvm-ir/fptosi.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32 -asm-show-inst | FileCheck %s -check-prefixes=ALL,NOT-MM,M32,M32-NOTFP64,M32D
+; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r2 -asm-show-inst | FileCheck %s -check-prefixes=ALL,NOT-MM,M32,M32-NOTFP64,M32R2
----------------
Break the line with '\' after the '|', and only include only one prefix with -check-prefix. Just make sure it's unique in the tests. Drop the excessive whitespace between the arguments.
================
Comment at: test/CodeGen/Mips/llvm-ir/fptosi.ll:13
+; RUN: llc < %s -mtriple=mips64-linux-gnu -mcpu=mips64r6 -asm-show-inst | FileCheck %s -check-prefixes=ALL,NOT-MM,M64R6
+; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r2 -mattr=+micromips -asm-show-inst | FileCheck %s -check-prefixes=ALL,MM,MMR2,MMR2-FP32
+; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r2 -mattr=+micromips,fp64 -asm-show-inst | FileCheck %s -check-prefixes=ALL,MM,MMR2,MMR2-FP64
----------------
You should also test microMIPS softfloat for completeness sake.
================
Comment at: test/CodeGen/Mips/llvm-ir/fptosi.ll:15
+; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r2 -mattr=+micromips,fp64 -asm-show-inst | FileCheck %s -check-prefixes=ALL,MM,MMR2,MMR2-FP64
+; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r6 -mattr=+micromips -asm-show-inst | FileCheck %s -check-prefixes=ALL,MM,MMR6,MMR6-FP32
+; RUN: llc < %s -mtriple=mips-linux-gnu -mcpu=mips32r6 -mattr=+micromips,fp64 -asm-show-inst | FileCheck %s -check-prefixes=ALL,MM,MMR6,MMR6-FP64
----------------
This test is unnecessary as microMIPS32R6 requires a full 64-bit fpu. See Introduction to the microMIPS32 Architecture v6.0, Chapter 7, binary compatibility, page 103.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58722/new/
https://reviews.llvm.org/D58722
More information about the llvm-commits
mailing list