Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/vet: doesn't handle complex64 or complex128 types in asm functions #15630

Closed
Kunde21 opened this issue May 10, 2016 · 1 comment

Comments

Projects
None yet
5 participants
@Kunde21
Copy link

commented May 10, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6.2 linux/amd64
  2. What operating system and processor architecture are you using (go env)?
    linux/amd64
  3. What did you do?
    go vet doesn't properly handle complex types in asm functions. To reproduce,

asm.go:

package main

func CVTc128toc64(n complex128) complex64

asm_amd64.s:

// func CVTc128toc64(n complex128) complex64
TEXT ·CVTc128toc64(SB), $0-8
        CVTPD2PS n+0(FP), X0
        MOVB     n+0(FP), AX
        MOVAPS   X0, ret+8(FP)
        RET
  1. What did you expect to see?
    I expect go vet output for these files to be:
asm_amd64.s:2: [amd64] CVTc128toc64: wrong argument size 8; expected $...-24
asm_amd64.s:4: [amd64] CVTc128toc64: invalid MOVB of n+0(FP); complex128 is a 16-byte value
asm_amd64.s:3: [amd64] CVTc128toc64: invalid offset ret+8(FP); expected ret+16(FP)
  1. What did you see instead?
    The output from go vet is:
asm.go:3: unknown assembly argument type complex128
asm.go:3: unknown assembly argument type complex64
asm.go:3: unknown assembly argument type complex128
asm.go:3: unknown assembly argument type complex64
asm.go:3: unknown assembly argument type complex128
asm.go:3: unknown assembly argument type complex64
asm.go:3: unknown assembly argument type complex128
asm.go:3: unknown assembly argument type complex64
asm.go:3: unknown assembly argument type complex128
asm.go:3: unknown assembly argument type complex64
asm.go:3: unknown assembly argument type complex128
asm.go:3: unknown assembly argument type complex64
asm.go:3: unknown assembly argument type complex128
asm.go:3: unknown assembly argument type complex64
asm_amd64.s:2: [amd64] CVTc128toc64: function CVTc128toc64 missing Go declaration

@mdempsky mdempsky added this to the Go1.8 milestone May 10, 2016

@bradfitz bradfitz changed the title Go vet doesn't handle complex64 or complex128 types in asm functions cmd/vet: doesn't handle complex64 or complex128 types in asm functions May 10, 2016

@robpike robpike self-assigned this Jun 21, 2016

@quentinmit quentinmit added the NeedsFix label Oct 6, 2016

@robpike

This comment has been minimized.

Copy link
Contributor

commented Oct 16, 2016

Fixed. At tip it now says

bismarck=% go vet
x.s:2: [amd64] CVTc128toc64: wrong argument size 8; expected $...-24
x.s:3: [amd64] CVTc128toc64: invalid CVTPD of n+0(FP); complex128 is 16-byte value containing n_real+0(FP) and n_imag+8(FP)
x.s:4: [amd64] CVTc128toc64: invalid MOVB of n+0(FP); complex128 is 16-byte value containing n_real+0(FP) and n_imag+8(FP)
x.s:5: [amd64] CVTc128toc64: invalid offset ret+8(FP); expected ret+16(FP), ret_real+16(FP), or ret_imag+20(FP)
exit status 1
bismarck=%

not sure what the fix was, but it happened in drive-by.

@robpike robpike closed this Oct 16, 2016

@golang golang locked and limited conversation to collaborators Oct 16, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.