[all-commits] [llvm/llvm-project] a29afb: [HLSL] Allow truncation to scalar (#104844)

Chris B via All-commits all-commits at lists.llvm.org
Wed Sep 11 15:27:31 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a29afb754fb445a2cccc361c556d4e072604b3be
      https://github.com/llvm/llvm-project/commit/a29afb754fb445a2cccc361c556d4e072604b3be
  Author: Chris B <chris.bieneman at me.com>
  Date:   2024-09-11 (Wed, 11 Sep 2024)

  Changed paths:
    M clang/lib/AST/Expr.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/CodeGen/CGExprScalar.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/CodeGenHLSL/BasicFeatures/standard_conversion_sequences.hlsl
    M clang/test/CodeGenHLSL/builtins/dot.hlsl
    M clang/test/CodeGenHLSL/builtins/lerp.hlsl
    M clang/test/CodeGenHLSL/builtins/mad.hlsl
    M clang/test/SemaHLSL/TruncationOverloadResolution.hlsl
    M clang/test/SemaHLSL/Types/BuiltinVector/ScalarSwizzleErrors.hlsl
    A clang/test/SemaHLSL/Types/BuiltinVector/TruncationConstantExpr.hlsl

  Log Message:
  -----------
  [HLSL] Allow truncation to scalar (#104844)

HLSL allows implicit conversions to truncate vectors to scalar
pr-values. These conversions are scored as vector truncations and should
warn appropriately.

This change allows forming a truncation cast to a pr-value, but not an
l-value. Truncating a vector to a scalar is performed by loading the
first element of the vector and disregarding the remaining elements.

Fixes #102964



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list