Skip to content

swiftshader: add riscv64 default condition to select() blocks#2379

Open
monkey-jsun wants to merge 1 commit intogoogle:mainfrom
monkey-jsun:pr/swiftshader-riscv64
Open

swiftshader: add riscv64 default condition to select() blocks#2379
monkey-jsun wants to merge 1 commit intogoogle:mainfrom
monkey-jsun:pr/swiftshader-riscv64

Conversation

@monkey-jsun
Copy link
Copy Markdown

The LLVM backend sources select() in BUILD.swiftshader.bazel only lists
x86_64 and aarch64 entries. On riscv64 Bazel fails with 'no matching
condition'. Add //conditions:default: [] so riscv64 falls through to
pure C/software rendering (SwiftShader's CPU renderer works without
arch-specific LLVM backends).

"third_party/llvm-16.0/llvm/lib/Target/X86/X86VZeroUpper.cpp",
"third_party/llvm-16.0/llvm/lib/Target/X86/X86WinEHState.cpp",
],
"//conditions:default": [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make the condition "@platforms//cpu:riscv64"? I think it's nice to be explicit so that we are forced to check and update this as new hosts are used.

Copy link
Copy Markdown
Collaborator

@3405691582 3405691582 Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, make the comment not riscv specific (with the argument that a buildbreak should happen when there is a change that must be made).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to "@platforms//cpu:riscv64" per your suggestion.

The LLVM backend sources select() in BUILD.swiftshader.bazel only lists
x86_64 and aarch64 entries. Currently riscv64 Bazel fails with 'no matching
condition'. Add "@platforms//cpu:riscv64: []" so riscv64 falls through to
pure C/software rendering without JIT backend compilation.
@monkey-jsun monkey-jsun force-pushed the pr/swiftshader-riscv64 branch from 5f6fd23 to 2223aa8 Compare April 11, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants