[all-commits] [llvm/llvm-project] 520a57: [mlir][StandardToSPIRV] Fix signedness issue in bi...

Han-Chung Wang via All-commits all-commits at lists.llvm.org
Tue May 19 11:00:35 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 520a5702680ea0b5059193a0d4ad52c217da7325
      https://github.com/llvm/llvm-project/commit/520a5702680ea0b5059193a0d4ad52c217da7325
  Author: Hanhan Wang <hanchung at google.com>
  Date:   2020-05-19 (Tue, 19 May 2020)

  Changed paths:
    M mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
    M mlir/test/Conversion/StandardToSPIRV/std-ops-to-spirv.mlir

  Log Message:
  -----------
  [mlir][StandardToSPIRV] Fix signedness issue in bitwidth emulation.

Summary:
Previously, after applying the mask, a negative number would convert to a
positive number because the sign flag was forgotten. This patch adds two more
shift operations to do the sign extension. This assumes that we're using two's
complement.

This patch applies sign extension unconditionally when loading a unspported integer width, and it relies the pattern to do the casting because the signedness semantic is carried by operator itself.

Differential Revision: https://reviews.llvm.org/D79753




More information about the All-commits mailing list