[pull] master from golang:master#36
Merged
Merged
Conversation
Database drivers can support a variety of optional features. For example, a driver.Conn can optionally implement the Queryer and/or QueryerContext interfaces. We currently run most database/sql tests with a general-purpose test driver which implements most optional interfaces. Add support for running tests with a variety of different drivers. To start with, use two variations: A "basic" driver which only implements the minimal mandatory interfaces, and a "default" driver which implements most optional interfaces. For #67546 Change-Id: I60bd02260810b6468e6b02a1ac7544406a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/766700 Reviewed-by: Alan Donovan <adonovan@google.com> Auto-Submit: Damien Neil <dneil@google.com> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Fixes #76056 Fixes #76060 If we modify the issue's fieldReduceOnce2 function to: // fieldReduceOnce reduces a value a < 2q. func fieldReduceOnce2(a uint32) fieldElement { x, b := bits.Sub(uint(a), uint(q), 0) return fieldElement(subtle.ConstantTimeSelect(int(b), int(a), int(x))) } We get the wanted assembly*: MOVL AX, CX MOVL AX, DX SUBQ $8380417, CX CMOVQCS DX, CX MOVQ CX, AX ; not ideal code size but handled by the register renaming unit RET Changes made to fieldReduceOnce2: - fixed a bug where a and x arguments to subtle.ConstantTimeSelect were swapped. we should use a when the sub underflows and x otherwise. - use bits.Sub rather than bits.Sub32 which is intriscified. *we use CMOVQCS + MOVQ because the CMOV randomly gets generated backward, I believe this would be fixed if we teach regalloc to commut CMOV (by swapping the two register args and inverting the condition). Change-Id: I01eca545d3c5c8a1c1f5a107e0089f715359dfc6 Reviewed-on: https://go-review.googlesource.com/c/go/+/778141 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )