Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
swiftshader
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • swiftshader
  • Repository

Switch branch/tag
  • swiftshader
  • tests
  • MathUnitTests
  • unittests.cpp
Find file
BlameHistoryPermalink
  • Nicolas Capens's avatar
    Add unit test for 11/10-bit minifloat denormal underflow · 558540fe
    Nicolas Capens authored Aug 21, 2020
    The reference code for conversion from 32-bit floating-point to 11- and
    10-bit minifloat formats supports producing denormals for values smaller
    than what can be represented as normalized representations. The
    arithmetic can underflow to produce zero for values too small to be
    represented as denormals.
    
    This arithmetic contains a 32-bit shift operation which can shift by an
    amount greater than 32, which has undefined behavior in C++ but produces
    zero on x86 processors.
    
    This change adds unit tests for the intended behavior around the cutoff
    between the smallest denormal, and zero, to help validate the fix for
    the UB in a future change.
    
    Bug: b/147900455
    Bug: chromium:1117433
    Change-Id: Ic5e495dd822231d52a5551ee12733a616728d486
    Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48068Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
    Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
    Kokoro-Result: kokoro <noreply+kokoro@google.com>
    558540fe
unittests.cpp 3.98 KB
EditWeb IDE
×

Replace unittests.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.