-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#EDITS: adding some very broken assembly for dgemm routine
- Loading branch information
1 parent
443053d
commit 9a2dfac
Showing
10 changed files
with
1,453 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.globl asm_function | ||
asm_function: | ||
// Assembly code to add two integers | ||
// Parameters are passed in registers: a in %edi, b in %esi | ||
// Result is stored in %eax | ||
// Load a into %eax | ||
mov %edi, %eax | ||
|
||
// Add b to %eax | ||
add %esi, %eax | ||
|
||
// Add c to %eax | ||
add %edx, %eax | ||
|
||
// Subtract d from %eax | ||
sub %ecx, %eax | ||
|
||
ret // Return | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <stdio.h> | ||
|
||
// Declare the assembly function as an external function | ||
extern int asm_function(int a, int b, int c, int d); | ||
|
||
int add (int a, int b, int c) { | ||
int d = 2; | ||
|
||
return asm_function(a, b, c, d); | ||
} | ||
|
||
int main() { | ||
int a = 5; | ||
int b = 7; | ||
int c = 10; | ||
//int result = asm_function(5, 7); | ||
int result = add(a, b, c); | ||
printf("Result: %d\n", result); | ||
return 0; | ||
} | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#ifndef DGEMM_ASM_H | ||
#define DGEMM_ASM_H | ||
|
||
|
||
|
||
#endif | ||
|
Oops, something went wrong.