Skip to content

__builtin_rotateright64 signature dropped 'unsigned' on last parameter in Clang 9 #42654

@ghost

Description

Bugzilla Link 43309
Resolution FIXED
Resolved on Sep 17, 2019 03:19
Version 9.0
OS All
Blocks #41819
CC @davidbolvansky,@zmodem,@karka228,@RKSimon,@zygoloid,@synopsys-sig-compiler-frontends,@tahonermann

Extended Description

The signature for __builtin_rotateright64 changed in a way that looks suspicious.

BUILTIN(__builtin_rotateleft8, "UcUcUc", "nc")
BUILTIN(__builtin_rotateleft16, "UsUsUs", "nc")
BUILTIN(__builtin_rotateleft32, "UZiUZiUZi", "nc")
BUILTIN(__builtin_rotateleft64, "UWiUWiUWi", "nc")
BUILTIN(__builtin_rotateright8, "UcUcUc", "nc")
BUILTIN(__builtin_rotateright16, "UsUsUs", "nc")
BUILTIN(__builtin_rotateright32, "UZiUZiUZi", "nc")
BUILTIN(__builtin_rotateright64, "UWiUWiWi", "nc") // All the other rotate builtins have a last parameter that is unsigned, and it did before this most recent change to this line.

It appears to have happened in this commit:

commit c0478341937c33b16056e9ce28d6134afbd91693
Author: Karl-Johan Karlsson karl-johan.karlsson@ericsson.com
Date: 2019-05-16 07:18:02 +0000

[builtin] Fixed definitions of builtins that rely on the int/long long type is 32/64 bits Summary: The definition of the builtins __builtin_bswap32, __builtin_bitreverse32, __builtin_rotateleft32 and __builtin_rotateright32 rely on that the int type is 32 bits wide on the target. The defintions of the builtins __builtin_bswap64, __builtin_bitreverse64, __builtin_rotateleft64, and __builtin_rotateright64 rely on that the long long type is 64 bits wide. On targets where this is not the case (e.g. AVR) clang will generate faulty code (wrong llvm assembler intrinsics). This patch add support for using 'Z' (the int32_t type) in Bultins.def. The builtins above are changed to be based on the int32_t type instead of the int type, and the int64_t type instead of the long long type. The AVR backend (experimental) have a native int type that is only 16 bits wide. The supplied testcase will therefore fail if running the testcase on trunk as clang will convert e.g. __builtin_bitreverse32 into llvm.bitreverse.i16 on AVR. Reviewers: dylanmckay, spatel, rsmith, efriedma Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D61845 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360863 91177308-0d34-0410-b5e6-96231b3b80d8 

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions