[PATCH] Add Clang support for remaining integer divide and permute instructions from ISA 2.06

Nemanja Ivanovic nemanja.i.ibm at gmail.com
Tue Mar 17 14:35:12 PDT 2015


Hi echristo, wschmidt, hfinkel, kbarton,

This patch provides some of the missing instructions from ISA 2.06. Namely the integer divide extended instructions (and associated builtins) are provided. The record-form variants are provided but can be accessed through inline assembly only.
Since these instructions are introduced with ISA 2.06, it is important that they not be emitted for targets that implement an older ISA. Also, since they are exposed in the front end through builtinins, it is important that the front end knows not to emit the intrinsics to the back end if the target does not support them. Therefore, this patch provides the ability to test whether the target is Power 7 and up (and Power 8 and up) and use of the builtins is diagnosed on older CPUs.
This diverges from GCC behaviour of controlling the builtins and instructions with -mpopcntd since that option has very little to do with these instructions/builtins.

Note: in a general case, a newer ISA is a superset of the previous ISA. However, instructions are sometimes removed from the ISA. This raises the question whether emitting instructions/builtins based on "IsPwr7Up", et. al. is the right approach. In my opinion, it is unlikely that something that is added in say ISA 2.06 will be removed any time soon, but I welcome other opinions.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8398

Files:
  include/clang/Basic/BuiltinsPPC.def
  lib/Basic/Targets.cpp
  lib/CodeGen/CGBuiltin.cpp
  test/CodeGen/builtins-ppc-p7-disabled.c
  test/CodeGen/builtins-ppc-p7.c

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8398.22123.patch
Type: text/x-patch
Size: 6403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150317/06c03a14/attachment.bin>


More information about the cfe-commits mailing list