Skip to content

Instantly share code, notes, and snippets.

@bwrsandman
Created March 10, 2019 02:50
Show Gist options
  • Save bwrsandman/390712c2f29a7645f03e67d9daf8ce81 to your computer and use it in GitHub Desktop.
Save bwrsandman/390712c2f29a7645f03e67d9daf8ce81 to your computer and use it in GitHub Desktop.
Adding __attribute__ ((optnone)) to set_zero in src/xenia/cpu/hir/value.h
--- /proc/self/fd/11 2019-03-09 21:47:38.316521355 -0500
+++ /proc/self/fd/13 2019-03-09 21:47:38.316521355 -0500
@@ -1,5 +1,5 @@
-opt/constant_propagation_pass.o: file format elf64-x86-64
+noopt/constant_propagation_pass.o: file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x0000000000000000
@@ -3027,15 +3027,24 @@
Disassembly of section .text._ZN2xe3cpu3hir5Value8set_zeroENS1_8TypeNameE:
0000000000000000 <xe::cpu::hir::Value::set_zero(xe::cpu::hir::TypeName)>:
- void set_zero(TypeName new_type) {
+ void set_zero(TypeName new_type) __attribute__ ((optnone)){
+ 0: 48 89 7c 24 f8 mov %rdi,-0x8(%rsp)
+ 5: 89 74 24 f4 mov %esi,-0xc(%rsp)
+ 9: 48 8b 44 24 f8 mov -0x8(%rsp),%rax
type = new_type;
- 0: 89 77 04 mov %esi,0x4(%rdi)
+ e: 8b 4c 24 f4 mov -0xc(%rsp),%ecx
+ 12: 89 48 04 mov %ecx,0x4(%rax)
flags |= VALUE_IS_CONSTANT;
- 3: 80 4f 08 02 orb $0x2,0x8(%rdi)
+ 15: 8b 48 08 mov 0x8(%rax),%ecx
+ 18: 83 c9 02 or $0x2,%ecx
+ 1b: 89 48 08 mov %ecx,0x8(%rax)
constant.v128.low = constant.v128.high = 0;
- 7: c5 f8 57 c0 vxorps %xmm0,%xmm0,%xmm0
- b: c5 f8 29 47 20 vmovaps %xmm0,0x20(%rdi)
+ 1e: 48 c7 40 28 00 00 00 movq $0x0,0x28(%rax)
+ 25: 00
+ 26: 48 c7 40 20 00 00 00 movq $0x0,0x20(%rax)
+ 2d: 00
}
- 10: c3 retq
+ 2e: c3 retq
Disassembly of section .text._ZN2xe3cpu8compiler6passes23ConditionalGroupSubpass3RunEPNS0_3hir10HIRBuilderE:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment