Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LLVM project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Panda
LLVM project
Commits
350d43f1
Commit
350d43f1
authored
3 years ago
by
Akira Hatanaka
Browse files
Options
Downloads
Patches
Plain Diff
Fix a bug where an extended vector of __fp16 was being converted to a
generic vector type
rdar://86109177
parent
ce21c926
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clang/lib/Sema/SemaExpr.cpp
+5
-3
5 additions, 3 deletions
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/fp16vec-sema.c
+6
-0
6 additions, 0 deletions
clang/test/Sema/fp16vec-sema.c
with
11 additions
and
3 deletions
clang/lib/Sema/SemaExpr.cpp
+
5
−
3
View file @
350d43f1
...
...
@@ -10069,9 +10069,11 @@ static bool tryVectorConvertAndSplat(Sema &S, ExprResult *scalar,
static ExprResult convertVector(Expr *E, QualType ElementType, Sema &S) {
const auto *VecTy = E->getType()->getAs<VectorType>();
assert(VecTy && "Expression E must be a vector");
QualType NewVecTy = S.Context.getVectorType(ElementType,
VecTy->getNumElements(),
VecTy->getVectorKind());
QualType NewVecTy =
VecTy->isExtVectorType()
? S.Context.getExtVectorType(ElementType, VecTy->getNumElements())
: S.Context.getVectorType(ElementType, VecTy->getNumElements(),
VecTy->getVectorKind());
// Look through the implicit cast. Return the subexpression if its type is
// NewVecTy.
...
...
This diff is collapsed.
Click to expand it.
clang/test/Sema/fp16vec-sema.c
+
6
−
0
View file @
350d43f1
...
...
@@ -4,6 +4,7 @@ typedef __fp16 half4 __attribute__ ((vector_size (8)));
typedef
float
float4
__attribute__
((
vector_size
(
16
)));
typedef
short
short4
__attribute__
((
vector_size
(
8
)));
typedef
int
int4
__attribute__
((
vector_size
(
16
)));
typedef
__fp16
exthalf4
__attribute__
((
ext_vector_type
(
4
)));
half4
hv0
,
hv1
;
float4
fv0
,
fv1
;
...
...
@@ -51,3 +52,8 @@ void testFP16Vec(int c) {
hv0
++
;
// expected-error{{cannot increment value of type}}
++
hv0
;
// expected-error{{cannot increment value of type}}
}
void
testExtVec
(
exthalf4
a
)
{
// Check that the type of "(-a)" is exthalf4.
__fp16
t0
=
(
-
a
).
z
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment