rjmccall added a comment.

In https://reviews.llvm.org/D50616#1203446, @leonardchan wrote:

> In https://reviews.llvm.org/D50616#1202034, @ebevhan wrote:
>
> > I think I've mentioned this before, but I would like to discuss the 
> > possibility of adding a target hook(s) for some of these operations 
> > (conversions, arithmetic when it comes). Precisely matching the emitted 
> > saturation operation is virtually impossible for a target.
>
>
> Sorry I forgot to address this also. Just to make sure I understand this 
> correctly since I haven't used these before: target hooks are essentially for 
> emitting target specific code for some operations right? Does this mean that 
> the `EmitFixedPointConversion` function should be moved to a virtual method 
> under `TargetCodeGenInfo` that can be overridden and this is what get's 
> called instead during conversion?


If this is more than just a hobby — like if there's a backend that wants to do 
serious work with matching fixed-point operations to hardware support — we 
should just add real LLVM IR support for fixed-point types instead of adding a 
bunch of frontend customization hooks.  I don't know what better opportunity 
we're expecting might come along to justify that, and I don't think it's some 
incredibly onerous task to add a new leaf to the LLVM type hierarchy.  
Honestly, LLVM programmers across the board have become far too accustomed to 
pushing things opaquely through an uncooperative IR with an obscure muddle of 
intrinsics.

In the meantime, we can continue working on this code.  Even if there's 
eventually real IR support for fixed-point types, this code will still be 
useful; it'll just become the core of some legalization pass in the generic 
backend.


Repository:
  rC Clang

https://reviews.llvm.org/D50616



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to