search for: movb

Displaying 20 results from an estimated 391 matches for "movb".

2016 May 24
5
Liveness of AL, AH and AX in x86 backend
...{ char x, y; } struct_t; struct_t z; struct_t foo(char *p) { struct_t s; s.x = *p++; s.y = *p; z = s; s.x++; return s; } But the output at -O2 is foo: # @foo .cfi_startproc # BB#0: # %entry movb (%rdi), %al movzbl 1(%rdi), %ecx movb %al, z(%rip) movb %cl, z+1(%rip) incb %al shll $8, %ecx movzbl %al, %eax orl %ecx, %eax retq I was hoping it would do something along the lines of movb (%rdi), %a...
2005 Feb 22
0
[LLVMdev] Area for improvement
...rd, @function > init_board: > subl $4, %esp > movl %esi, (%esp) > movl 8(%esp), %eax > movl $0, %ecx > .LBBinit_board_1: # loopexit.1 > imull $7, %ecx, %edx > movl %eax, %esi > addl %edx, %esi > movb $46, (%esi) > imull $7, %ecx, %edx > movl %eax, %esi > addl %edx, %esi > leal 1(%esi), %edx > movb $46, (%edx) > imull $7, %ecx, %edx > movl %eax, %esi > addl %edx, %esi > leal 2(%esi), %edx >...
2009 Mar 30
2
[PATCH 1/1] v2 Add Diagnostic MBR for trouble-shooting
...*/ + + ljmpw $0, $get_shift_keys /* far jump to ensure CS:IP are set correctly to 0000:0600+get_shift_keys */ + /* rather than the current CS:IP which will be based on 0x7C00 */ + +get_shift_keys: /* Provide a way for the user to force CHS addressing mode by pressing either Shift key */ + movb $0x02, %ah /* function: get keyboard shift flags */ + int $0x16 /* read keys; shift flags returned in AL */ + testb $0x03, %al /* left or right shift-keys pressed? */ + jnz use_chs_addressing /* if so, skip detection of BIOS type */ + +detect_bios_type: + /* try to use the BIOS extensi...
2009 Mar 30
0
[PATCH 1/1] Add Diagnostic MBR for trouble-shooting
...*/ + + ljmpw $0, $get_shift_keys /* far jump to ensure CS:IP are set correctly to 0000:0600+get_shift_keys */ + /* rather than the current CS:IP which will be based on 0x7C00 */ + +get_shift_keys: /* Provide a way for the user to force CHS addressing mode by pressing either Shift key */ + movb $0x02, %ah /* function: get keyboard shift flags */ + int $0x16 /* read keys; shift flags returned in AL */ + testb $0x03, %al /* left or right shift-keys pressed? */ + jnz use_chs_addressing /* if so, skip detection of BIOS type */ + +detect_bios_type: + /* try to use the BIOS extensi...
2016 May 24
0
Liveness of AL, AH and AX in x86 backend
...har *p) { > struct_t s; > s.x = *p++; > s.y = *p; > z = s; > s.x++; > return s; >} > >But the output at -O2 is > >foo: # @foo > .cfi_startproc ># BB#0: # %entry > movb (%rdi), %al > movzbl 1(%rdi), %ecx > movb %al, z(%rip) > movb %cl, z+1(%rip) > incb %al > shll $8, %ecx > movzbl %al, %eax > orl %ecx, %eax > retq > > >I was hoping it would do some...
2009 Mar 30
2
[PATCH 1/1] v3: Add Diagnostic MBR for trouble-shooting BIOS boot-order problems.
...han the current CS:IP which will be based on 0x7C00 */ + +get_shift_keys: /* Provide a way for the user to force CHS addressing mode by pressing either Shift key */ + testb $0x04, 0x0417 /* I/O memory-mapped keyboard shift flags: control key pressed? */ + jz shift_test +force_first_hard_disk: + movb $0x80, -6(%bp) /* offset from top-of-stack to drive number; force it to be first hard disk */ + movb $0x80, %dl /* change the drive number about to be used in detect_bios_type */ +shift_test: + testb $0x03, 0x0417 /* left or right shift-keys pressed? */ + jnz use_chs_addressing /* if so, skip d...
2005 Feb 22
5
[LLVMdev] Area for improvement
....globl init_board .type init_board, @function init_board: subl $4, %esp movl %esi, (%esp) movl 8(%esp), %eax movl $0, %ecx .LBBinit_board_1: # loopexit.1 imull $7, %ecx, %edx movl %eax, %esi addl %edx, %esi movb $46, (%esi) imull $7, %ecx, %edx movl %eax, %esi addl %edx, %esi leal 1(%esi), %edx movb $46, (%edx) imull $7, %ecx, %edx movl %eax, %esi addl %edx, %esi leal 2(%esi), %edx movb $46, (%edx) imull $7, %ecx, %edx...
2016 May 24
0
Liveness of AL, AH and AX in x86 backend
...(char *p) { > struct_t s; > s.x = *p++; > s.y = *p; > z = s; > s.x++; > return s; > } > > But the output at -O2 is > > foo: # @foo > .cfi_startproc > # BB#0: # %entry > movb (%rdi), %al > movzbl 1(%rdi), %ecx > movb %al, z(%rip) > movb %cl, z+1(%rip) > incb %al > shll $8, %ecx > movzbl %al, %eax > orl %ecx, %eax > retq > > > I was hoping it would do something...
2007 Apr 18
0
[PATCH 8/12] base-limit-cleanup
...m-i386/system.h 2005-08-08 20:47:32.000000000 -0700 @@ -29,49 +29,39 @@ "2" (prev), "d" (next)); \ } while (0) -#define _set_base(addr,base) do { unsigned long __pr; \ -__asm__ __volatile__ ("movw %%dx,%1\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %%dl,%2\n\t" \ - "movb %%dh,%3" \ - :"=&d" (__pr) \ - :"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7)), \ - "0" (base) \ - ); } while(0) - -#define _set_limit(addr,limit) do { unsigned long __lr; \...
2007 Apr 18
0
[PATCH 8/12] base-limit-cleanup
...m-i386/system.h 2005-08-08 20:47:32.000000000 -0700 @@ -29,49 +29,39 @@ "2" (prev), "d" (next)); \ } while (0) -#define _set_base(addr,base) do { unsigned long __pr; \ -__asm__ __volatile__ ("movw %%dx,%1\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %%dl,%2\n\t" \ - "movb %%dh,%3" \ - :"=&d" (__pr) \ - :"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7)), \ - "0" (base) \ - ); } while(0) - -#define _set_limit(addr,limit) do { unsigned long __lr; \...
2019 Aug 08
2
Suboptimal code generated by clang+llc in quite a common scenario (?)
...cording to that, the variable ‘scscx’ is loaded three times despite it’s never modified. The resulting assembly code is this: .globl _tst _tst: .cfi_startproc pushl %ebp .cfi_def_cfa_offset 8 .cfi_offset %ebp, -8 movl %esp, %ebp .cfi_def_cfa_register %ebp pushl %esi .cfi_offset %esi, -12 movb 16(%ebp), %al movb 12(%ebp), %cl movb 8(%ebp), %dl movl _scscx, %esi movb %dl, (%esi) movl _scscx, %edx movb %cl, 1(%edx) movl _scscx, %ecx movb %al, 2(%ecx) xorl %eax, %eax popl %esi popl %ebp retl .cfi_endproc .comm _pp,3,0 .section __DATA,__data .globl _scscx .p2align 3 _scscx:...
2007 Apr 18
0
[PATCH 6/12] early-clobber-tss
...-0700 @@ -51,17 +51,21 @@ extern struct desc_struct default_ldt[]; extern void set_intr_gate(unsigned int irq, void * addr); -#define _set_tssldt_desc(n,addr,limit,type) \ -asm volatile ("movw %w3,0(%2)\n\t" \ - "movw %w1,2(%2)\n\t" \ - "rorl $16,%1\n\t" \ - "movb %b1,4(%2)\n\t" \ - "movb %4,5(%2)\n\t" \ - "movb $0,6(%2)\n\t" \ - "movb %h1,7(%2)\n\t" \ - "rorl $16,%1" \ - : "=m"(*(n)) : "q" (addr), "r"(n), "ir"(limit), "i"(type)) - +#define _set_tssldt_desc(desc,ad...
2007 Apr 18
0
[PATCH 9/12] base-into-desc
...@@ "2" (prev), "d" (next)); \ } while (0) -#define _set_base(desc,base) do { \ - unsigned long __tmp; \ - typecheck(struct desc_struct *, desc); \ - asm volatile("movw %w5,%2\n\t" \ - "rorl $16,%5\n\t" \ - "movb %b5,%3\n\t" \ - "movb %h5,%4" \ - :"=m"(*(desc)), \ - "=&q" (__tmp) \ - :"m" (*((char *)(desc)+2)), \ - "m" (*((char *)(desc)+4)), \ - "m" (*((char *)(desc)+7)), \ -...
2007 Apr 18
1
[PATCH 5/14] i386 / Use early clobber to eliminate rotate in desc
...@ -34,17 +34,21 @@ extern struct desc_struct default_ldt[]; extern void set_intr_gate(unsigned int irq, void * addr); -#define _set_tssldt_desc(n,addr,limit,type) \ -__asm__ __volatile__ ("movw %w3,0(%2)\n\t" \ - "movw %w1,2(%2)\n\t" \ - "rorl $16,%1\n\t" \ - "movb %b1,4(%2)\n\t" \ - "movb %4,5(%2)\n\t" \ - "movb $0,6(%2)\n\t" \ - "movb %h1,7(%2)\n\t" \ - "rorl $16,%1" \ - : "=m"(*(n)) : "q" (addr), "r"(n), "ir"(limit), "i"(type)) - +#define _set_tssldt_desc(desc,ad...
2007 Apr 18
0
[PATCH 6/12] early-clobber-tss
...-0700 @@ -51,17 +51,21 @@ extern struct desc_struct default_ldt[]; extern void set_intr_gate(unsigned int irq, void * addr); -#define _set_tssldt_desc(n,addr,limit,type) \ -asm volatile ("movw %w3,0(%2)\n\t" \ - "movw %w1,2(%2)\n\t" \ - "rorl $16,%1\n\t" \ - "movb %b1,4(%2)\n\t" \ - "movb %4,5(%2)\n\t" \ - "movb $0,6(%2)\n\t" \ - "movb %h1,7(%2)\n\t" \ - "rorl $16,%1" \ - : "=m"(*(n)) : "q" (addr), "r"(n), "ir"(limit), "i"(type)) - +#define _set_tssldt_desc(desc,ad...
2007 Apr 18
0
[PATCH 9/12] base-into-desc
...@@ "2" (prev), "d" (next)); \ } while (0) -#define _set_base(desc,base) do { \ - unsigned long __tmp; \ - typecheck(struct desc_struct *, desc); \ - asm volatile("movw %w5,%2\n\t" \ - "rorl $16,%5\n\t" \ - "movb %b5,%3\n\t" \ - "movb %h5,%4" \ - :"=m"(*(desc)), \ - "=&q" (__tmp) \ - :"m" (*((char *)(desc)+2)), \ - "m" (*((char *)(desc)+4)), \ - "m" (*((char *)(desc)+7)), \ -...
2007 Apr 18
1
[PATCH 5/14] i386 / Use early clobber to eliminate rotate in desc
...@ -34,17 +34,21 @@ extern struct desc_struct default_ldt[]; extern void set_intr_gate(unsigned int irq, void * addr); -#define _set_tssldt_desc(n,addr,limit,type) \ -__asm__ __volatile__ ("movw %w3,0(%2)\n\t" \ - "movw %w1,2(%2)\n\t" \ - "rorl $16,%1\n\t" \ - "movb %b1,4(%2)\n\t" \ - "movb %4,5(%2)\n\t" \ - "movb $0,6(%2)\n\t" \ - "movb %h1,7(%2)\n\t" \ - "rorl $16,%1" \ - : "=m"(*(n)) : "q" (addr), "r"(n), "ir"(limit), "i"(type)) - +#define _set_tssldt_desc(desc,ad...
2007 Apr 18
0
[PATCH 10/14] i386 / Move descriptor accessors into desc h
...@@ "2" (prev), "d" (next)); \ } while (0) -#define _set_base(desc,base) do { \ - unsigned long __tmp; \ - typecheck(struct desc_struct *, desc); \ - asm volatile("movw %w5,%2\n\t" \ - "rorl $16,%5\n\t" \ - "movb %b5,%3\n\t" \ - "movb %h5,%4" \ - :"=m"(*(desc)), \ - "=&q" (__tmp) \ - :"m" (*((char *)(desc)+2)), \ - "m" (*((char *)(desc)+4)), \ - "m" (*((char *)(desc)+7)), \ -...
2007 Apr 18
0
[PATCH 9/14] i386 / Typecheck and optimize base and limit accessors
...m-i386/system.h 2005-08-10 20:41:03.000000000 -0700 @@ -29,49 +29,39 @@ "2" (prev), "d" (next)); \ } while (0) -#define _set_base(addr,base) do { unsigned long __pr; \ -__asm__ __volatile__ ("movw %%dx,%1\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %%dl,%2\n\t" \ - "movb %%dh,%3" \ - :"=&d" (__pr) \ - :"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7)), \ - "0" (base) \ - ); } while(0) - -#define _set_limit(addr,limit) do { unsigned long __lr; \...
2007 Apr 18
0
[PATCH 10/14] i386 / Move descriptor accessors into desc h
...@@ "2" (prev), "d" (next)); \ } while (0) -#define _set_base(desc,base) do { \ - unsigned long __tmp; \ - typecheck(struct desc_struct *, desc); \ - asm volatile("movw %w5,%2\n\t" \ - "rorl $16,%5\n\t" \ - "movb %b5,%3\n\t" \ - "movb %h5,%4" \ - :"=m"(*(desc)), \ - "=&q" (__tmp) \ - :"m" (*((char *)(desc)+2)), \ - "m" (*((char *)(desc)+4)), \ - "m" (*((char *)(desc)+7)), \ -...