This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] nvptx: do not use alternative spelling of unsigned comparisons


On 02/01/16 11:55, Alexander Monakov wrote:
Hello!

The following patch fixes subtle breakage on NVPTX when unsigned comparisons
would be sometimes mistranslated by PTX JIT.  The new test demonstrates that
by using the %nctaid.x (number of blocks) register, but a comparison against
a value in constant memory can also trigger that (I could easily reproduce
that with NVCC, but not with GCC yet).  OK for trunk?

When emitting unsigned comparisons, nvptx backend uses alternative spellings
lo/ls/hs/hi for relational operators, instead of the usual lt/le/ge/gt,
respectively.  There's no nominal difference, but in practice ptxas and PTX
JIT can mistranslate the former in some circumstances, e.g. when the first
comparison operand is a load from constant memory (perhaps implicitely like
%nctaid.x).

Ok.

nathan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]