├── zicondops.bib ├── index.adoc ├── .gitignore ├── images └── risc-v_logo.svg ├── bibliography.adoc ├── .gitmodules ├── dependencies ├── README.md ├── package.json ├── apt_packages.txt └── Gemfile ├── contributors.adoc ├── Makefile ├── intro.adoc ├── .github └── workflows │ ├── create-release.yml │ └── build-pdf.yml ├── header.adoc ├── chapter2.adoc ├── readme.adoc ├── comments-from-public-review.adoc ├── CONTRIBUTING.md ├── zicondops.adoc └── LICENSE /zicondops.bib: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.adoc: -------------------------------------------------------------------------------- 1 | [index] 2 | == Index 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | .asciidoctor 3 | images/ 4 | 5 | -------------------------------------------------------------------------------- /images/risc-v_logo.svg: -------------------------------------------------------------------------------- 1 | ../docs-resources/images/risc-v_logo.svg -------------------------------------------------------------------------------- /bibliography.adoc: -------------------------------------------------------------------------------- 1 | [bibliography] 2 | == Bibliography 3 | 4 | bibliography::[] 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "docs-resources"] 2 | path = docs-resources 3 | url = https://github.com/riscv/docs-resources.git 4 | -------------------------------------------------------------------------------- /dependencies/README.md: -------------------------------------------------------------------------------- 1 | Dependencies for the build environment for various package managers. Used in 2 | `.github/workflows/`. 3 | 4 | -------------------------------------------------------------------------------- /dependencies/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "bytefield-svg": "^1.8.0", 4 | "wavedrom-cli": "^2.6.8" 5 | }, 6 | "name": "local", 7 | "version": "0.0.1" 8 | } -------------------------------------------------------------------------------- /contributors.adoc: -------------------------------------------------------------------------------- 1 | == Contributors 2 | 3 | This RISC-V specification has been contributed to directly or indirectly by: 4 | 5 | [%hardbreaks] 6 | * Dr. Philipp Tomsich 7 | * Ken Dockser 8 | * Brendan Sweeney 9 | * Andrew Waterman 10 | 11 | -------------------------------------------------------------------------------- /dependencies/apt_packages.txt: -------------------------------------------------------------------------------- 1 | bison 2 | build-essential 3 | cmake 4 | curl 5 | flex 6 | fonts-lyx 7 | git 8 | graphviz 9 | # For wavedrom 10 | default-jre 11 | libcairo2-dev 12 | libffi-dev 13 | libgdk-pixbuf2.0-dev 14 | libpango1.0-dev 15 | libxml2-dev 16 | make 17 | pkg-config 18 | ruby 19 | ruby-dev 20 | libwebp-dev 21 | libzstd-dev 22 | -------------------------------------------------------------------------------- /dependencies/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'asciidoctor' 3 | gem 'asciidoctor-bibtex' 4 | gem 'asciidoctor-diagram' 5 | gem 'mathematical', '= 1.6.14' 6 | gem 'asciidoctor-mathematical' 7 | gem 'asciidoctor-pdf' 8 | gem 'citeproc-ruby' 9 | gem 'coderay' 10 | gem 'csl-styles' 11 | gem 'json' 12 | gem 'pygments.rb' 13 | gem 'rghost' 14 | gem 'rouge' 15 | gem 'ruby_dev' 16 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | HEADER_SOURCE := header.adoc 2 | 3 | SPEC=riscv-zicond 4 | DATE=$(shell date +%Y%m%d) 5 | VERSION=$(shell git describe --tag --always --dirty) 6 | PDF_RESULT := $(SPEC)-$(VERSION).pdf 7 | 8 | all: $(PDF_RESULT) 9 | 10 | $(PDF_RESULT): 11 | @echo "Building asciidoc" 12 | asciidoctor-pdf \ 13 | --attribute=mathematical-format=svg \ 14 | --attribute=pdf-fontsdir=docs-resources/fonts \ 15 | --attribute=pdf-theme=docs-resources/themes/riscv-pdf.yml \ 16 | --failure-level=ERROR \ 17 | --require=asciidoctor-bibtex \ 18 | --require=asciidoctor-diagram \ 19 | --require=asciidoctor-mathematical \ 20 | --out-file=$@ \ 21 | $(HEADER_SOURCE) 22 | 23 | clean: 24 | -rm -f $(SPEC)-*.pdf 25 | -------------------------------------------------------------------------------- /intro.adoc: -------------------------------------------------------------------------------- 1 | [[intro]] 2 | == Introduction 3 | The Zicond extension defines a simple solution that provides most of the benefit and all of the flexibility one would desire to support conditional arithmetic and conditional-select/move operations, while remaining true to the RISC-V design philosophy. 4 | The instructions follow the format for R-type instructions with 3 operands (i.e., 2 source operands and 1 destination operand). 5 | Using these instructions, branchless sequences can be implemented (typically in two-instruction sequences) without the need for instruction fusion, special provisions during the decoding of architectural instructions, or other microarchitectural provisions. 6 | 7 | // === Suitability for Fast Track Extension Process 8 | // This proposed extension meets the Fast Track criteria: it consists of two, simple R-form instructions, it addresses a wide range of use-cases f// or branchless sequences, it composes with the existing RISC-V instruction set, and is not expected to be contentious. 9 | 10 | === Motivation and use cases 11 | One of the shortcomings of RISC-V, compared to competing instruction set architectures, is the absence of conditional operations to support branchless code-generation: this includes conditional arithmetic, conditional select and conditional move operations. 12 | The design principles of RISC-V (e.g. the absence of an instruction-format that supports 3 source registers and an output register) make it unlikely that direct equivalents of the competing instructions will be introduced. 13 | 14 | Yet, low-cost conditional instructions are a desirable feature as they allow the replacement of branches in a broad range of suitable situations (whether the branch turns out to be unpredictable or predictable) so as to reduce the capacity and aliasing pressures on BTBs and branch predictors, and to allow for longer basic blocks (for both the hardware and the compiler to work with). 15 | -------------------------------------------------------------------------------- /.github/workflows/create-release.yml: -------------------------------------------------------------------------------- 1 | # This work flow includes source and PDF in Release. It relies on the build-pdf workflow to create the PDF. 2 | # 3 | # NOTE: At this time it only runs manually. 4 | 5 | name: Create Document Release 6 | 7 | on: 8 | workflow_dispatch: 9 | inputs: 10 | version: 11 | description: 'Release version, e.g. X.Y.Z:' 12 | required: true 13 | type: string 14 | prerelease: 15 | description: 'Tag as a pre-release?' 16 | required: false 17 | type: boolean 18 | default: true 19 | draft: 20 | description: 'Create release as a draft?' 21 | required: false 22 | type: boolean 23 | default: false 24 | 25 | jobs: 26 | build: 27 | uses: ./.github/workflows/build-pdf.yml 28 | release: 29 | runs-on: ubuntu-latest 30 | needs: build 31 | steps: 32 | - name: Create Release 33 | id: create_release 34 | uses: actions/create-release@v1 35 | env: 36 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 | with: 38 | tag_name: v${{ github.event.inputs.version }} 39 | release_name: Release ${{ github.event.inputs.version }} 40 | draft: ${{ github.event.inputs.draft }} 41 | prerelease: ${{ github.event.inputs.prerelease }} 42 | - name: Download Artifacts 43 | uses: actions/download-artifact@v2 44 | with: 45 | name: ${{ needs.build.outputs.pdf-name }} 46 | - name: Upload Release Asset 47 | id: upload-release-asset 48 | uses: actions/upload-release-asset@v1 49 | env: 50 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 51 | with: 52 | upload_url: ${{ steps.create_release.outputs.upload_url }} 53 | asset_path: ${{ needs.build.outputs.pdf-name }} 54 | asset_name: ${{ needs.build.outputs.name }}_${{ github.event.inputs.version }}.pdf 55 | asset_content_type: application/pdf 56 | -------------------------------------------------------------------------------- /header.adoc: -------------------------------------------------------------------------------- 1 | [[header]] 2 | :description: RISC-V Integer Conditional (Zicond) operations extension 3 | :company: RISC-V.org 4 | :revdate: 2023-10-12 5 | :revnumber: 1.0.1 6 | :revremark: This document is ratified. See http://riscv.org/spec-state for details. 7 | :url-riscv: http://riscv.org 8 | :doctype: book 9 | :preface-title: Preamble 10 | :colophon: 11 | :appendix-caption: Appendix 12 | :imagesdir: images 13 | :title-logo-image: image:risc-v_logo.svg[pdfwidth=3.25in,align=center] 14 | // Settings: 15 | :experimental: 16 | :reproducible: 17 | // needs to be changed? bug discussion started 18 | // :WaveDromEditorApp: app/wavedrom-editor.app 19 | :imagesoutdir: images 20 | :bibtex-file: zicondops.bib 21 | :bibtex-order: alphabetical 22 | :bibtex-style: apa 23 | :icons: font 24 | :lang: en 25 | :listing-caption: Listing 26 | :sectnums: 27 | :toc: left 28 | :toclevels: 4 29 | :source-highlighter: pygments 30 | ifdef::backend-pdf[] 31 | :source-highlighter: coderay 32 | endif::[] 33 | :data-uri: 34 | :hide-uri-scheme: 35 | :stem: latexmath 36 | :footnote: 37 | :xrefstyle: short 38 | 39 | = RISC-V Integer Conditional (Zicond) operations extension 40 | Dr. Philipp Tomsich (VRULL GmbH) 41 | 42 | // Preamble 43 | [NOTE] 44 | .This document is in the link:http://riscv.org/spec-state[Ratified state] 45 | ==== 46 | No changes are allowed. Any desired or needed changes can be the subject of a follow-on new extension. Ratified extensions are never revised 47 | ==== 48 | 49 | [preface] 50 | == Copyright and license information 51 | This specification is licensed under the Creative Commons 52 | Attribution 4.0 International License (CC-BY 4.0). The full 53 | license text is available at 54 | https://creativecommons.org/licenses/by/4.0/. 55 | 56 | Copyright 2022-2023 by RISC-V International. 57 | 58 | [preface] 59 | include::contributors.adoc[] 60 | 61 | // include::comments-from-public-review.adoc[] 62 | 63 | include::intro.adoc[] 64 | include::zicondops.adoc[] 65 | 66 | -------------------------------------------------------------------------------- /chapter2.adoc: -------------------------------------------------------------------------------- 1 | [[chapter2]] 2 | == The Second Chapter 3 | 4 | . The first item. 5 | 6 | . The second item. 7 | + 8 | .. The first sub item. 9 | 10 | .. The second sub item. 11 | + 12 | [CAUTION] 13 | ==== 14 | A moment of caution is required for this block of text must be read and apreciated for its importance. 15 | ==== 16 | 17 | . Yet another item. 18 | 19 | . Again, an item. 20 | 21 | .. A multi-line item. 22 | + 23 | This item has multiple lines. 24 | + 25 | By multiple lines, this is what we mean. 26 | + 27 | Seriously, multiple. 28 | 29 | === An example table 30 | 31 | [cols="^1,^1,^1,^1,^3,^3",stripes=even,options="header"] 32 | |=== 33 | 4+|Letters _and_ bits {set:cellbgcolor:green} 2+|A much longer area 34 | |L|R|W|X|Quarter 1|Quarter 2 35 | |{set:cellbgcolor:!} 0|0|0|0 2+|Rows alternate colors 36 | |0|0|0|1|Thing 1|Thing 2 37 | |1|0|0|0|Thing 3|Thing 4 38 | |1|1|1|1 2+|Span Thing 1 and 2 39 | |=== 40 | 41 | === Sub section 42 | 43 | Diam donec adipiscing tristique risus indexterm:[risus]. Nisl rhoncus mattis rhoncus urna. Egestas egestas fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate. Porta non pulvinar neque laoreet suspendisse interdum consectetur libero id. Massa vitae tortor condimentum lacinia quis vel. Donec ac odio tempor orci. Mi sit amet mauris commodo quis imperdiet massa tincidunt. Quis enim lobortis scelerisque fermentum dui. Lacus viverra vitae congue eu. Sed faucibus turpis in eu mi bibendum neque. Sit amet porttitor eget dolor. Aliquet eget sit amet tellus cras adipiscing enim. Id cursus metus aliquam eleifend mi. Vestibulum lorem sed risus ultricies tristique nulla aliquet. 44 | 45 | === Yet another subsection 46 | 47 | Quam lacus suspendisse faucibus interdum posuere lorem ipsum. Nulla aliquet enim tortor at auctor urna nunc id cursus. Massa massa ultricies mi quis hendrerit dolor magna. Integer enim neque volutpat ac tincidunt. Dolor magna eget est lorem ipsum dolor. Urna neque viverra justo nec. Neque gravida in fermentum et. Fringilla ut morbi tincidunt augue interdum velit euismod. Dolor sit amet consectetur adipiscing elit. Eu facilisis sed odio morbi. In cursus turpis massa tincidunt dui. Orci indexterm:[orci] phasellus egestas tellus rutrum tellus. Semper eget duis at tellus at urna condimentum. Orci porta non pulvinar neque laoreet suspendisse interdum consectetur. 48 | -------------------------------------------------------------------------------- /readme.adoc: -------------------------------------------------------------------------------- 1 | [NOTE] 2 | ==== 3 | Integer Conditional (Zicond) has been merged into the Unprivileged Specification. Please log any issues against the link:https://github.com/riscv/riscv-isa-manual[RISC-V ISA Manual] repository. 4 | ==== 5 | 6 | = RISC-V docs-spec-template 7 | 8 | This repository is used to prime GitHub repos for the RISC-V organization which will be used 9 | to create specifications. 10 | 11 | **If you are reading this in a specification repo, please update the title for this section and 12 | provide your introduction to your repository.** 13 | 14 | = License 15 | 16 | This work is licensed under a Creative Commons Attribution 4.0 International License (CC-BY-4.0). 17 | See the link:LICENSE[LICENSE] file for details. 18 | 19 | = Contributors 20 | 21 | Contributors to this specification are contained in the link:contributors.adoc[contributors] file. 22 | 23 | For instructions on how to contribute please see the link:CONTRIBUTING.md[CONTRIBUTING] file. 24 | 25 | = Dependencies 26 | 27 | This project is built using AsciiDoctor (Ruby). The repository has been setup to build the PDF on 28 | checkin using GitHub actions. Workflow dependencies are located in the `dependencies` directory. 29 | 30 | For more information on AsciiDoctor, specification guidelines, or building locally, see the 31 | https://github.com/riscv/docs-dev-guide[RISC-V Documentation Developer Guide]. 32 | 33 | = Cloning the project 34 | 35 | This project uses https://git-scm.com/book/en/v2/Git-Tools-Submodules[GitHub Submodules] 36 | to include the https://github.com/riscv/docs-resources[RISC-V docs-resources project] 37 | to achieve a common look and feel. 38 | 39 | When cloning this repository for the first time, you must either use 40 | `git clone --recurse-submodules` or execute `git submodule init` and `git submodule update` after the clone to populate the docs-resources directory. Failure to clone the submodule, will result 41 | in the PDF build fail with an error message like the following: 42 | 43 | $ make 44 | asciidoctor-pdf \ 45 | -a toc \ 46 | -a compress \ 47 | -a pdf-style=docs-resources/themes/riscv-pdf.yml \ 48 | -a pdf-fontsdir=docs-resources/fonts \ 49 | --failure-level=ERROR \ 50 | -o profiles.pdf profiles.adoc 51 | asciidoctor: ERROR: could not locate or load the built-in pdf theme `docs-resources/themes/riscv-pdf.yml'; reverting to default theme 52 | No such file or directory - notoserif-regular-subset.ttf not found in docs-resources/fonts 53 | Use --trace for backtrace 54 | make: *** [Makefile:7: profiles.pdf] Error 1 55 | 56 | = Building the document 57 | 58 | The final specification form of PDF can be generated using the `make` command. 59 | -------------------------------------------------------------------------------- /.github/workflows/build-pdf.yml: -------------------------------------------------------------------------------- 1 | # This workflow installs dependencies for PDF generation, generates the PDF, 2 | # and uploads the PDF as an artifact. 3 | 4 | name: Build Document PDF 5 | 6 | on: 7 | push: 8 | branches: 9 | - main 10 | pull_request: 11 | branches: 12 | - main 13 | workflow_dispatch: 14 | workflow_call: 15 | outputs: 16 | name: 17 | description: "The base name of the pdf file (without .pdf extensions)" 18 | value: ${{ jobs.build.outputs.name }} 19 | pdf-name: 20 | description: "The name of the pdf file (with .pdf extensions)" 21 | value: ${{ jobs.build.outputs.pdf-name }} 22 | 23 | jobs: 24 | build: 25 | runs-on: ubuntu-latest 26 | 27 | env: 28 | NAME: riscv-zicond 29 | APT_PACKAGES_FILE: ${{ github.workspace }}/dependencies/apt_packages.txt 30 | BUNDLE_GEMFILE: ${{ github.workspace }}/dependencies/Gemfile 31 | BUNDLE_BIN: ${{ github.workspace }}/bin 32 | NPM_PACKAGE_FOLDER: ${{ github.workspace }}/dependencies 33 | outputs: 34 | tag: ${{ steps.git_describe.outputs.tag }} 35 | name: ${{ steps.step1.outputs.name }} 36 | pdf-name: ${{ steps.step2.outputs.pdf-name }} 37 | steps: 38 | - name: Checkout repository 39 | uses: actions/checkout@v2 40 | with: 41 | submodules: 'true' 42 | - name: GIT describe 43 | id: git_describe 44 | run: echo "::set-output name=tag::$(git describe --tag --always --dirty)" 45 | - name: Set outputs.name 46 | id: step1 47 | run: echo "::set-output name=name::$NAME" 48 | - name: Set outputs.pdf-name 49 | id: step2 50 | run: echo "::set-output name=pdf-name::${{ env.NAME }}-${{ steps.git_describe.outputs.tag }}.pdf" 51 | - name: Install Ubuntu packages 52 | run: | 53 | sudo apt-get update 54 | grep -vE '^#' ${APT_PACKAGES_FILE} | xargs sudo apt-get install --yes --no-install-recommends 55 | # Ruby for asciidoctor 56 | - name: Setup Ruby and Gemfile content 57 | uses: ruby/setup-ruby@v1 58 | with: 59 | ruby-version: "3.2.0" 60 | bundler-cache: true 61 | # Node.js for wavedrom 62 | - uses: actions/cache@v2 63 | with: 64 | path: ~/.npm 65 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} 66 | restore-keys: | 67 | ${{ runner.os }}-node- 68 | - name: Setup Node.js 69 | uses: actions/setup-node@v2 70 | with: 71 | node-version: '16' 72 | - name: Install Node.js dependencies 73 | run: npm install ${NPM_PACKAGE_FOLDER} 74 | - name: Generate PDF 75 | run: | 76 | PATH=${PATH}:${BUNDLE_BIN}:$(npm bin) \ 77 | make 78 | - name: Archive PDF result 79 | uses: actions/upload-artifact@v2 80 | with: 81 | name: ${{ env.NAME }}-${{ steps.git_describe.outputs.tag }}.pdf 82 | path: ${{ env.NAME }}-${{ steps.git_describe.outputs.tag }}.pdf 83 | retention-days: 7 84 | -------------------------------------------------------------------------------- /comments-from-public-review.adoc: -------------------------------------------------------------------------------- 1 | [[comments]] 2 | == Public review feedback 3 | 4 | The public review has identified a number of typographic errors and helped to improve the grammar and clarity of the document. 5 | In addition to these editorial improvements, the following key topics have been raised by reviewers. 6 | 7 | === Zicond and RVA profiles 8 | 9 | Whether Zicond will be included in future profiles has been raised by multiple reviewers. 10 | Zicond provides instructions that will be pervasive throughout the instruction stream (i.e., using optimized code-paths for individual functions is not feasible): consequently, its disposition in the Profiles determines how quickly Zicond can be adopted. 11 | 12 | While the specification of an extension is orthogonal to any assignments to profiles, Krste has provided the following guidance: 13 | 14 | * Zicond is too new to have been included in the early RVA23 drafts. 15 | * Assuming that Zicond is ratified before RVA23, it should at least be optional. 16 | * The instructions in Zicond are the type of instructions that will eventually be mandatory in RVA, though there has been little discussion so far about whether that would happen in RVA23 or later. 17 | 18 | === Code-size of code-sequences using Zicond 19 | 20 | Zicond is motivated by reducing pressure on the branch prediction. 21 | It neither intends nor claims to reduce the code-size compared to alternative sequences (especially when register assignments allow the use of compressed instructions) using branches. 22 | 23 | The authors of the specification expect that "optimizing for code-size" will use idioms with short-forward branches to generate the most compact binaries. 24 | 25 | === Data-independent timing for Zicond 26 | 27 | The definition of `czero.eqz` and `czero.nez` does not generally guarantee data-invariant timing (although it guarantees independence of the value of one of its arguments, if the Zkt extension is implemented). 28 | 29 | However, sequences using instructions covered by Zkt are available to express the same semantics as for the `czero.eqz` and `czero.nez` instructions. 30 | 31 | === "Syntactic" dependencies through _rs1_ 32 | 33 | Andrea Parri noted that the sentence "Accordingly, the syntactic dependency on _rs1_ is only propagated when the condition is false." (in the descriptions of <<#insns-czero-eqz>> and <<#insns-czero-nez>>) effectively makes the notion of dependency "depend" on a runtime state: in other words, it makes that notion non-"syntactic". 34 | 35 | The Unprivileged Specification, section 17.3, already lists similar "exceptions": this section/tables should be updated to reflect the addition of these instructions. 36 | 37 | === Clarification of the memory model for _rs2_ 38 | 39 | The dependency on _rs2_ is a control dependency rather than a data dependency. 40 | 41 | The descriptions of <<#insns-czero-eqz>> and <<#insns-czero-nez>> have been updated to reflext this, using the wording from the V extension (as the formalisation of what that "control dependency" means will be the same). 42 | Further, the SAIL code has been update so the read of rs1 is conditional based on rs2; this should remove the syntactic depency on rs1 in those cases. -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | As an open-source project, we welcome and encourage the community to submit patches directly to the project. In our collaborative open source environment, standards and methods for submitting changes help reduce the chaos that can result from an active development community. 4 | 5 | This document explains how to submit patches to the project so your patch will be accepted quickly in the codebase. 6 | 7 | ## Licensing 8 | 9 | Licensing is very important to open source projects. It helps ensure the software continues to be available under the terms that the author desired. 10 | 11 | This project uses the Creative Commons Attribution 4.0 International license, as found in the [LICENSE](https://github.com/riscv/docs-spec-template/blob/main/LICENSE) file in the project's repo. 12 | 13 | A license tells you what rights you have as an author, as provided by the copyright holder. It is important that the contributor fully understands the licensing rights and agrees to them. Sometimes the copyright holder isn't the contributor, such as when the contributor is doing work on behalf of a company. 14 | 15 | ## Developer Certification of Origin (DCO) 16 | 17 | To make a good faith effort to ensure licensing criteria are met, this project requires the Developer Certificate of Origin (DCO) process to be followed. 18 | 19 | The DCO is an attestation attached to every contribution made by every author. In the commit message of the contribution (described more fully later in this document), the author simply adds a ``Signed-off-by`` statement and thereby agrees to the DCO. 20 | 21 | When an author submits a patch, it is a commitment that the contributor has the right to submit the patch per the license. The DCO agreement is shown below and at https://developercertificate.org. 22 | 23 | ``` 24 | Developer's Certificate of Origin 1.1 25 | 26 | By making a contribution to this project, I certify that: 27 | 28 | (a) The contribution was created in whole or in part by me and I 29 | have the right to submit it under the open source license 30 | indicated in the file; or 31 | 32 | (b) The contribution is based upon previous work that, to the best 33 | of my knowledge, is covered under an appropriate open source 34 | license and I have the right under that license to submit that 35 | work with modifications, whether created in whole or in part 36 | by me, under the same open source license (unless I am 37 | permitted to submit under a different license), as indicated 38 | in the file; or 39 | 40 | (c) The contribution was provided directly to me by some other 41 | person who certified (a), (b) or (c) and I have not modified 42 | it. 43 | 44 | (d) I understand and agree that this project and the contribution 45 | are public and that a record of the contribution (including all 46 | personal information I submit with it, including my sign-off) is 47 | maintained indefinitely and may be redistributed consistent with 48 | this project or the open source license(s) involved. 49 | ``` 50 | 51 | ### DCO Sign-Off Methods 52 | 53 | The DCO requires that a sign-off message, in the following format, appears on each commit in the pull request: 54 | 55 | `Signed-off-by: Stephano Cetola ` 56 | 57 | You are required to use your real name in the sign-off message. 58 | 59 | The DCO text can either be manually added to your commit body, or you can add either ``-s`` or ``--signoff`` to your usual Git commit commands. If you forget to add the sign-off you can also amend a previous commit with the sign-off by running ``git commit --amend -s``. If you've pushed your changes to GitHub already you'll need to force push your branch after this with ``git push -f``. 60 | 61 | 62 | **Note:** 63 | 64 | The name and email address of the account you use to submit your PR must match the name and email address on the ``Signed-off-by`` line in your commit message. 65 | -------------------------------------------------------------------------------- /zicondops.adoc: -------------------------------------------------------------------------------- 1 | [[Zicond]] 2 | == Zicond specification 3 | 4 | The "Conditional" operations extension provides a simple solution that provides most of the benefit and all of the flexibility one would desire to support conditional arithmetic and conditional-select/move operations, while remaining true to the RISC-V design philosophy. 5 | The instructions follow the format for R-type instructions with 3 operands (i.e., 2 source operands and 1 destination operand). 6 | Using these instructions, branchless sequences can be implemented (typically in two-instruction sequences) without the need for instruction fusion, special provisions during the decoding of architectural instructions, or other microarchitectural provisions. 7 | 8 | The following instructions comprise the Zicond extension: 9 | 10 | [%header,cols="^1,^1,4,8"] 11 | |=== 12 | |RV32 13 | |RV64 14 | |Mnemonic 15 | |Instruction 16 | 17 | |✓ 18 | |✓ 19 | |czero.eqz _rd_, _rs1_, _rs2_ 20 | |<<#insns-czero-eqz>> 21 | 22 | |✓ 23 | |✓ 24 | |czero.nez _rd_, _rs1_, _rs2_ 25 | |<<#insns-czero-nez>> 26 | 27 | |=== 28 | 29 | [NOTE] 30 | ==== 31 | Architecture Comment: defining additional comparisons, in addition to equal-to-zero and not-equal-to-zero, does not offer a benefit due to the lack of immediates or an additional register operand that the comparison takes place against. 32 | ==== 33 | 34 | Based on these two instructions, synthetic instructions (i.e., short instruction sequences) for the following *conditional arithmetic* operations are supported: 35 | 36 | * conditional add, if zero 37 | * conditional add, if non-zero 38 | * conditional subtract, if zero 39 | * conditional subtract, if non-zero 40 | * conditional bitwise-and, if zero 41 | * conditional bitwise-and, if non-zero 42 | * conditional bitwise-or, if zero 43 | * conditional bitwise-or, if non-zero 44 | * conditional bitwise-xor, if zero 45 | * conditional bitwise-xor, if non-zero 46 | 47 | Additionally, the following *conditional select* instructions are supported: 48 | 49 | * conditional-select, if zero 50 | * conditional-select, if non-zero 51 | 52 | More complex conditions, such as comparisons against immediates, registers, single-bit tests, comparisons against ranges, etc. can be realized by composing these new instructions with existing instructions. 53 | 54 | == Instructions (in alphabetical order) 55 | 56 | <<< 57 | [#insns-czero-eqz,reftext="Conditional zero, if condition is equal to zero"] 58 | === czero.eqz 59 | 60 | Synopsis:: 61 | Moves zero to a register _rd_, if the condition _rs2_ is equal to zero, otherwise moves _rs1_ to _rd_. 62 | 63 | Mnemonic:: 64 | czero.eqz _rd_, _rs1_, _rs2_ 65 | 66 | Encoding:: 67 | [wavedrom, , svg] 68 | .... 69 | {reg:[ 70 | { bits: 7, name: 0x33, attr: ['OP'] }, 71 | { bits: 5, name: 'rd' }, 72 | { bits: 3, name: 0x5, attr: ['CZERO.EQZ']}, 73 | { bits: 5, name: 'rs1', attr: ['value'] }, 74 | { bits: 5, name: 'rs2', attr: ['condition'] }, 75 | { bits: 7, name: 0x7, attr: ['CZERO'] }, 76 | ]} 77 | .... 78 | 79 | Description:: 80 | If _rs2_ contains the value zero, this instruction writes the value zero to _rd_. Otherwise, this instruction copies the contents of _rs1_ to _rd_. 81 | 82 | This instruction carries a syntactic dependency from both _rs1_ and _rs2_ to _rd_. 83 | Furthermore, if the Zkt extension is implemented, this instruction's timing is independent of the data values in _rs1_ and _rs2_. 84 | 85 | SAIL code:: 86 | [source,sail] 87 | -- 88 | let condition = X(rs2); 89 | result : xlenbits = if (condition == zeros()) then zeros() 90 | else X(rs1); 91 | X(rd) = result; 92 | -- 93 | 94 | <<< 95 | [#insns-czero-nez,reftext="Conditional zero, if condition is nonzero"] 96 | === czero.nez 97 | 98 | Synopsis:: 99 | Moves zero to a register _rd_, if the condition _rs2_ is nonzero, otherwise moves _rs1_ to _rd_. 100 | 101 | Mnemonic:: 102 | czero.nez _rd_, _rs1_, _rs2_ 103 | 104 | Encoding:: 105 | [wavedrom, , svg] 106 | .... 107 | {reg:[ 108 | { bits: 7, name: 0x33, attr: ['OP'] }, 109 | { bits: 5, name: 'rd' }, 110 | { bits: 3, name: 0x7, attr: ['CZERO.NEZ']}, 111 | { bits: 5, name: 'rs1', attr: ['value'] }, 112 | { bits: 5, name: 'rs2', attr: ['condition'] }, 113 | { bits: 7, name: 0x7, attr: ['CZERO'] }, 114 | ]} 115 | .... 116 | 117 | Description:: 118 | If _rs2_ contains a nonzero value, this instruction writes the value zero to _rd_. Otherwise, this instruction copies the contents of _rs1_ to _rd_. 119 | 120 | This instruction carries a syntactic dependency from both _rs1_ and _rs2_ to _rd_. 121 | Furthermore, if the Zkt extension is implemented, this instruction's timing is independent of the data values in _rs1_ and _rs2_. 122 | 123 | SAIL code:: 124 | [source,sail] 125 | -- 126 | let condition = X(rs2); 127 | result : xlenbits = if (condition != zeros()) then zeros() 128 | else X(rs1); 129 | X(rd) = result; 130 | -- 131 | 132 | == Usage examples 133 | 134 | The instructions from this extension can be used to construct sequences that perform conditional-arithmetic, conditional-bitwise-logical, and conditional-select operations. 135 | 136 | === Instruction sequences 137 | 138 | [%header,cols="4,.^3l,^2"] 139 | |=== 140 | |Operation 141 | |Instruction sequence 142 | |Length 143 | 144 | |*Conditional add, if zero* + 145 | `rd = (rc == 0) ? (rs1 + rs2) : rs1` 146 | |czero.nez rd, rs2, rc 147 | add rd, rs1, rd 148 | .8+.^|2 insns 149 | 150 | |*Conditional add, if non-zero* + 151 | `rd = (rc != 0) ? (rs1 + rs2) : rs1` 152 | |czero.eqz rd, rs2, rc 153 | add rd, rs1, rd 154 | 155 | |*Conditional subtract, if zero* + 156 | `rd = (rc == 0) ? (rs1 - rs2) : rs1` 157 | |czero.nez rd, rs2, rc 158 | sub rd, rs1, rd 159 | 160 | |*Conditional subtract, if non-zero* + 161 | `rd = (rc != 0) ? (rs1 - rs2) : rs1` 162 | |czero.eqz rd, rs2, rc 163 | sub rd, rs1, rd 164 | 165 | |*Conditional bitwise-or, if zero* + 166 | `rd = (rc == 0) ? (rs1 \| rs2) : rs1` 167 | |czero.nez rd, rs2, rc 168 | or rd, rs1, rd 169 | 170 | |*Conditional bitwise-or, if non-zero* + 171 | `rd = (rc != 0) ? (rs1 \| rs2) : rs1` 172 | |czero.eqz rd, rs2, rc 173 | or rd, rs1, rd 174 | 175 | |*Conditional bitwise-xor, if zero* + 176 | `rd = (rc == 0) ? (rs1 ^ rs2) : rs1` 177 | |czero.nez rd, rs2, rc 178 | xor rd, rs1, rd 179 | 180 | |*Conditional bitwise-xor, if non-zero* + 181 | `rd = (rc != 0) ? (rs1 ^ rs2) : rs1` 182 | |czero.eqz rd, rs2, rc 183 | xor rd, rs1, rd 184 | 185 | |*Conditional bitwise-and, if zero* + 186 | `rd = (rc == 0) ? (rs1 & rs2) : rs1` 187 | |and rd, rs1, rs2 188 | czero.eqz rtmp, rs1, rc 189 | or rd, rd, rtmp 190 | .4+.^|3 insns + 191 | (requires 1 temporary) 192 | 193 | |*Conditional bitwise-and, if non-zero* + 194 | `rd = (rc != 0) ? (rs1 & rs2) : rs1` 195 | |and rd, rs1, rs2 196 | czero.nez rtmp, rs1, rc 197 | or rd, rd, rtmp 198 | 199 | |*Conditional select, if zero* + 200 | `rd = (rc == 0) ? rs1 : rs2` 201 | |czero.nez rd, rs1, rc 202 | czero.eqz rtmp, rs2, rc 203 | or rd, rd, rtmp 204 | 205 | |*Conditional select, if non-zero* + 206 | `rd = (rc != 0) ? rs1 : rs2` 207 | |czero.eqz rd, rs1, rc 208 | czero.nez rtmp, rs2, rc 209 | or rd, rd, rtmp 210 | 211 | |=== 212 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution 4.0 International Public License 58 | 59 | By exercising the Licensed Rights (defined below), You accept and agree 60 | to be bound by the terms and conditions of this Creative Commons 61 | Attribution 4.0 International Public License ("Public License"). To the 62 | extent this Public License may be interpreted as a contract, You are 63 | granted the Licensed Rights in consideration of Your acceptance of 64 | these terms and conditions, and the Licensor grants You such rights in 65 | consideration of benefits the Licensor receives from making the 66 | Licensed Material available under these terms and conditions. 67 | 68 | 69 | Section 1 -- Definitions. 70 | 71 | a. Adapted Material means material subject to Copyright and Similar 72 | Rights that is derived from or based upon the Licensed Material 73 | and in which the Licensed Material is translated, altered, 74 | arranged, transformed, or otherwise modified in a manner requiring 75 | permission under the Copyright and Similar Rights held by the 76 | Licensor. For purposes of this Public License, where the Licensed 77 | Material is a musical work, performance, or sound recording, 78 | Adapted Material is always produced where the Licensed Material is 79 | synched in timed relation with a moving image. 80 | 81 | b. Adapter's License means the license You apply to Your Copyright 82 | and Similar Rights in Your contributions to Adapted Material in 83 | accordance with the terms and conditions of this Public License. 84 | 85 | c. Copyright and Similar Rights means copyright and/or similar rights 86 | closely related to copyright including, without limitation, 87 | performance, broadcast, sound recording, and Sui Generis Database 88 | Rights, without regard to how the rights are labeled or 89 | categorized. For purposes of this Public License, the rights 90 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 91 | Rights. 92 | 93 | d. Effective Technological Measures means those measures that, in the 94 | absence of proper authority, may not be circumvented under laws 95 | fulfilling obligations under Article 11 of the WIPO Copyright 96 | Treaty adopted on December 20, 1996, and/or similar international 97 | agreements. 98 | 99 | e. Exceptions and Limitations means fair use, fair dealing, and/or 100 | any other exception or limitation to Copyright and Similar Rights 101 | that applies to Your use of the Licensed Material. 102 | 103 | f. Licensed Material means the artistic or literary work, database, 104 | or other material to which the Licensor applied this Public 105 | License. 106 | 107 | g. Licensed Rights means the rights granted to You subject to the 108 | terms and conditions of this Public License, which are limited to 109 | all Copyright and Similar Rights that apply to Your use of the 110 | Licensed Material and that the Licensor has authority to license. 111 | 112 | h. Licensor means the individual(s) or entity(ies) granting rights 113 | under this Public License. 114 | 115 | i. Share means to provide material to the public by any means or 116 | process that requires permission under the Licensed Rights, such 117 | as reproduction, public display, public performance, distribution, 118 | dissemination, communication, or importation, and to make material 119 | available to the public including in ways that members of the 120 | public may access the material from a place and at a time 121 | individually chosen by them. 122 | 123 | j. Sui Generis Database Rights means rights other than copyright 124 | resulting from Directive 96/9/EC of the European Parliament and of 125 | the Council of 11 March 1996 on the legal protection of databases, 126 | as amended and/or succeeded, as well as other essentially 127 | equivalent rights anywhere in the world. 128 | 129 | k. You means the individual or entity exercising the Licensed Rights 130 | under this Public License. Your has a corresponding meaning. 131 | 132 | 133 | Section 2 -- Scope. 134 | 135 | a. License grant. 136 | 137 | 1. Subject to the terms and conditions of this Public License, 138 | the Licensor hereby grants You a worldwide, royalty-free, 139 | non-sublicensable, non-exclusive, irrevocable license to 140 | exercise the Licensed Rights in the Licensed Material to: 141 | 142 | a. reproduce and Share the Licensed Material, in whole or 143 | in part; and 144 | 145 | b. produce, reproduce, and Share Adapted Material. 146 | 147 | 2. Exceptions and Limitations. For the avoidance of doubt, where 148 | Exceptions and Limitations apply to Your use, this Public 149 | License does not apply, and You do not need to comply with 150 | its terms and conditions. 151 | 152 | 3. Term. The term of this Public License is specified in Section 153 | 6(a). 154 | 155 | 4. Media and formats; technical modifications allowed. The 156 | Licensor authorizes You to exercise the Licensed Rights in 157 | all media and formats whether now known or hereafter created, 158 | and to make technical modifications necessary to do so. The 159 | Licensor waives and/or agrees not to assert any right or 160 | authority to forbid You from making technical modifications 161 | necessary to exercise the Licensed Rights, including 162 | technical modifications necessary to circumvent Effective 163 | Technological Measures. For purposes of this Public License, 164 | simply making modifications authorized by this Section 2(a) 165 | (4) never produces Adapted Material. 166 | 167 | 5. Downstream recipients. 168 | 169 | a. Offer from the Licensor -- Licensed Material. Every 170 | recipient of the Licensed Material automatically 171 | receives an offer from the Licensor to exercise the 172 | Licensed Rights under the terms and conditions of this 173 | Public License. 174 | 175 | b. No downstream restrictions. You may not offer or impose 176 | any additional or different terms or conditions on, or 177 | apply any Effective Technological Measures to, the 178 | Licensed Material if doing so restricts exercise of the 179 | Licensed Rights by any recipient of the Licensed 180 | Material. 181 | 182 | 6. No endorsement. Nothing in this Public License constitutes or 183 | may be construed as permission to assert or imply that You 184 | are, or that Your use of the Licensed Material is, connected 185 | with, or sponsored, endorsed, or granted official status by, 186 | the Licensor or others designated to receive attribution as 187 | provided in Section 3(a)(1)(A)(i). 188 | 189 | b. Other rights. 190 | 191 | 1. Moral rights, such as the right of integrity, are not 192 | licensed under this Public License, nor are publicity, 193 | privacy, and/or other similar personality rights; however, to 194 | the extent possible, the Licensor waives and/or agrees not to 195 | assert any such rights held by the Licensor to the limited 196 | extent necessary to allow You to exercise the Licensed 197 | Rights, but not otherwise. 198 | 199 | 2. Patent and trademark rights are not licensed under this 200 | Public License. 201 | 202 | 3. To the extent possible, the Licensor waives any right to 203 | collect royalties from You for the exercise of the Licensed 204 | Rights, whether directly or through a collecting society 205 | under any voluntary or waivable statutory or compulsory 206 | licensing scheme. In all other cases the Licensor expressly 207 | reserves any right to collect such royalties. 208 | 209 | 210 | Section 3 -- License Conditions. 211 | 212 | Your exercise of the Licensed Rights is expressly made subject to the 213 | following conditions. 214 | 215 | a. Attribution. 216 | 217 | 1. If You Share the Licensed Material (including in modified 218 | form), You must: 219 | 220 | a. retain the following if it is supplied by the Licensor 221 | with the Licensed Material: 222 | 223 | i. identification of the creator(s) of the Licensed 224 | Material and any others designated to receive 225 | attribution, in any reasonable manner requested by 226 | the Licensor (including by pseudonym if 227 | designated); 228 | 229 | ii. a copyright notice; 230 | 231 | iii. a notice that refers to this Public License; 232 | 233 | iv. a notice that refers to the disclaimer of 234 | warranties; 235 | 236 | v. a URI or hyperlink to the Licensed Material to the 237 | extent reasonably practicable; 238 | 239 | b. indicate if You modified the Licensed Material and 240 | retain an indication of any previous modifications; and 241 | 242 | c. indicate the Licensed Material is licensed under this 243 | Public License, and include the text of, or the URI or 244 | hyperlink to, this Public License. 245 | 246 | 2. You may satisfy the conditions in Section 3(a)(1) in any 247 | reasonable manner based on the medium, means, and context in 248 | which You Share the Licensed Material. For example, it may be 249 | reasonable to satisfy the conditions by providing a URI or 250 | hyperlink to a resource that includes the required 251 | information. 252 | 253 | 3. If requested by the Licensor, You must remove any of the 254 | information required by Section 3(a)(1)(A) to the extent 255 | reasonably practicable. 256 | 257 | 4. If You Share Adapted Material You produce, the Adapter's 258 | License You apply must not prevent recipients of the Adapted 259 | Material from complying with this Public License. 260 | 261 | 262 | Section 4 -- Sui Generis Database Rights. 263 | 264 | Where the Licensed Rights include Sui Generis Database Rights that 265 | apply to Your use of the Licensed Material: 266 | 267 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 268 | to extract, reuse, reproduce, and Share all or a substantial 269 | portion of the contents of the database; 270 | 271 | b. if You include all or a substantial portion of the database 272 | contents in a database in which You have Sui Generis Database 273 | Rights, then the database in which You have Sui Generis Database 274 | Rights (but not its individual contents) is Adapted Material; and 275 | 276 | c. You must comply with the conditions in Section 3(a) if You Share 277 | all or a substantial portion of the contents of the database. 278 | 279 | For the avoidance of doubt, this Section 4 supplements and does not 280 | replace Your obligations under this Public License where the Licensed 281 | Rights include other Copyright and Similar Rights. 282 | 283 | 284 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 285 | 286 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 287 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 288 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 289 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 290 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 291 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 292 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 293 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 294 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 295 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 296 | 297 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 298 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 299 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 300 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 301 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 302 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 303 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 304 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 305 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 306 | 307 | c. The disclaimer of warranties and limitation of liability provided 308 | above shall be interpreted in a manner that, to the extent 309 | possible, most closely approximates an absolute disclaimer and 310 | waiver of all liability. 311 | 312 | 313 | Section 6 -- Term and Termination. 314 | 315 | a. This Public License applies for the term of the Copyright and 316 | Similar Rights licensed here. However, if You fail to comply with 317 | this Public License, then Your rights under this Public License 318 | terminate automatically. 319 | 320 | b. Where Your right to use the Licensed Material has terminated under 321 | Section 6(a), it reinstates: 322 | 323 | 1. automatically as of the date the violation is cured, provided 324 | it is cured within 30 days of Your discovery of the 325 | violation; or 326 | 327 | 2. upon express reinstatement by the Licensor. 328 | 329 | For the avoidance of doubt, this Section 6(b) does not affect any 330 | right the Licensor may have to seek remedies for Your violations 331 | of this Public License. 332 | 333 | c. For the avoidance of doubt, the Licensor may also offer the 334 | Licensed Material under separate terms or conditions or stop 335 | distributing the Licensed Material at any time; however, doing so 336 | will not terminate this Public License. 337 | 338 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 339 | License. 340 | 341 | 342 | Section 7 -- Other Terms and Conditions. 343 | 344 | a. The Licensor shall not be bound by any additional or different 345 | terms or conditions communicated by You unless expressly agreed. 346 | 347 | b. Any arrangements, understandings, or agreements regarding the 348 | Licensed Material not stated herein are separate from and 349 | independent of the terms and conditions of this Public License. 350 | 351 | 352 | Section 8 -- Interpretation. 353 | 354 | a. For the avoidance of doubt, this Public License does not, and 355 | shall not be interpreted to, reduce, limit, restrict, or impose 356 | conditions on any use of the Licensed Material that could lawfully 357 | be made without permission under this Public License. 358 | 359 | b. To the extent possible, if any provision of this Public License is 360 | deemed unenforceable, it shall be automatically reformed to the 361 | minimum extent necessary to make it enforceable. If the provision 362 | cannot be reformed, it shall be severed from this Public License 363 | without affecting the enforceability of the remaining terms and 364 | conditions. 365 | 366 | c. No term or condition of this Public License will be waived and no 367 | failure to comply consented to unless expressly agreed to by the 368 | Licensor. 369 | 370 | d. Nothing in this Public License constitutes or may be interpreted 371 | as a limitation upon, or waiver of, any privileges and immunities 372 | that apply to the Licensor or You, including from the legal 373 | processes of any jurisdiction or authority. 374 | 375 | 376 | ======================================================================= 377 | 378 | Creative Commons is not a party to its public 379 | licenses. Notwithstanding, Creative Commons may elect to apply one of 380 | its public licenses to material it publishes and in those instances 381 | will be considered the “Licensor.” The text of the Creative Commons 382 | public licenses is dedicated to the public domain under the CC0 Public 383 | Domain Dedication. Except for the limited purpose of indicating that 384 | material is shared under a Creative Commons public license or as 385 | otherwise permitted by the Creative Commons policies published at 386 | creativecommons.org/policies, Creative Commons does not authorize the 387 | use of the trademark "Creative Commons" or any other trademark or logo 388 | of Creative Commons without its prior written consent including, 389 | without limitation, in connection with any unauthorized modifications 390 | to any of its public licenses or any other arrangements, 391 | understandings, or agreements concerning use of licensed material. For 392 | the avoidance of doubt, this paragraph does not form part of the 393 | public licenses. 394 | 395 | Creative Commons may be contacted at creativecommons.org. 396 | 397 | --------------------------------------------------------------------------------