[PATCH] [PPC64] Add vector quadword add/sub instructions for POWER8

Kit Barton kbarton at ca.ibm.com
Mon Apr 20 08:50:13 PDT 2015

Comment at: test/CodeGen/PowerPC/vec_add_sub_quadword.ll:9
@@ +8,3 @@
+       ret <1 x i128> %result
+; CHECK: vadduqm 2, 2, 3
kbarton wrote:
> nemanjai wrote:
> > I don't think all the registers are ABI-required registers. Probably ok to use a regex for the other(s). Just making the same comment I received previously and I think it works well. A regex can be something like {{[0-9]+}}.
> > 
> > It may or may not make sense, but you can check that the value being added is loaded into a register and that that register is used for the add (at least for the immediate). Although I don't know if that's a good idea for commutative operations. Maybe someone more knowledgeable can comment on that.
> Agreed. Will change. 
Actually, on second thought I think it's better to leave these tests as is. 
The ABI specifies which registers the parameters to the function are passed in and given these are extremely short functions there is no reason to not reuse the same registers for the specific instructions being tested. So, by using the same registers as the parameters, we are testing to ensure no unnecessary register moves are being added to the code.

If these were more complicated test cases, then we would need to use regular expressions because we couldn't guarantee in all cases the same registers would be used.



More information about the llvm-commits mailing list