Project

General

Profile

Actions

Bug #8683

open

Nonoptimal preparator generation

Added by Alexander Kamkin almost 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Category:
-
Target version:
Start date:
01/22/2018
Due date:
% Done:

100%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

There is a simpler way to load zero.

    ori r8, r0, 0x0
    dsll r8, r8, 16
    ori r8, r8, 0x0
    dsll r8, r8, 16
    ori r8, r8, 0x0
    dsll r8, r8, 16
    ori r8, r8, 0x0
Actions #1

Updated by Alexander Protsenko almost 7 years ago

  • Status changed from New to Feedback
  • Assignee changed from Alexander Protsenko to Alexander Kamkin

I could't repeat this bug.

Use: preparators_test.rb

    prepare t1, -1
    trace "prepare -1 in t1 = %x", gpr_observer(9)

    prepare t1, 0
    trace "prepare 0 in t1 = %x", gpr_observer(9)

    prepare t1, -2
    trace "prepare -2 in t1 = %x", gpr_observer(9)

    prepare t2, 0xFF120000
    trace "prepare 0xFF120000 in t2 = %x", gpr_observer(10)

Result:

Run preparators:
0xffffffffa0004024 nor r9, r0, r0
prepare -1 in t1 = ffffffffffffffff

0xffffffffa0004028 or r9, r0, r0
prepare 0 in t1 = 0

0xffffffffa000402c lui r9, 0xffff
0xffffffffa0004030 ori r9, r9, 0xfffe
prepare -2 in t1 = fffffffffffffffe

0xffffffffa0004034 ori r10, r0, 0xff12
0xffffffffa0004038 dsll r10, r10, 16
prepare 0xFF120000 in t2 = ff120000

Update: 029b03539888976ff67bcabaf78481ff5664fae4

Actions #2

Updated by Alexander Protsenko almost 7 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF