This is an archive of the discontinued LLVM Phabricator instance.

[PPC] add altivec.h functions for converting a vector of half precision to a vector of single precision
ClosedPublic

Authored by sfertile on Nov 10 2016, 6:06 PM.

Details

Summary

Change adds 2 functions to altivec.h

vector float vec_extract_fp32_from_shorth (vector unsigned short);
Purpose:
Extracts four single-precision floating-point numbers from the high elements of a vector of eight 16-bit elements, interpreting each element as a 16-bit floating-point number in IEEE format.
Result value:
The first four elements are interpreted as 16-bit floating-point numbers in IEEE format, and extended to single-precision format, returning a vector with four single-precision IEEE numbers.

vector float vec_extract_fp32_from_shortl (vector unsigned short);
Purpose
Extracts four single-precision floating-point numbers from the low elements of a vector of eight 16-bit elements, interpreting each element as a 16-bit floating-point number in IEEE format.
Result value:
The last four elements are interpreted as 16-bit floating-point numbers in IEEE format, and extended to single-precision format, returning a vector with four single-precision IEEE numbers.

Adds a builtin that gets mapped to the xscvhpsp instruction. (VSX Scalar Convert Half-Precision to Single-Precision)

Diff Detail

Repository
rL LLVM

Event Timeline

sfertile updated this revision to Diff 77581.Nov 10 2016, 6:06 PM
sfertile retitled this revision from to [PPC] add altivec.h functions for converting a vector of half precision to a vector of single precision.
sfertile updated this object.
sfertile set the repository for this revision to rL LLVM.
sfertile added subscribers: cfe-commits, echristo.
sfertile updated this object.Nov 10 2016, 6:21 PM
kbarton accepted this revision.Nov 11 2016, 1:45 PM
kbarton edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 11 2016, 1:45 PM
This revision was automatically updated to reflect the committed changes.