[PATCH] [AArch32] Add support for FP rounding operations for ARMv8/AArch32.

Chad Rosier mcrosier at codeaurora.org
Fri Aug 15 12:51:28 PDT 2014


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:861
@@ +860,3 @@
+  if (Subtarget->hasV8Ops()) {
+    static MVT RoundingTypes[] = { MVT::f32, MVT::f64};
+    for (unsigned I = 0; I < array_lengthof(RoundingTypes); ++I) {
----------------
Saleem Abdulrasool wrote:
> Whitespace between the MVT and closing brace.
I'll take care of it.

================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:862
@@ +861,3 @@
+    static MVT RoundingTypes[] = { MVT::f32, MVT::f64};
+    for (unsigned I = 0; I < array_lengthof(RoundingTypes); ++I) {
+      MVT Ty = RoundingTypes[I];
----------------
Saleem Abdulrasool wrote:
> It seems that range based loops would be nicer here.
Ok, no problem.

================
Comment at: lib/Target/ARM/ARMInstrVFP.td:694
@@ -693,3 +693,3 @@
 
-multiclass vrint_inst_zrx<string opc, bit op, bit op2> {
+multiclass vrint_inst_zrx<string opc, bit op, bit op2, SDPatternOperator node> {
   def S : ASuI<0b11101, 0b11, 0b0110, 0b11, 0,
----------------
Saleem Abdulrasool wrote:
> Can there ever be the case that there is no desired pattern?  (e.g. does it make sense to have this be a default null_frag).
Not with the current state of the compiler.  This multiclass is for
VRINTZ   =>  maps to  => ISD::FTRUNC
VRINTR  =>   maps to  => ISD::FNEARBYINT
VRINTX  =>   maps to  => ISD::FRINT.
 
The only case I can think of where we need a default null_frag, is if we extend this in the future for accommodating other instructions which do  not have a corresponding DAG node/pattern.
 
e.g. defm VRINTY : vrint_inst_zrxy <"x….

IMO, we should defer such a change until it is necessary.

================
Comment at: test/CodeGen/ARM/arm32-rounding.ll:111
@@ +110,2 @@
+declare double @rint(double) nounwind readnone
+
----------------
I'll remove this extra whitespace as well.

http://reviews.llvm.org/D4935






More information about the llvm-commits mailing list