-
-
Save jacobsa/e1b3c19cae7fb430a8a03ee9b19b933a to your computer and use it in GitHub Desktop.
This file contains 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
package main | |
import "fmt" | |
func foo() (x uint32) | |
func main() { | |
fmt.Println(foo()) | |
} |
This file contains 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
// +build amd64 | |
#include "textflag.h" | |
// func foo() (x uint32) | |
TEXT ·foo(SB), NOSPLIT, $0-4 | |
// Stick 123 into the low 32 bits of X0. | |
MOVQ $123, AX | |
PINSRD $0, AX, X0 | |
// Return them. | |
PEXTRD $0, X0, x+0(FP) | |
RET |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment